griptape-nodes 0.40.0__py3-none-any.whl → 0.42.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.
Files changed (49) hide show
  1. griptape_nodes/app/__init__.py +1 -5
  2. griptape_nodes/app/app.py +12 -9
  3. griptape_nodes/app/app_sessions.py +132 -36
  4. griptape_nodes/app/watch.py +3 -1
  5. griptape_nodes/drivers/storage/local_storage_driver.py +3 -2
  6. griptape_nodes/exe_types/flow.py +68 -368
  7. griptape_nodes/machines/control_flow.py +16 -13
  8. griptape_nodes/machines/node_resolution.py +16 -14
  9. griptape_nodes/node_library/workflow_registry.py +2 -2
  10. griptape_nodes/retained_mode/events/agent_events.py +70 -8
  11. griptape_nodes/retained_mode/events/app_events.py +132 -11
  12. griptape_nodes/retained_mode/events/arbitrary_python_events.py +23 -0
  13. griptape_nodes/retained_mode/events/base_events.py +7 -25
  14. griptape_nodes/retained_mode/events/config_events.py +87 -11
  15. griptape_nodes/retained_mode/events/connection_events.py +56 -5
  16. griptape_nodes/retained_mode/events/context_events.py +27 -4
  17. griptape_nodes/retained_mode/events/execution_events.py +99 -14
  18. griptape_nodes/retained_mode/events/flow_events.py +165 -7
  19. griptape_nodes/retained_mode/events/library_events.py +193 -15
  20. griptape_nodes/retained_mode/events/logger_events.py +11 -0
  21. griptape_nodes/retained_mode/events/node_events.py +243 -22
  22. griptape_nodes/retained_mode/events/object_events.py +40 -4
  23. griptape_nodes/retained_mode/events/os_events.py +13 -2
  24. griptape_nodes/retained_mode/events/parameter_events.py +212 -8
  25. griptape_nodes/retained_mode/events/secrets_events.py +59 -7
  26. griptape_nodes/retained_mode/events/static_file_events.py +57 -4
  27. griptape_nodes/retained_mode/events/validation_events.py +39 -4
  28. griptape_nodes/retained_mode/events/workflow_events.py +188 -17
  29. griptape_nodes/retained_mode/griptape_nodes.py +46 -323
  30. griptape_nodes/retained_mode/managers/agent_manager.py +1 -1
  31. griptape_nodes/retained_mode/managers/engine_identity_manager.py +146 -0
  32. griptape_nodes/retained_mode/managers/event_manager.py +14 -2
  33. griptape_nodes/retained_mode/managers/flow_manager.py +749 -64
  34. griptape_nodes/retained_mode/managers/library_manager.py +112 -2
  35. griptape_nodes/retained_mode/managers/node_manager.py +35 -32
  36. griptape_nodes/retained_mode/managers/object_manager.py +11 -3
  37. griptape_nodes/retained_mode/managers/os_manager.py +70 -1
  38. griptape_nodes/retained_mode/managers/secrets_manager.py +4 -0
  39. griptape_nodes/retained_mode/managers/session_manager.py +328 -0
  40. griptape_nodes/retained_mode/managers/settings.py +7 -0
  41. griptape_nodes/retained_mode/managers/workflow_manager.py +523 -454
  42. griptape_nodes/retained_mode/retained_mode.py +44 -0
  43. griptape_nodes/retained_mode/utils/engine_identity.py +141 -27
  44. {griptape_nodes-0.40.0.dist-info → griptape_nodes-0.42.0.dist-info}/METADATA +2 -2
  45. {griptape_nodes-0.40.0.dist-info → griptape_nodes-0.42.0.dist-info}/RECORD +48 -47
  46. griptape_nodes/retained_mode/utils/session_persistence.py +0 -105
  47. {griptape_nodes-0.40.0.dist-info → griptape_nodes-0.42.0.dist-info}/WHEEL +0 -0
  48. {griptape_nodes-0.40.0.dist-info → griptape_nodes-0.42.0.dist-info}/entry_points.txt +0 -0
  49. {griptape_nodes-0.40.0.dist-info → griptape_nodes-0.42.0.dist-info}/licenses/LICENSE +0 -0
