griptape-nodes 0.48.0__py3-none-any.whl → 0.49.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 +12 -33
- griptape_nodes/app/app.py +6 -5
- griptape_nodes/bootstrap/workflow_executors/local_workflow_executor.py +10 -2
- griptape_nodes/utils/version_utils.py +75 -0
- {griptape_nodes-0.48.0.dist-info → griptape_nodes-0.49.0.dist-info}/METADATA +1 -1
- {griptape_nodes-0.48.0.dist-info → griptape_nodes-0.49.0.dist-info}/RECORD +8 -8
- {griptape_nodes-0.48.0.dist-info → griptape_nodes-0.49.0.dist-info}/WHEEL +1 -1
- {griptape_nodes-0.48.0.dist-info → griptape_nodes-0.49.0.dist-info}/entry_points.txt +0 -0
griptape_nodes/__init__.py
CHANGED
|
@@ -32,7 +32,13 @@ with console.status("Loading Griptape Nodes...") as status:
|
|
|
32
32
|
from griptape_nodes.retained_mode.managers.os_manager import OSManager
|
|
33
33
|
from griptape_nodes.retained_mode.managers.secrets_manager import SecretsManager
|
|
34
34
|
from griptape_nodes.utils.uv_utils import find_uv_bin
|
|
35
|
-
from griptape_nodes.utils.version_utils import
|
|
35
|
+
from griptape_nodes.utils.version_utils import (
|
|
36
|
+
get_complete_version_string,
|
|
37
|
+
get_current_version,
|
|
38
|
+
get_install_source,
|
|
39
|
+
get_latest_version_git,
|
|
40
|
+
get_latest_version_pypi,
|
|
41
|
+
)
|
|
36
42
|
|
|
37
43
|
CONFIG_DIR = xdg_config_home() / "griptape_nodes"
|
|
38
44
|
DATA_DIR = xdg_data_home() / "griptape_nodes"
|
|
@@ -642,38 +648,11 @@ def _get_latest_version(package: str, install_source: str) -> str:
|
|
|
642
648
|
str: Latest release tag (e.g., "v0.31.4")
|
|
643
649
|
"""
|
|
644
650
|
if install_source == "pypi":
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
response.raise_for_status()
|
|
651
|
-
data = response.json()
|
|
652
|
-
return f"v{data['info']['version']}"
|
|
653
|
-
except httpx.HTTPStatusError as e:
|
|
654
|
-
console.print(f"[red]Error fetching latest version: {e}[/red]")
|
|
655
|
-
return get_current_version()
|
|
656
|
-
elif install_source == "git":
|
|
657
|
-
# We only install auto updating from the 'latest' tag
|
|
658
|
-
revision = LATEST_TAG
|
|
659
|
-
update_url = GITHUB_UPDATE_URL.format(package=package, revision=revision)
|
|
660
|
-
|
|
661
|
-
with httpx.Client() as client:
|
|
662
|
-
response = client.get(update_url)
|
|
663
|
-
try:
|
|
664
|
-
response.raise_for_status()
|
|
665
|
-
# Get the latest commit SHA for the tag, this effectively the latest version of the package
|
|
666
|
-
data = response.json()
|
|
667
|
-
if "object" in data and "sha" in data["object"]:
|
|
668
|
-
return data["object"]["sha"][:7]
|
|
669
|
-
# Should not happen, but if it does, return the current version
|
|
670
|
-
return get_current_version()
|
|
671
|
-
except httpx.HTTPStatusError as e:
|
|
672
|
-
console.print(f"[red]Error fetching latest version: {e}[/red]")
|
|
673
|
-
return get_current_version()
|
|
674
|
-
else:
|
|
675
|
-
# If the package is installed from a file, just return the current version since the user is likely managing it manually
|
|
676
|
-
return get_current_version()
|
|
651
|
+
return get_latest_version_pypi(package, PYPI_UPDATE_URL)
|
|
652
|
+
if install_source == "git":
|
|
653
|
+
return get_latest_version_git(package, GITHUB_UPDATE_URL, LATEST_TAG)
|
|
654
|
+
# If the package is installed from a file, just return the current version since the user is likely managing it manually
|
|
655
|
+
return get_current_version()
|
|
677
656
|
|
|
678
657
|
|
|
679
658
|
def _auto_update_self() -> None:
|
griptape_nodes/app/app.py
CHANGED
|
@@ -92,7 +92,6 @@ def start_app() -> None:
|
|
|
92
92
|
Starts the event loop and listens for events from the Nodes API.
|
|
93
93
|
"""
|
|
94
94
|
_init_event_listeners()
|
|
95
|
-
|
|
96
95
|
# Listen for any signals to exit the app
|
|
97
96
|
for sig in (signal.SIGINT, signal.SIGTERM):
|
|
98
97
|
signal.signal(sig, lambda *_: sys.exit(0))
|
|
@@ -100,11 +99,9 @@ def start_app() -> None:
|
|
|
100
99
|
api_key = _ensure_api_key()
|
|
101
100
|
threading.Thread(target=mcp_server, args=(api_key,), daemon=True).start()
|
|
102
101
|
threading.Thread(target=_listen_for_api_events, args=(api_key,), daemon=True).start()
|
|
103
|
-
|
|
104
102
|
if STATIC_SERVER_ENABLED:
|
|
105
103
|
static_dir = _build_static_dir()
|
|
106
104
|
threading.Thread(target=start_api, args=(static_dir, event_queue), daemon=True).start()
|
|
107
|
-
|
|
108
105
|
_process_event_queue()
|
|
109
106
|
|
|
110
107
|
|
|
@@ -263,8 +260,12 @@ def _process_event_queue() -> None:
|
|
|
263
260
|
Event queue will be populated by background threads listening for events from the Nodes API.
|
|
264
261
|
"""
|
|
265
262
|
# Wait for WebSocket connection to be established before processing events
|
|
266
|
-
ws_ready_event.wait()
|
|
267
|
-
|
|
263
|
+
timed_out = ws_ready_event.wait(timeout=15)
|
|
264
|
+
if not timed_out:
|
|
265
|
+
console.print(
|
|
266
|
+
"[red] The connection to the websocket timed out. Please check your internet connection or the status of Griptape Nodes API.[/red]"
|
|
267
|
+
)
|
|
268
|
+
sys.exit(1)
|
|
268
269
|
while True:
|
|
269
270
|
event = event_queue.get(block=True)
|
|
270
271
|
if isinstance(event, EventRequest):
|
|
@@ -92,7 +92,7 @@ class LocalWorkflowExecutor(WorkflowExecutor):
|
|
|
92
92
|
node_name = result_event.payload.node_name
|
|
93
93
|
flow_name = GriptapeNodes.NodeManager().get_node_parent_flow_by_name(node_name)
|
|
94
94
|
event_request = EventRequest(request=SingleExecutionStepRequest(flow_name=flow_name))
|
|
95
|
-
|
|
95
|
+
self.queue.put(event_request)
|
|
96
96
|
|
|
97
97
|
elif type(result_event.payload).__name__ == "NodeFinishProcessEvent":
|
|
98
98
|
event_log = f"NodeFinishProcessEvent: {result_event.payload}"
|
|
@@ -196,7 +196,13 @@ class LocalWorkflowExecutor(WorkflowExecutor):
|
|
|
196
196
|
try:
|
|
197
197
|
event = self.queue.get(block=True)
|
|
198
198
|
|
|
199
|
-
if isinstance(event,
|
|
199
|
+
if isinstance(event, EventRequest):
|
|
200
|
+
# Handle EventRequest objects by processing them through GriptapeNodes
|
|
201
|
+
request_payload = event.request
|
|
202
|
+
GriptapeNodes.handle_request(
|
|
203
|
+
request_payload, response_topic=event.response_topic, request_id=event.request_id
|
|
204
|
+
)
|
|
205
|
+
elif isinstance(event, ExecutionGriptapeNodeEvent):
|
|
200
206
|
result_event = event.wrapped_event
|
|
201
207
|
|
|
202
208
|
if type(result_event.payload).__name__ == "ControlFlowResolvedEvent":
|
|
@@ -208,6 +214,8 @@ class LocalWorkflowExecutor(WorkflowExecutor):
|
|
|
208
214
|
is_flow_finished = True
|
|
209
215
|
logger.error(msg)
|
|
210
216
|
error = LocalExecutorError(msg)
|
|
217
|
+
else:
|
|
218
|
+
logger.info("Unknown event type encountered: %s", type(event))
|
|
211
219
|
|
|
212
220
|
self.queue.task_done()
|
|
213
221
|
|
|
@@ -6,6 +6,11 @@ import importlib.metadata
|
|
|
6
6
|
import json
|
|
7
7
|
from typing import Literal
|
|
8
8
|
|
|
9
|
+
import httpx
|
|
10
|
+
from rich.console import Console
|
|
11
|
+
|
|
12
|
+
console = Console()
|
|
13
|
+
|
|
9
14
|
engine_version = importlib.metadata.version("griptape_nodes")
|
|
10
15
|
|
|
11
16
|
|
|
@@ -49,3 +54,73 @@ def get_complete_version_string() -> str:
|
|
|
49
54
|
if commit_id is None:
|
|
50
55
|
return f"{version} ({source})"
|
|
51
56
|
return f"{version} ({source} - {commit_id})"
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def get_latest_version_pypi(package: str, pypi_url: str) -> str:
|
|
60
|
+
"""Gets the latest version from PyPI.
|
|
61
|
+
|
|
62
|
+
Args:
|
|
63
|
+
package: The name of the package to fetch the latest version for.
|
|
64
|
+
pypi_url: The PyPI URL template to use.
|
|
65
|
+
|
|
66
|
+
Returns:
|
|
67
|
+
str: Latest release tag (e.g., "v0.31.4") or current version if fetch fails.
|
|
68
|
+
"""
|
|
69
|
+
version = get_current_version()
|
|
70
|
+
update_url = pypi_url.format(package=package)
|
|
71
|
+
|
|
72
|
+
with httpx.Client(timeout=30.0) as client:
|
|
73
|
+
try:
|
|
74
|
+
response = client.get(update_url)
|
|
75
|
+
except httpx.RequestError as e:
|
|
76
|
+
console.print(f"[red]Error fetching latest version due to error: [/red][cyan]{e}[/cyan]")
|
|
77
|
+
console.print(
|
|
78
|
+
f"[red]Please check your internet connection or if you can access the following update url: [/red] [cyan]{update_url}[/cyan]"
|
|
79
|
+
)
|
|
80
|
+
return version
|
|
81
|
+
|
|
82
|
+
try:
|
|
83
|
+
response.raise_for_status()
|
|
84
|
+
data = response.json()
|
|
85
|
+
if "info" in data and "version" in data["info"]:
|
|
86
|
+
version = f"v{data['info']['version']}"
|
|
87
|
+
except httpx.HTTPStatusError as e:
|
|
88
|
+
console.print(f"[red]Error fetching latest version: {e}[/red]")
|
|
89
|
+
|
|
90
|
+
return version
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def get_latest_version_git(package: str, github_url: str, latest_tag: str) -> str:
|
|
94
|
+
"""Gets the latest version from Git.
|
|
95
|
+
|
|
96
|
+
Args:
|
|
97
|
+
package: The name of the package to fetch the latest version for.
|
|
98
|
+
github_url: The GitHub URL template to use.
|
|
99
|
+
latest_tag: The tag to fetch (usually 'latest').
|
|
100
|
+
|
|
101
|
+
Returns:
|
|
102
|
+
str: Latest commit SHA (first 7 characters) or current version if fetch fails.
|
|
103
|
+
"""
|
|
104
|
+
version = get_current_version()
|
|
105
|
+
revision = latest_tag
|
|
106
|
+
update_url = github_url.format(package=package, revision=revision)
|
|
107
|
+
|
|
108
|
+
with httpx.Client(timeout=30.0) as client:
|
|
109
|
+
try:
|
|
110
|
+
response = client.get(update_url)
|
|
111
|
+
except httpx.RequestError as e:
|
|
112
|
+
console.print(f"[red]Error fetching latest version due to error: [/red][cyan]{e}[/cyan]")
|
|
113
|
+
console.print(
|
|
114
|
+
f"[red]Please check your internet connection or if you can access the following update url: [/red] [cyan]{update_url}[/cyan]"
|
|
115
|
+
)
|
|
116
|
+
return version
|
|
117
|
+
|
|
118
|
+
try:
|
|
119
|
+
response.raise_for_status()
|
|
120
|
+
data = response.json()
|
|
121
|
+
if "object" in data and "sha" in data["object"]:
|
|
122
|
+
version = data["object"]["sha"][:7]
|
|
123
|
+
except httpx.HTTPStatusError as e:
|
|
124
|
+
console.print(f"[red]Error fetching latest version: {e}[/red]")
|
|
125
|
+
|
|
126
|
+
return version
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
griptape_nodes/__init__.py,sha256=
|
|
1
|
+
griptape_nodes/__init__.py,sha256=ca4ec8ef95679e0a98c8e75a539ee1a6eb00c8bf2d1d88bf0e44edb9b778e192,37367
|
|
2
2
|
griptape_nodes/app/.python-version,sha256=7b55f8e67b5623c4bef3fa691288da9437d79d3aba156de48d481db32ac7d16d,5
|
|
3
3
|
griptape_nodes/app/__init__.py,sha256=0c1f834ec81c3676e6102957128bb0cc686b9a8de01c10965c1f4190f1a97502,90
|
|
4
4
|
griptape_nodes/app/api.py,sha256=46a36af068a4784b0317daede79befd59198320c3934ee1b84c74b297108774f,6925
|
|
5
|
-
griptape_nodes/app/app.py,sha256=
|
|
5
|
+
griptape_nodes/app/app.py,sha256=4d494cb0e1ba87c288b19a76c01015629c104fdf7a8668b6abf42e6e8baeaade,17984
|
|
6
6
|
griptape_nodes/app/watch.py,sha256=413353c7811b54440276277250d766b3be30edf8eb8c128069dbb52d40e9e962,2064
|
|
7
7
|
griptape_nodes/bootstrap/__init__.py,sha256=10dbf7488cd0f53b6546b835cb87b80a7a01a49685a454a43694c5055f17e4bb,25
|
|
8
8
|
griptape_nodes/bootstrap/workflow_executors/__init__.py,sha256=a728cdf35f9e2ed8f21021582d73ad3028b18a223da818b9c9a95df3a88cec49,34
|
|
9
|
-
griptape_nodes/bootstrap/workflow_executors/local_workflow_executor.py,sha256=
|
|
9
|
+
griptape_nodes/bootstrap/workflow_executors/local_workflow_executor.py,sha256=f09128692368e073d18cc602bcc0c81af8317eb4bfff486b30154262eb45f578,9274
|
|
10
10
|
griptape_nodes/bootstrap/workflow_executors/subprocess_workflow_executor.py,sha256=b610be5ba3b459d1f0f0ee6a01fa104bed225d6081ae1db42626de8c7bc6c90c,3347
|
|
11
11
|
griptape_nodes/bootstrap/workflow_executors/workflow_executor.py,sha256=945000fb96d6cabd8a7f53324b9d2f5f549e1bb976ce66d2adbe7f932c8822ba,417
|
|
12
12
|
griptape_nodes/drivers/__init__.py,sha256=b479a21509fab89c855610b63eba87811507ddddf20eca8c4295aa45ab266aa0,42
|
|
@@ -113,7 +113,7 @@ griptape_nodes/utils/dict_utils.py,sha256=932962e4c39fcd2a2bd1af259977d80554bf35
|
|
|
113
113
|
griptape_nodes/utils/image_preview.py,sha256=361608aa885117dbdb16958812f64774f2cb3cafc975406f0b846f340b126b5c,4480
|
|
114
114
|
griptape_nodes/utils/metaclasses.py,sha256=4522b202f669a47fe16ccba0994988afc42a3a0d6c618e2e44d7d0c9b0f83bc4,287
|
|
115
115
|
griptape_nodes/utils/uv_utils.py,sha256=64adfb2e669c29fc4c54a91c20ec89df91ce5e057ab05584f42ce028f99a454d,519
|
|
116
|
-
griptape_nodes/utils/version_utils.py,sha256=
|
|
116
|
+
griptape_nodes/utils/version_utils.py,sha256=63e1c97c95ba271bb3fe33a71f1322cbea6631ab8746763eec13b76a51a6c3e4,4318
|
|
117
117
|
griptape_nodes/version_compatibility/__init__.py,sha256=24ccf5b01ed9b23ea94b54b9b1db0f474927f3db35034b01d24148bf280961fa,74
|
|
118
118
|
griptape_nodes/version_compatibility/versions/__init__.py,sha256=3d64b1336f0b3d47417513c0f7c8f84545afb99e0da9f5f575acb6554e92a8fc,74
|
|
119
119
|
griptape_nodes/version_compatibility/versions/v0_39_0/__init__.py,sha256=db588a945a6c9815b85ac01ec520f458c0099ec62632adac21b0de602f37d5f7,62
|
|
@@ -121,7 +121,7 @@ griptape_nodes/version_compatibility/versions/v0_39_0/modified_parameters_set_re
|
|
|
121
121
|
griptape_nodes/version_compatibility/workflow_versions/__init__.py,sha256=cf95c38248b3a0d072097a72a37e217ec24a16c5a53876c3ea18337d81fdb9b7,52
|
|
122
122
|
griptape_nodes/version_compatibility/workflow_versions/v0_7_0/__init__.py,sha256=2333cf9862bcea1dacc1f1864ce1f255c04894e9e0e928e0590ce56dfde7826a,51
|
|
123
123
|
griptape_nodes/version_compatibility/workflow_versions/v0_7_0/local_executor_argument_addition.py,sha256=f4f725029fcc9b920fb5de728f95d24b9fb1ed062689fbe14e5cb6d02801666a,2018
|
|
124
|
-
griptape_nodes-0.
|
|
125
|
-
griptape_nodes-0.
|
|
126
|
-
griptape_nodes-0.
|
|
127
|
-
griptape_nodes-0.
|
|
124
|
+
griptape_nodes-0.49.0.dist-info/WHEEL,sha256=0f7d664a881437bddec71c703c3c2f01fd13581519f95130abcc96e296ef0426,79
|
|
125
|
+
griptape_nodes-0.49.0.dist-info/entry_points.txt,sha256=aaf7afa9ddc155b015e5371a9ed9c09b4a2ea9aa982a1b113b7a641729962d63,82
|
|
126
|
+
griptape_nodes-0.49.0.dist-info/METADATA,sha256=300c28a67c7d0fdcb6bcc173a4131b3b14818dfc55af1dcd53d5db3b7b7fdae1,4980
|
|
127
|
+
griptape_nodes-0.49.0.dist-info/RECORD,,
|
|
File without changes
|