@@ -11,32 +11,65 @@ from griptape_nodes.retained_mode.events.base_events import (
11
11
  )
12
12
  from griptape_nodes.retained_mode.events.node_events import SerializedNodeCommands
13
13
  from griptape_nodes.retained_mode.events.payload_registry import PayloadRegistry
14
+ from griptape_nodes.retained_mode.events.workflow_events import ImportWorkflowAsReferencedSubFlowRequest
14
15
 
15
16
 
16
17
  @dataclass(kw_only=True)
17
18
  @PayloadRegistry.register
18
19
  class CreateFlowRequest(RequestPayload):
20
+ """Create a new flow (sub-workflow) within a parent flow.
21
+
22
+ Use when: Creating sub-workflows, organizing complex workflows into components,
23
+ implementing reusable workflow patterns, building hierarchical workflows.
24
+
25
+ Args:
26
+ parent_flow_name: Name of the parent flow to create the new flow within
27
+ flow_name: Name for the new flow (None for auto-generated)
28
+ set_as_new_context: Whether to set this flow as the new current context
29
+ metadata: Initial metadata for the flow
30
+
31
+ Results: CreateFlowResultSuccess (with flow name) | CreateFlowResultFailure (parent not found, name conflicts)
32
+ """
33
+
19
34
  parent_flow_name: str | None
20
35
  flow_name: str | None = None
21
36
  # When True, this Flow will be pushed as the new Current Context.
22
37
  set_as_new_context: bool = True
38
+ metadata: dict | None = None
23
39
 
24
40
 
25
41
  @dataclass
26
42
  @PayloadRegistry.register
27
43
  class CreateFlowResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
44
+ """Flow created successfully.
45
+
46
+ Args:
47
+ flow_name: Name assigned to the new flow
48
+ """
49
+
28
50
  flow_name: str
29
51
 
30
52
 
31
53
  @dataclass
32
54
  @PayloadRegistry.register
33
55
  class CreateFlowResultFailure(ResultPayloadFailure):
34
- pass
56
+ """Flow creation failed. Common causes: parent flow not found, name conflicts, invalid parameters."""
35
57
 
36
58
 
37
59
  @dataclass
38
60
  @PayloadRegistry.register
39
61
  class DeleteFlowRequest(RequestPayload):
62
+ """Delete a flow and all its contents.
63
+
64
+ Use when: Removing unused sub-workflows, cleaning up complex workflows,
65
+ implementing flow management features. Cascades to delete all nodes and sub-flows.
66
+
67
+ Args:
68
+ flow_name: Name of the flow to delete (None for current context flow)
69
+
70
+ Results: DeleteFlowResultSuccess | DeleteFlowResultFailure (flow not found, deletion not allowed)
71
+ """
72
+
40
73
  # If None is passed, assumes we're deleting the flow in the Current Context.
41
74
  flow_name: str | None = None
42
75
 
@@ -44,18 +77,29 @@ class DeleteFlowRequest(RequestPayload):
44
77
  @dataclass
45
78
  @PayloadRegistry.register
46
79
  class DeleteFlowResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
47
- pass
80
+ """Flow deleted successfully. All nodes and sub-flows removed."""
48
81
 
49
82
 
50
83
  @dataclass
51
84
  @PayloadRegistry.register
52
85
  class DeleteFlowResultFailure(ResultPayloadFailure):
53
- pass
86
+ """Flow deletion failed. Common causes: flow not found, no current context, deletion not allowed."""
54
87
 
55
88
 
56
89
  @dataclass
57
90
  @PayloadRegistry.register
58
91
  class ListNodesInFlowRequest(RequestPayload):
92
+ """List all nodes in a specific flow.
93
+
94
+ Use when: Inspecting flow contents, building flow visualizations,
95
+ implementing flow management features, debugging workflow structure.
96
+
97
+ Args:
98
+ flow_name: Name of the flow to list nodes from (None for current context flow)
99
+
100
+ Results: ListNodesInFlowResultSuccess (with node names) | ListNodesInFlowResultFailure (flow not found)
101
+ """
102
+
59
103
  # If None is passed, assumes we're using the flow in the Current Context.
60
104
  flow_name: str | None = None
61
105
 
@@ -63,13 +107,19 @@ class ListNodesInFlowRequest(RequestPayload):
63
107
  @dataclass
64
108
  @PayloadRegistry.register
65
109
  class ListNodesInFlowResultSuccess(WorkflowNotAlteredMixin, ResultPayloadSuccess):
110
+ """Flow nodes listed successfully.
111
+
112
+ Args:
113
+ node_names: List of node names in the flow
114
+ """
115
+
66
116
  node_names: list[str]
67
117
 
68
118
 
69
119
  @dataclass
70
120
  @PayloadRegistry.register
71
121
  class ListNodesInFlowResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
72
- pass
122
+ """Flow nodes listing failed. Common causes: flow not found, no current context."""
73
123
 
74
124
 
75
125
  # We have two different ways to list flows:
@@ -137,8 +187,9 @@ class SerializedFlowCommands:
137
187
  Attributes:
138
188
  node_libraries_used (set[LibraryNameAndVersion]): Set of libraries and versions used by the nodes,
139
189
  including those in child flows.
140
- create_flow_command (CreateFlowRequest | None): Command to create the flow that contains all of this.
141
- If None, will deserialize into whatever Flow is in the Current Context.
190
+ flow_initialization_command (CreateFlowRequest | ImportWorkflowAsReferencedSubFlowRequest | None): Command to initialize the flow that contains all of this.
191
+ Can be CreateFlowRequest for standalone flows, ImportWorkflowAsReferencedSubFlowRequest for referenced workflows,
192
+ or None to deserialize into whatever Flow is in the Current Context.
142
193
  serialized_node_commands (list[SerializedNodeCommands]): List of serialized commands for nodes.
143
194
  Handles creating all of the nodes themselves, along with configuring them. Does NOT set Parameter values,
144
195
  which is done as a separate step.
@@ -148,6 +199,8 @@ class SerializedFlowCommands:
148
199
  set_parameter_value_commands (dict[SerializedNodeCommands.NodeUUID, list[SerializedNodeCommands.IndirectSetParameterValueCommand]]): List of commands
149
200
  to set parameter values, keyed by node UUID, during deserialization.
150
201
  sub_flows_commands (list["SerializedFlowCommands"]): List of sub-flow commands. Cascades into sub-flows within this serialization.
202
+ referenced_workflows (set[str]): Set of workflow file paths that are referenced by this flow and its sub-flows.
203
+ Used for validation before deserialization to ensure all referenced workflows are available.
151
204
  """
152
205
 
153
206
  @dataclass
@@ -169,7 +222,7 @@ class SerializedFlowCommands:
169
222
  target_parameter_name: str
170
223
 
171
224
  node_libraries_used: set[LibraryNameAndVersion]
172
- create_flow_command: CreateFlowRequest | None
225
+ flow_initialization_command: CreateFlowRequest | ImportWorkflowAsReferencedSubFlowRequest | None
173
226
  serialized_node_commands: list[SerializedNodeCommands]
174
227
  serialized_connections: list[IndirectConnectionSerialization]
175
228
  unique_parameter_uuid_to_values: dict[SerializedNodeCommands.UniqueParameterValueUUID, Any]
@@ -177,6 +230,7 @@ class SerializedFlowCommands:
177
230
  SerializedNodeCommands.NodeUUID, list[SerializedNodeCommands.IndirectSetParameterValueCommand]
178
231
  ]
179
232
  sub_flows_commands: list["SerializedFlowCommands"]
233
+ referenced_workflows: set[str]
180
234
 
181
235
 
182
236
  @dataclass
@@ -223,3 +277,107 @@ class DeserializeFlowFromCommandsResultSuccess(WorkflowAlteredMixin, ResultPaylo
223
277
  @PayloadRegistry.register
224
278
  class DeserializeFlowFromCommandsResultFailure(ResultPayloadFailure):
225
279
  pass
280
+
281
+
282
+ @dataclass
283
+ @PayloadRegistry.register
284
+ class GetFlowDetailsRequest(RequestPayload):
285
+ """Request payload to get detailed information about a flow.
286
+
287
+ This provides metadata about a flow including its reference status and parent hierarchy,
288
+ useful for editor integration to display flows appropriately.
289
+
290
+ Attributes:
291
+ flow_name (str | None): The name of the flow to get details for. If None is passed,
292
+ assumes we're getting details for the flow in the Current Context.
293
+ """
294
+
295
+ # If None is passed, assumes we're getting details for the flow in the Current Context.
296
+ flow_name: str | None = None
297
+
298
+
299
+ @dataclass
300
+ @PayloadRegistry.register
301
+ class GetFlowDetailsResultSuccess(WorkflowNotAlteredMixin, ResultPayloadSuccess):
302
+ """Success result containing flow details.
303
+
304
+ Attributes:
305
+ referenced_workflow_name (str | None): The name of the workflow that was
306
+ imported to create this flow. None if this flow was created standalone.
307
+ parent_flow_name (str | None): The name of the parent flow, or None if this is a
308
+ top-level flow.
309
+ """
310
+
311
+ referenced_workflow_name: str | None
312
+ parent_flow_name: str | None
313
+
314
+
315
+ @dataclass
316
+ @PayloadRegistry.register
317
+ class GetFlowDetailsResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
318
+ """Failure result when flow details cannot be retrieved.
319
+
320
+ This occurs when the specified flow doesn't exist, the current context is empty
321
+ (when flow_name is None), or there are issues with the flow's parent mapping.
322
+ """
323
+
324
+
325
+ @dataclass
326
+ @PayloadRegistry.register
327
+ class GetFlowMetadataRequest(RequestPayload):
328
+ """Get metadata associated with a flow.
329
+
330
+ Use when: Retrieving flow layout information, getting custom flow properties,
331
+ implementing flow management features, debugging flow state.
332
+
333
+ Results: GetFlowMetadataResultSuccess (with metadata dict) | GetFlowMetadataResultFailure (flow not found)
334
+ """
335
+
336
+ # If None is passed, assumes we're using the Flow in the Current Context
337
+ flow_name: str | None = None
338
+
339
+
340
+ @dataclass
341
+ @PayloadRegistry.register
342
+ class GetFlowMetadataResultSuccess(WorkflowNotAlteredMixin, ResultPayloadSuccess):
343
+ """Flow metadata retrieved successfully.
344
+
345
+ Args:
346
+ metadata: Dictionary containing flow metadata
347
+ """
348
+
349
+ metadata: dict
350
+
351
+
352
+ @dataclass
353
+ @PayloadRegistry.register
354
+ class GetFlowMetadataResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
355
+ """Flow metadata retrieval failed. Common causes: flow not found, no current context."""
356
+
357
+
358
+ @dataclass
359
+ @PayloadRegistry.register
360
+ class SetFlowMetadataRequest(RequestPayload):
361
+ """Set metadata associated with a flow.
362
+
363
+ Use when: Updating flow layout information, storing custom flow properties,
364
+ implementing flow management features, saving flow state.
365
+
366
+ Results: SetFlowMetadataResultSuccess | SetFlowMetadataResultFailure (flow not found, metadata error)
367
+ """
368
+
369
+ metadata: dict
370
+ # If None is passed, assumes we're using the Flow in the Current Context
371
+ flow_name: str | None = None
372
+
373
+
374
+ @dataclass
375
+ @PayloadRegistry.register
376
+ class SetFlowMetadataResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
377
+ """Flow metadata updated successfully."""
378
+
379
+
380
+ @dataclass
381
+ @PayloadRegistry.register
382
+ class SetFlowMetadataResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
383
+ """Flow metadata update failed. Common causes: flow not found, no current context, invalid metadata."""
@@ -20,42 +20,115 @@ if TYPE_CHECKING:
20
20
  @dataclass
21
21
  @PayloadRegistry.register
22
22
  class ListRegisteredLibrariesRequest(RequestPayload):
23
- pass
23
+ """List all currently registered libraries.
24
+
25
+ Use when: Displaying available libraries, checking library availability,
26
+ building library selection UIs, debugging library registration.
27
+
28
+ Results: ListRegisteredLibrariesResultSuccess (with library names) | ListRegisteredLibrariesResultFailure (system error)
29
+ """
24
30
 
25
31
 
26
32
  @dataclass
27
33
  @PayloadRegistry.register
28
34
  class ListRegisteredLibrariesResultSuccess(WorkflowNotAlteredMixin, ResultPayloadSuccess):
35
+ """Registered libraries listed successfully.
36
+
37
+ Args:
38
+ libraries: List of registered library names
39
+ """
40
+
29
41
  libraries: list[str]
30
42
 
31
43
 
32
44
  @dataclass
33
45
  @PayloadRegistry.register
34
46
  class ListRegisteredLibrariesResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
35
- pass
47
+ """Library listing failed. Common causes: registry not initialized, system error."""
48
+
49
+
50
+ @dataclass
51
+ @PayloadRegistry.register
52
+ class ListCapableLibraryEventHandlersRequest(RequestPayload):
53
+ """List libraries capable of handling a specific event type.
54
+
55
+ Use when: Finding libraries that can process specific events, implementing event routing,
56
+ library capability discovery, debugging event handling.
57
+
58
+ Results: ListCapableLibraryEventHandlersResultSuccess (with handler names) | ListCapableLibraryEventHandlersResultFailure (query error)
59
+ """
60
+
61
+ request_type: str
62
+
63
+
64
+ @dataclass
65
+ @PayloadRegistry.register
66
+ class ListCapableLibraryEventHandlersResultSuccess(WorkflowNotAlteredMixin, ResultPayloadSuccess):
67
+ """Event handlers listed successfully.
68
+
69
+ Args:
70
+ handlers: List of library names capable of handling the event type
71
+ """
72
+
73
+ handlers: list[str]
74
+
75
+
76
+ @dataclass
77
+ @PayloadRegistry.register
78
+ class ListCapableLibraryEventHandlersResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
79
+ """Event handlers listing failed. Common causes: invalid event type, registry error."""
36
80
 
37
81
 
38
82
  @dataclass
39
83
  @PayloadRegistry.register
40
84
  class ListNodeTypesInLibraryRequest(RequestPayload):
85
+ """List all node types available in a specific library.
86
+
87
+ Use when: Discovering available nodes, building node creation UIs,
88
+ validating node types, exploring library contents.
89
+
90
+ Args:
91
+ library: Name of the library to list node types for
92
+
93
+ Results: ListNodeTypesInLibraryResultSuccess (with node types) | ListNodeTypesInLibraryResultFailure (library not found)
94
+ """
95
+
41
96
  library: str
42
97
 
43
98
 
44
99
  @dataclass
45
100
  @PayloadRegistry.register
46
101
  class ListNodeTypesInLibraryResultSuccess(WorkflowNotAlteredMixin, ResultPayloadSuccess):
102
+ """Node types in library listed successfully.
103
+
104
+ Args:
105
+ node_types: List of node type names available in the library
106
+ """
107
+
47
108
  node_types: list[str]
48
109
 
49
110
 
50
111
  @dataclass
51
112
  @PayloadRegistry.register
52
113
  class ListNodeTypesInLibraryResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
53
- pass
114
+ """Node types listing failed. Common causes: library not found, library not loaded."""
54
115
 
55
116
 
56
117
  @dataclass
57
118
  @PayloadRegistry.register
58
119
  class GetNodeMetadataFromLibraryRequest(RequestPayload):
120
+ """Get metadata for a specific node type from a library.
121
+
122
+ Use when: Inspecting node capabilities, validating node types, building node creation UIs,
123
+ getting parameter definitions, checking node requirements.
124
+
125
+ Args:
126
+ library: Name of the library containing the node type
127
+ node_type: Name of the node type to get metadata for
128
+
129
+ Results: GetNodeMetadataFromLibraryResultSuccess (with metadata) | GetNodeMetadataFromLibraryResultFailure (node not found)
130
+ """
131
+
59
132
  library: str
60
133
  node_type: str
61
134
 
@@ -63,13 +136,19 @@ class GetNodeMetadataFromLibraryRequest(RequestPayload):
63
136
  @dataclass
64
137
  @PayloadRegistry.register
65
138
  class GetNodeMetadataFromLibraryResultSuccess(WorkflowNotAlteredMixin, ResultPayloadSuccess):
139
+ """Node metadata retrieved successfully from library.
140
+
141
+ Args:
142
+ metadata: Complete node metadata including parameters, description, requirements
143
+ """
144
+
66
145
  metadata: NodeMetadata
67
146
 
68
147
 
69
148
  @dataclass
70
149
  @PayloadRegistry.register
71
150
  class GetNodeMetadataFromLibraryResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
72
- pass
151
+ """Node metadata retrieval failed. Common causes: library not found, node type not found, library not loaded."""
73
152
 
74
153
 
75
154
  @dataclass
@@ -179,6 +258,18 @@ class LoadMetadataForAllLibrariesResultFailure(WorkflowNotAlteredMixin, ResultPa
179
258
  @dataclass
180
259
  @PayloadRegistry.register
181
260
  class RegisterLibraryFromFileRequest(RequestPayload):
261
+ """Register a library from a JSON file.
262
+
263
+ Use when: Loading custom libraries, adding new node types,
264
+ registering development libraries, extending node capabilities.
265
+
266
+ Args:
267
+ file_path: Path to the library JSON file to register
268
+ load_as_default_library: Whether to load as the default library (default: False)
269
+
270
+ Results: RegisterLibraryFromFileResultSuccess (with library name) | RegisterLibraryFromFileResultFailure (load error)
271
+ """
272
+
182
273
  file_path: str
183
274
  load_as_default_library: bool = False
184
275
 
@@ -186,18 +277,32 @@ class RegisterLibraryFromFileRequest(RequestPayload):
186
277
  @dataclass
187
278
  @PayloadRegistry.register
188
279
  class RegisterLibraryFromFileResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
280
+ """Library registered successfully from file.
281
+
282
+ Args:
283
+ library_name: Name of the registered library
284
+ """
285
+
189
286
  library_name: str
190
287
 
191
288
 
192
289
  @dataclass
193
290
  @PayloadRegistry.register
194
291
  class RegisterLibraryFromFileResultFailure(ResultPayloadFailure):
195
- pass
292
+ """Library registration from file failed. Common causes: file not found, invalid format, load error."""
196
293
 
197
294
 
198
295
  @dataclass
199
296
  @PayloadRegistry.register
200
297
  class RegisterLibraryFromRequirementSpecifierRequest(RequestPayload):
298
+ """Register a library from a requirement specifier (e.g., package name).
299
+
300
+ Use when: Installing libraries from package managers, adding dependencies,
301
+ registering third-party libraries, dynamic library loading.
302
+
303
+ Results: RegisterLibraryFromRequirementSpecifierResultSuccess (with library name) | RegisterLibraryFromRequirementSpecifierResultFailure (install error)
304
+ """
305
+
201
306
  requirement_specifier: str
202
307
  library_config_name: str = "griptape_nodes_library.json"
203
308
 
@@ -205,61 +310,111 @@ class RegisterLibraryFromRequirementSpecifierRequest(RequestPayload):
205
310
  @dataclass
206
311
  @PayloadRegistry.register
207
312
  class RegisterLibraryFromRequirementSpecifierResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
313
+ """Library registered successfully from requirement specifier.
314
+
315
+ Args:
316
+ library_name: Name of the registered library
317
+ """
318
+
208
319
  library_name: str
209
320
 
210
321
 
211
322
  @dataclass
212
323
  @PayloadRegistry.register
213
324
  class RegisterLibraryFromRequirementSpecifierResultFailure(ResultPayloadFailure):
214
- pass
325
+ """Library registration from requirement specifier failed. Common causes: package not found, installation error, invalid specifier."""
215
326
 
216
327
 
217
328
  @dataclass
218
329
  @PayloadRegistry.register
219
330
  class ListCategoriesInLibraryRequest(RequestPayload):
331
+ """List all categories available in a library.
332
+
333
+ Use when: Building category-based UIs, organizing node selection,
334
+ browsing library contents, implementing filters.
335
+
336
+ Results: ListCategoriesInLibraryResultSuccess (with categories) | ListCategoriesInLibraryResultFailure (library not found)
337
+ """
338
+
220
339
  library: str
221
340
 
222
341
 
223
342
  @dataclass
224
343
  @PayloadRegistry.register
225
344
  class ListCategoriesInLibraryResultSuccess(WorkflowNotAlteredMixin, ResultPayloadSuccess):
345
+ """Library categories listed successfully.
346
+
347
+ Args:
348
+ categories: List of category dictionaries with names, descriptions, and metadata
349
+ """
350
+
226
351
  categories: list[dict]
227
352
 
228
353
 
229
354
  @dataclass
230
355
  @PayloadRegistry.register
231
356
  class ListCategoriesInLibraryResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
232
- pass
357
+ """Library categories listing failed. Common causes: library not found, library not loaded."""
233
358
 
234
359
 
235
360
  @dataclass
236
361
  @PayloadRegistry.register
237
362
  class GetLibraryMetadataRequest(RequestPayload):
363
+ """Get metadata for a specific library.
364
+
365
+ Use when: Inspecting library properties, displaying library information,
366
+ checking library versions, validating library compatibility.
367
+
368
+ Results: GetLibraryMetadataResultSuccess (with metadata) | GetLibraryMetadataResultFailure (library not found)
369
+ """
370
+
238
371
  library: str
239
372
 
240
373
 
241
374
  @dataclass
242
375
  @PayloadRegistry.register
243
376
  class GetLibraryMetadataResultSuccess(WorkflowNotAlteredMixin, ResultPayloadSuccess):
377
+ """Library metadata retrieved successfully.
378
+
379
+ Args:
380
+ metadata: Complete library metadata including version, description, dependencies
381
+ """
382
+
244
383
  metadata: LibraryMetadata
245
384
 
246
385
 
247
386
  @dataclass
248
387
  @PayloadRegistry.register
249
388
  class GetLibraryMetadataResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
250
- pass
389
+ """Library metadata retrieval failed. Common causes: library not found, library not loaded."""
251
390
 
252
391
 
253
392
  # "Jumbo" event for getting all things say, a GUI might want w/r/t a Library.
254
393
  @dataclass
255
394
  @PayloadRegistry.register
256
395
  class GetAllInfoForLibraryRequest(RequestPayload):
396
+ """Get comprehensive information for a library in a single call.
397
+
398
+ Use when: Populating library UIs, implementing library inspection,
399
+ gathering complete library state, optimizing multiple info requests.
400
+
401
+ Results: GetAllInfoForLibraryResultSuccess (with comprehensive info) | GetAllInfoForLibraryResultFailure (library not found)
402
+ """
403
+
257
404
  library: str
258
405
 
259
406
 
260
407
  @dataclass
261
408
  @PayloadRegistry.register
262
409
  class GetAllInfoForLibraryResultSuccess(WorkflowNotAlteredMixin, ResultPayloadSuccess):
410
+ """Comprehensive library information retrieved successfully.
411
+
412
+ Args:
413
+ library_metadata_details: Library metadata and version information
414
+ category_details: All categories available in the library
415
+ node_type_name_to_node_metadata_details: Complete node metadata for each node type
416
+ """
417
+
263
418
  library_metadata_details: GetLibraryMetadataResultSuccess
264
419
  category_details: ListCategoriesInLibraryResultSuccess
265
420
  node_type_name_to_node_metadata_details: dict[str, GetNodeMetadataFromLibraryResultSuccess]
@@ -268,44 +423,67 @@ class GetAllInfoForLibraryResultSuccess(WorkflowNotAlteredMixin, ResultPayloadSu
268
423
  @dataclass
269
424
  @PayloadRegistry.register
270
425
  class GetAllInfoForLibraryResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
271
- pass
426
+ """Comprehensive library information retrieval failed. Common causes: library not found, library not loaded, partial failure."""
272
427
 
273
428
 
274
429
  # The "Jumbo-est" of them all. Grabs all info for all libraries in one fell swoop.
275
430
  @dataclass
276
431
  @PayloadRegistry.register
277
432
  class GetAllInfoForAllLibrariesRequest(RequestPayload):
278
- pass
433
+ """Get comprehensive information for all libraries in a single call.
434
+
435
+ Use when: Populating complete library catalogs, implementing library browsers,
436
+ gathering system-wide library state, optimizing bulk library operations.
437
+
438
+ Results: GetAllInfoForAllLibrariesResultSuccess (with all library info) | GetAllInfoForAllLibrariesResultFailure (system error)
439
+ """
279
440
 
280
441
 
281
442
  @dataclass
282
443
  @PayloadRegistry.register
283
444
  class GetAllInfoForAllLibrariesResultSuccess(WorkflowNotAlteredMixin, ResultPayloadSuccess):
445
+ """Comprehensive information for all libraries retrieved successfully.
446
+
447
+ Args:
448
+ library_name_to_library_info: Complete information for each registered library
449
+ """
450
+
284
451
  library_name_to_library_info: dict[str, GetAllInfoForLibraryResultSuccess]
285
452
 
286
453
 
287
454
  @dataclass
288
455
  @PayloadRegistry.register
289
456
  class GetAllInfoForAllLibrariesResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
290
- pass
457
+ """Comprehensive information retrieval for all libraries failed. Common causes: registry not initialized, system error."""
291
458
 
292
459
 
293
460
  @dataclass
294
461
  @PayloadRegistry.register
295
462
  class UnloadLibraryFromRegistryRequest(RequestPayload):
463
+ """Unload a library from the registry.
464
+
465
+ Use when: Removing unused libraries, cleaning up library registry,
466
+ preparing for library updates, troubleshooting library issues.
467
+
468
+ Args:
469
+ library_name: Name of the library to unload from the registry
470
+
471
+ Results: UnloadLibraryFromRegistryResultSuccess | UnloadLibraryFromRegistryResultFailure (library not found, unload error)
472
+ """
473
+
296
474
  library_name: str
297
475
 
298
476
 
299
477
  @dataclass
300
478
  @PayloadRegistry.register
301
479
  class UnloadLibraryFromRegistryResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
302
- pass
480
+ """Library unloaded successfully from registry."""
303
481
 
304
482
 
305
483
  @dataclass
306
484
  @PayloadRegistry.register
307
485
  class UnloadLibraryFromRegistryResultFailure(ResultPayloadFailure):
308
- pass
486
+ """Library unload failed. Common causes: library not found, library in use, unload error."""
309
487
 
310
488
 
311
489
  @dataclass
@@ -325,10 +503,10 @@ class ReloadAllLibrariesRequest(RequestPayload):
325
503
  @dataclass
326
504
  @PayloadRegistry.register
327
505
  class ReloadAllLibrariesResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
328
- pass
506
+ """All libraries reloaded successfully. All workflow state has been cleared."""
329
507
 
330
508
 
331
509
  @dataclass
332
510
  @PayloadRegistry.register
333
511
  class ReloadAllLibrariesResultFailure(ResultPayloadFailure):
334
- pass
512
+ """Library reload failed. Common causes: library loading errors, system constraints, initialization failures."""
@@ -9,6 +9,17 @@ from griptape_nodes.retained_mode.events.payload_registry import PayloadRegistry
9
9
  @dataclass
10
10
  @PayloadRegistry.register
11
11
  class LogHandlerEvent(AppPayload):
12
+ """Log message event from the logging system.
13
+
14
+ Use when: Capturing log messages for UI display, implementing log viewers,
15
+ monitoring application behavior, debugging system issues.
16
+
17
+ Args:
18
+ message: The log message content
19
+ levelname: Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
20
+ created: Timestamp when the log entry was created
21
+ """
22
+
12
23
  message: str
13
24
  levelname: str
14
25
  created: float