haybale-haystack 0.4.2__tar.gz → 0.5.0__tar.gz
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.
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/.gitignore +4 -6
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/PKG-INFO +4 -4
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/QUICKREF.md +1 -1
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/__init__.py +5 -11
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/docs/haybale-haystack.farmhand.close_graph.md +1 -1
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/docs/haybale-haystack.farmhand.compile_graph.md +1 -1
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/docs/haybale-haystack.farmhand.create_graph.md +1 -1
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/docs/haybale-haystack.farmhand.list_graphs.md +1 -1
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/docs/haybale-haystack.farmhand.open_graph.md +1 -1
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/docs/haybale-haystack.farmhand.save_graph.md +1 -1
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/docs/haybale-haystack.farmhand.start_graph.md +1 -1
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/editors/haystack_editor.py +17 -15
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/farmhands/graph_tools.py +28 -23
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/graph_entry.py +4 -4
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/haybale.toml +1 -1
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/panels/file_browser/menu/file.py +4 -7
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/panels/graph/menu/macro.py +6 -10
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/panels/haystack_settings_panel.py +4 -8
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/panels/properties/introspect/graph_run_settings_panel.py +14 -10
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/settings/flow_meter_settings.py +1 -2
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/settings/graph_run_settings.py +1 -3
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/settings/haystack_settings.py +1 -4
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/signals.py +1 -1
- {haybale_haystack-0.4.2/haybale_haystack/state → haybale_haystack-0.5.0/haybale_haystack/states}/haystack_state.py +11 -13
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/pyproject.toml +4 -4
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/README.md +0 -0
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/OVERVIEW.md +0 -0
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/docs/haybale-haystack.editor.HaystackEditor.md +0 -0
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/docs/haybale-haystack.farmhand.rename_graph.md +0 -0
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/docs/haybale-haystack.farmhand.stop_graph.md +0 -0
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/docs/haybale-haystack.panel.EditMacroMenuPanel.md +0 -0
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/docs/haybale-haystack.panel.GraphRunSettingsPanel.md +0 -0
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/docs/haybale-haystack.panel.HaystackSettingsPanel.md +0 -0
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/docs/haybale-haystack.panel.OpenInHaystackMenuPanel.md +0 -0
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/docs/haybale-haystack.panel.UpdateMacroMenuPanel.md +0 -0
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/docs/haybale-haystack.setting.FlowMeterSettings.md +0 -0
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/docs/haybale-haystack.setting.HaystackSettings.md +0 -0
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/docs/haybale-haystack.state.HaystackState.md +0 -0
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/editors/__init__.py +0 -0
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/farmhands/__init__.py +0 -0
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/flow_meter.py +0 -0
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/panels/__init__.py +0 -0
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/persistence.py +0 -0
- {haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/settings/__init__.py +0 -0
- {haybale_haystack-0.4.2/haybale_haystack/state → haybale_haystack-0.5.0/haybale_haystack/states}/__init__.py +0 -0
|
@@ -220,13 +220,11 @@ packages/haywire-core/src/haywire/_baked_docs/*
|
|
|
220
220
|
# Haywire project config (user-local, not repo state)
|
|
221
221
|
.haywire/
|
|
222
222
|
|
|
223
|
-
#
|
|
224
|
-
|
|
225
|
-
barn/haybale-spandrel
|
|
226
|
-
barn/haybale-stream
|
|
227
|
-
barn/haybale-comfyui
|
|
223
|
+
# Personal scratch notes; working material others need goes in workbench/
|
|
224
|
+
.scratch/
|
|
228
225
|
|
|
229
226
|
assets/*
|
|
230
227
|
|
|
231
|
-
# Claude Code personal settings
|
|
228
|
+
# Claude Code personal settings and instructions; .claude/settings.json and CLAUDE.md are shared
|
|
232
229
|
.claude/settings.local.json
|
|
230
|
+
CLAUDE.local.md
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: haybale-haystack
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: File-centric multi-graph manager
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: graph-management
|
|
7
7
|
Requires-Python: >=3.12
|
|
8
|
-
Requires-Dist: haybale-graph-editor>=0.
|
|
9
|
-
Requires-Dist: haybale-studio>=0.
|
|
10
|
-
Requires-Dist: haywire-core>=0.
|
|
8
|
+
Requires-Dist: haybale-graph-editor>=0.5.0
|
|
9
|
+
Requires-Dist: haybale-studio>=0.5.0
|
|
10
|
+
Requires-Dist: haywire-core>=0.5.0
|
|
11
11
|
Requires-Dist: nicegui>=3.18.0
|
|
12
12
|
Requires-Dist: toml>=0.10.2
|
|
@@ -15,14 +15,8 @@ claim exclusive ownership of GraphEditor.
|
|
|
15
15
|
|
|
16
16
|
from pathlib import Path
|
|
17
17
|
|
|
18
|
-
from haywire.
|
|
19
|
-
from haywire.
|
|
20
|
-
from haywire.core.farmhand import FarmhandRegistry
|
|
21
|
-
from haywire.core.settings.registry import SettingsRegistry
|
|
22
|
-
from haywire.core.state import LibraryStateRegistry
|
|
23
|
-
|
|
24
|
-
from haywire.ui.editor.registry import EditorTypeRegistry
|
|
25
|
-
from haywire.ui.panel.registry import PanelRegistry
|
|
18
|
+
from haywire.api import BaseLibrary, SettingsRegistry, library
|
|
19
|
+
from haywire.api.workbench import EditorRegistry, FarmhandRegistry, PanelRegistry, StateRegistry
|
|
26
20
|
|
|
27
21
|
|
|
28
22
|
@library(
|
|
@@ -46,8 +40,8 @@ class Library(BaseLibrary):
|
|
|
46
40
|
)
|
|
47
41
|
|
|
48
42
|
self.add_folder_to_registry(
|
|
49
|
-
folder_path=str(base_path / "
|
|
50
|
-
registry_cls=
|
|
43
|
+
folder_path=str(base_path / "states"),
|
|
44
|
+
registry_cls=StateRegistry,
|
|
51
45
|
)
|
|
52
46
|
|
|
53
47
|
# Register MCP tools (canonical order: after state — tools reference HaystackState)
|
|
@@ -63,7 +57,7 @@ class Library(BaseLibrary):
|
|
|
63
57
|
|
|
64
58
|
self.add_folder_to_registry(
|
|
65
59
|
folder_path=str(base_path / "editors"),
|
|
66
|
-
registry_cls=
|
|
60
|
+
registry_cls=EditorRegistry,
|
|
67
61
|
)
|
|
68
62
|
|
|
69
63
|
def validate(self) -> bool:
|
|
@@ -6,7 +6,7 @@ Close an open graph entry. NEVER deletes the file on disk.
|
|
|
6
6
|
|
|
7
7
|
## Agent Instructions
|
|
8
8
|
|
|
9
|
-
Close an open graph session by binding_id, removing it from the open-entries list. NEVER deletes the file on disk — the graph can be reopened later with haystack_open_graph. Raises graph_not_found for an unknown binding_id.
|
|
9
|
+
Close an open graph session by binding_id, removing it from the open-entries list. NEVER deletes the file on disk — the graph can be reopened later with haybale-haystack_open_graph. Raises graph_not_found for an unknown binding_id.
|
|
10
10
|
|
|
11
11
|
## Details
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ Compile without starting; returns compile diagnostics.
|
|
|
6
6
|
|
|
7
7
|
## Agent Instructions
|
|
8
8
|
|
|
9
|
-
Compile an open graph WITHOUT starting execution — use this to check for compile errors before haystack_start_graph, since starting a broken graph wastes the destructive-side-effects warning for nothing. Returns compile.ok and compile.error (null when ok).
|
|
9
|
+
Compile an open graph WITHOUT starting execution — use this to check for compile errors before haybale-haystack_start_graph, since starting a broken graph wastes the destructive-side-effects warning for nothing. Returns compile.ok and compile.error (null when ok).
|
|
10
10
|
|
|
11
11
|
## Details
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ Create a new untitled graph (appears in open browser sessions).
|
|
|
6
6
|
|
|
7
7
|
## Agent Instructions
|
|
8
8
|
|
|
9
|
-
Create a new untitled, unsaved graph and return its binding_id. The graph appears in any open studio browser session immediately. It has no nodes yet — follow with
|
|
9
|
+
Create a new untitled, unsaved graph and return its binding_id. The graph appears in any open studio browser session immediately. It has no nodes yet — follow with haybale-graph-editor_add_node, then haybale-haystack_save_graph (it stays unsaved until you do).
|
|
10
10
|
|
|
11
11
|
## Details
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ Open haystack entries plus .haywire files on disk in the workspace.
|
|
|
6
6
|
|
|
7
7
|
## Agent Instructions
|
|
8
8
|
|
|
9
|
-
List open graph sessions (with their binding_id, needed by every other haystack_*/
|
|
9
|
+
List open graph sessions (with their binding_id, needed by every other haybale-haystack_*/haybale-graph-editor_* tool) plus every .haywire file found on disk under the workspace root, whether open or not. Use this first to discover a binding_id, or to find a file path to pass to haybale-haystack_open_graph.
|
|
10
10
|
|
|
11
11
|
## Details
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ Open a .haywire file (idempotent per path).
|
|
|
6
6
|
|
|
7
7
|
## Agent Instructions
|
|
8
8
|
|
|
9
|
-
Open a .haywire file by path, relative to the workspace root, and return its binding_id. Idempotent: opening an already-open path returns the same session rather than duplicating it. Raises file_not_found if the path doesn't exist — run haystack_list_graphs to see valid paths.
|
|
9
|
+
Open a .haywire file by path, relative to the workspace root, and return its binding_id. Idempotent: opening an already-open path returns the same session rather than duplicating it. Raises file_not_found if the path doesn't exist — run haybale-haystack_list_graphs to see valid paths.
|
|
10
10
|
|
|
11
11
|
## Details
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ Save an open graph; save_as writes to a new path.
|
|
|
6
6
|
|
|
7
7
|
## Agent Instructions
|
|
8
8
|
|
|
9
|
-
Save an open graph (by binding_id) to its current path. Pass save_as=<path> (relative to the workspace root) to write to a new path instead — e.g. to save an untitled graph from haystack_create_graph for the first time. Raises graph_not_found for an unknown binding_id, save_failed if the write itself fails.
|
|
9
|
+
Save an open graph (by binding_id) to its current path. Pass save_as=<path> (relative to the workspace root) to write to a new path instead — e.g. to save an untitled graph from haybale-haystack_create_graph for the first time. Raises graph_not_found for an unknown binding_id, save_failed if the write itself fails.
|
|
10
10
|
|
|
11
11
|
## Details
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ Compile and start execution. Destructive: nodes perform real I/O.
|
|
|
6
6
|
|
|
7
7
|
## Agent Instructions
|
|
8
8
|
|
|
9
|
-
Compile and start executing an open graph. DESTRUCTIVE — nodes perform real I/O once running (hardware, network, file writes), not a dry run. Consider haystack_compile_graph first to catch compile errors without side effects. Follow with haystack_stop_graph when done.
|
|
9
|
+
Compile and start executing an open graph. DESTRUCTIVE — nodes perform real I/O once running (hardware, network, file writes), not a dry run. Consider haybale-haystack_compile_graph first to catch compile errors without side effects. Follow with haybale-haystack_stop_graph when done.
|
|
10
10
|
|
|
11
11
|
## Details
|
|
12
12
|
|
{haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/editors/haystack_editor.py
RENAMED
|
@@ -6,31 +6,33 @@ from typing import Optional
|
|
|
6
6
|
|
|
7
7
|
from nicegui import ui
|
|
8
8
|
|
|
9
|
-
from haywire.
|
|
10
|
-
|
|
11
|
-
from haywire.ui.components.popup import Popup
|
|
12
|
-
from haywire.ui.editor import BaseEditor, SlotName, editor
|
|
13
|
-
from haywire.core.session import (
|
|
14
|
-
IAppState,
|
|
15
|
-
SessionContext,
|
|
16
|
-
react_on,
|
|
17
|
-
redraw_on,
|
|
18
|
-
)
|
|
19
|
-
from haywire.core.signals import (
|
|
9
|
+
from haywire.api.workbench import (
|
|
10
|
+
AccessTier,
|
|
20
11
|
ActiveGraphMoved,
|
|
12
|
+
BaseEditor,
|
|
21
13
|
BroadcastClose,
|
|
22
14
|
Close,
|
|
23
15
|
GraphDataMutated,
|
|
24
16
|
GraphUnsavedChanged,
|
|
17
|
+
LevelMode,
|
|
25
18
|
Reveal,
|
|
26
19
|
RevealGraphInstance,
|
|
27
20
|
Save,
|
|
21
|
+
SessionContext,
|
|
22
|
+
SlotName,
|
|
23
|
+
confirm_modal,
|
|
24
|
+
editor,
|
|
25
|
+
hui,
|
|
26
|
+
react_on,
|
|
27
|
+
redraw_on,
|
|
28
28
|
)
|
|
29
|
-
from haywire.ui.
|
|
29
|
+
from haywire.ui.components.popup import Popup
|
|
30
|
+
from haywire.core.session import IAppState
|
|
31
|
+
from haywire.ui.modals import pick_modal, rename_modal
|
|
30
32
|
|
|
31
33
|
from haybale_graph_editor.notices import GraphNotice, GraphNoticesChanged
|
|
32
|
-
from haybale_graph_editor.
|
|
33
|
-
from haybale_graph_editor.
|
|
34
|
+
from haybale_graph_editor.states.edit_state import EditState
|
|
35
|
+
from haybale_graph_editor.states.graph_app_state import GraphAppState
|
|
34
36
|
from haybale_graph_editor.editors.graph_editor import GraphEditor, definition_path
|
|
35
37
|
from haybale_graph_editor.editors.graph_save_as import open_graph_save_as_dialog
|
|
36
38
|
|
|
@@ -38,7 +40,7 @@ from haywire.core.execution.flow_metrics import FlowMeterSampler
|
|
|
38
40
|
|
|
39
41
|
from haybale_haystack.flow_meter import FlowMeterView
|
|
40
42
|
from haybale_haystack.signals import HaystackReloaded, HaystackTeardown
|
|
41
|
-
from haybale_haystack.
|
|
43
|
+
from haybale_haystack.states.haystack_state import HaystackState
|
|
42
44
|
from haybale_haystack.graph_entry import EntryKind, GraphEntry
|
|
43
45
|
|
|
44
46
|
logger = logging.getLogger(__name__)
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
"""haystack_* MCP tools: graph lifecycle + execution control (spec §5)."""
|
|
1
|
+
"""haybale-haystack_* MCP tools: graph lifecycle + execution control (spec §5)."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from haywire.
|
|
6
|
-
|
|
5
|
+
from haywire.api.workbench import (
|
|
6
|
+
AccessTier,
|
|
7
7
|
Farmhand,
|
|
8
8
|
FarmhandContext,
|
|
9
9
|
FarmhandError,
|
|
10
|
+
GraphDataMutated,
|
|
10
11
|
ToolAnnotations,
|
|
11
12
|
farmhand,
|
|
12
13
|
truncation_note,
|
|
13
14
|
)
|
|
14
|
-
from haywire.core.signals import GraphDataMutated
|
|
15
15
|
|
|
16
16
|
_READ_ONLY = ToolAnnotations(read_only_hint=True)
|
|
17
17
|
_MUTATING = ToolAnnotations()
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
def _state(ctx: FarmhandContext):
|
|
21
|
-
from haybale_haystack.
|
|
21
|
+
from haybale_haystack.states.haystack_state import HaystackState
|
|
22
22
|
|
|
23
23
|
return ctx.state(HaystackState)
|
|
24
24
|
|
|
@@ -30,7 +30,10 @@ def _entry(ctx: FarmhandContext, binding_id: str):
|
|
|
30
30
|
"graph_not_found",
|
|
31
31
|
f"No open graph '{binding_id}'.",
|
|
32
32
|
ids={"binding_id": binding_id},
|
|
33
|
-
help=
|
|
33
|
+
help=(
|
|
34
|
+
"Run haybale-haystack_list_graphs to see open graphs, or haybale-haystack_open_graph to "
|
|
35
|
+
"open one."
|
|
36
|
+
),
|
|
34
37
|
)
|
|
35
38
|
return entry
|
|
36
39
|
|
|
@@ -54,9 +57,9 @@ def _compile_row(result) -> dict:
|
|
|
54
57
|
label="List graphs",
|
|
55
58
|
description="Open haystack entries plus .haywire files on disk in the workspace.",
|
|
56
59
|
instructions="List open graph sessions (with their binding_id, needed by every other "
|
|
57
|
-
"haystack_*/
|
|
58
|
-
"root, whether open or not. Use this first to discover a binding_id, or
|
|
59
|
-
"to pass to haystack_open_graph.",
|
|
60
|
+
"haybale-haystack_*/haybale-graph-editor_* tool) plus every .haywire file found on disk "
|
|
61
|
+
"under the workspace root, whether open or not. Use this first to discover a binding_id, or "
|
|
62
|
+
"to find a file path to pass to haybale-haystack_open_graph.",
|
|
60
63
|
registry_id="list_graphs",
|
|
61
64
|
annotations=_READ_ONLY,
|
|
62
65
|
requires=AccessTier.VIEW,
|
|
@@ -83,13 +86,15 @@ class HaystackListGraphsTool(Farmhand):
|
|
|
83
86
|
}
|
|
84
87
|
if open_rows:
|
|
85
88
|
result["help"] = (
|
|
86
|
-
"Run
|
|
87
|
-
"haystack_open_graph path=<path> to open one of the files on disk."
|
|
89
|
+
"Run haybale-graph-editor_query_graph binding_id=<id> to inspect an open graph, or "
|
|
90
|
+
"haybale-haystack_open_graph path=<path> to open one of the files on disk."
|
|
88
91
|
)
|
|
89
92
|
elif files:
|
|
90
|
-
result["help"] =
|
|
93
|
+
result["help"] = (
|
|
94
|
+
"Run haybale-haystack_open_graph path=<path> to open one, or haybale-haystack_create_graph."
|
|
95
|
+
)
|
|
91
96
|
else:
|
|
92
|
-
result["help"] = "Run haystack_create_graph to start a new graph."
|
|
97
|
+
result["help"] = "Run haybale-haystack_create_graph to start a new graph."
|
|
93
98
|
return result
|
|
94
99
|
|
|
95
100
|
|
|
@@ -98,7 +103,7 @@ class HaystackListGraphsTool(Farmhand):
|
|
|
98
103
|
description="Create a new untitled graph (appears in open browser sessions).",
|
|
99
104
|
instructions="Create a new untitled, unsaved graph and return its binding_id. The graph "
|
|
100
105
|
"appears in any open studio browser session immediately. It has no nodes yet — follow with "
|
|
101
|
-
"
|
|
106
|
+
"haybale-graph-editor_add_node, then haybale-haystack_save_graph (it stays unsaved until you do).",
|
|
102
107
|
registry_id="create_graph",
|
|
103
108
|
annotations=_MUTATING,
|
|
104
109
|
)
|
|
@@ -109,8 +114,8 @@ class HaystackCreateGraphTool(Farmhand):
|
|
|
109
114
|
"summary": f"Created {entry.binding_id}.",
|
|
110
115
|
**_entry_row(entry),
|
|
111
116
|
"help": (
|
|
112
|
-
f"Run
|
|
113
|
-
f"populate it, then haystack_save_graph binding_id={entry.binding_id!r} path=<path> "
|
|
117
|
+
f"Run haybale-graph-editor_add_node binding_id={entry.binding_id!r} registry_key=<key> to "
|
|
118
|
+
f"populate it, then haybale-haystack_save_graph binding_id={entry.binding_id!r} path=<path> "
|
|
114
119
|
f"(it is unsaved until you do)."
|
|
115
120
|
),
|
|
116
121
|
}
|
|
@@ -121,7 +126,7 @@ class HaystackCreateGraphTool(Farmhand):
|
|
|
121
126
|
description="Open a .haywire file (idempotent per path).",
|
|
122
127
|
instructions="Open a .haywire file by path, relative to the workspace root, and return its "
|
|
123
128
|
"binding_id. Idempotent: opening an already-open path returns the same session rather than "
|
|
124
|
-
"duplicating it. Raises file_not_found if the path doesn't exist — run haystack_list_graphs "
|
|
129
|
+
"duplicating it. Raises file_not_found if the path doesn't exist — run haybale-haystack_list_graphs "
|
|
125
130
|
"to see valid paths.",
|
|
126
131
|
registry_id="open_graph",
|
|
127
132
|
annotations=_MUTATING,
|
|
@@ -134,7 +139,7 @@ class HaystackOpenGraphTool(Farmhand):
|
|
|
134
139
|
"file_not_found",
|
|
135
140
|
f"No file at {target}.",
|
|
136
141
|
ids={"path": path},
|
|
137
|
-
help="Run haystack_list_graphs to see graph files in the haystack.",
|
|
142
|
+
help="Run haybale-haystack_list_graphs to see graph files in the haystack.",
|
|
138
143
|
)
|
|
139
144
|
entry = _state(ctx).open_graph(target)
|
|
140
145
|
return {"summary": f"Opened {entry.binding_id}.", **_entry_row(entry)}
|
|
@@ -145,7 +150,7 @@ class HaystackOpenGraphTool(Farmhand):
|
|
|
145
150
|
description="Save an open graph; save_as writes to a new path.",
|
|
146
151
|
instructions="Save an open graph (by binding_id) to its current path. Pass save_as=<path> "
|
|
147
152
|
"(relative to the workspace root) to write to a new path instead — e.g. to save an untitled "
|
|
148
|
-
"graph from haystack_create_graph for the first time. Raises graph_not_found for an unknown "
|
|
153
|
+
"graph from haybale-haystack_create_graph for the first time. Raises graph_not_found for an unknown "
|
|
149
154
|
"binding_id, save_failed if the write itself fails.",
|
|
150
155
|
registry_id="save_graph",
|
|
151
156
|
annotations=_MUTATING,
|
|
@@ -189,7 +194,7 @@ class HaystackRenameGraphTool(Farmhand):
|
|
|
189
194
|
description="Close an open graph entry. NEVER deletes the file on disk.",
|
|
190
195
|
instructions="Close an open graph session by binding_id, removing it from the open-entries "
|
|
191
196
|
"list. NEVER deletes the file on disk — the graph can be reopened later with "
|
|
192
|
-
"haystack_open_graph. Raises graph_not_found for an unknown binding_id.",
|
|
197
|
+
"haybale-haystack_open_graph. Raises graph_not_found for an unknown binding_id.",
|
|
193
198
|
registry_id="close_graph",
|
|
194
199
|
annotations=_MUTATING,
|
|
195
200
|
)
|
|
@@ -204,7 +209,7 @@ class HaystackCloseGraphTool(Farmhand):
|
|
|
204
209
|
label="Compile graph",
|
|
205
210
|
description="Compile without starting; returns compile diagnostics.",
|
|
206
211
|
instructions="Compile an open graph WITHOUT starting execution — use this to check for "
|
|
207
|
-
"compile errors before haystack_start_graph, since starting a broken graph wastes the "
|
|
212
|
+
"compile errors before haybale-haystack_start_graph, since starting a broken graph wastes the "
|
|
208
213
|
"destructive-side-effects warning for nothing. Returns compile.ok and compile.error (null "
|
|
209
214
|
"when ok).",
|
|
210
215
|
registry_id="compile_graph",
|
|
@@ -222,8 +227,8 @@ class HaystackCompileGraphTool(Farmhand):
|
|
|
222
227
|
description="Compile and start execution. Destructive: nodes perform real I/O.",
|
|
223
228
|
instructions="Compile and start executing an open graph. DESTRUCTIVE — nodes perform real "
|
|
224
229
|
"I/O once running (hardware, network, file writes), not a dry run. Consider "
|
|
225
|
-
"haystack_compile_graph first to catch compile errors without side effects. Follow with "
|
|
226
|
-
"haystack_stop_graph when done.",
|
|
230
|
+
"haybale-haystack_compile_graph first to catch compile errors without side effects. Follow with "
|
|
231
|
+
"haybale-haystack_stop_graph when done.",
|
|
227
232
|
registry_id="start_graph",
|
|
228
233
|
annotations=ToolAnnotations(destructive_hint=True),
|
|
229
234
|
requires=AccessTier.OPERATE,
|
|
@@ -15,16 +15,16 @@ from enum import Enum
|
|
|
15
15
|
from pathlib import Path
|
|
16
16
|
from typing import TYPE_CHECKING, Optional
|
|
17
17
|
|
|
18
|
-
from haywire.
|
|
18
|
+
from haywire.api.workbench import get_library_state_container
|
|
19
19
|
from haywire.core.execution.compile_result import CompileResult
|
|
20
20
|
from haywire.core.execution.interpreter import Interpreter
|
|
21
21
|
from haybale_graph_editor.protocols import GraphContainer
|
|
22
22
|
from haybale_haystack.settings.graph_run_settings import GraphRunSettings
|
|
23
23
|
|
|
24
24
|
if TYPE_CHECKING:
|
|
25
|
-
from haywire.
|
|
25
|
+
from haywire.api.workbench import BaseGraph as HaywireGraph
|
|
26
26
|
from haywire.core.graph.editor import Editor
|
|
27
|
-
from haybale_haystack.
|
|
27
|
+
from haybale_haystack.states.haystack_state import HaystackState
|
|
28
28
|
|
|
29
29
|
logger = logging.getLogger(__name__)
|
|
30
30
|
|
|
@@ -100,7 +100,7 @@ class GraphEntry(GraphContainer):
|
|
|
100
100
|
automatically when :attr:`path` is assigned on save-as or rename.
|
|
101
101
|
|
|
102
102
|
Also serves as this entry's key in
|
|
103
|
-
:class:`haybale_graph_editor.
|
|
103
|
+
:class:`haybale_graph_editor.states.GraphAppState`.
|
|
104
104
|
"""
|
|
105
105
|
return str(self.path) if self.path is not None else self.graph.graph_id
|
|
106
106
|
|
{haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/panels/file_browser/menu/file.py
RENAMED
|
@@ -16,16 +16,13 @@ from __future__ import annotations
|
|
|
16
16
|
|
|
17
17
|
from typing import TYPE_CHECKING
|
|
18
18
|
|
|
19
|
-
from haybale_haystack.
|
|
19
|
+
from haybale_haystack.states.haystack_state import HaystackState
|
|
20
20
|
from haybale_studio.surfaces import FileActions, FileMenu
|
|
21
|
-
from haybale_studio.
|
|
22
|
-
from haywire.
|
|
23
|
-
from haywire.ui.panel import BasePanel
|
|
24
|
-
from haywire.ui.panel.decorator import panel
|
|
25
|
-
from haywire.ui.panel.layout import PanelLayout
|
|
21
|
+
from haybale_studio.states.file_browser_state import FileBrowserState
|
|
22
|
+
from haywire.api.workbench import BasePanel, PanelLayout, hui, panel
|
|
26
23
|
|
|
27
24
|
if TYPE_CHECKING:
|
|
28
|
-
from haywire.
|
|
25
|
+
from haywire.api.workbench import SessionContext
|
|
29
26
|
|
|
30
27
|
|
|
31
28
|
_GRAPH_EXTS = frozenset({".haywire"})
|
{haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/panels/graph/menu/macro.py
RENAMED
|
@@ -16,19 +16,15 @@ from typing import TYPE_CHECKING
|
|
|
16
16
|
|
|
17
17
|
from haybale_graph_editor.editors.graph_editor import GraphEditor
|
|
18
18
|
from haybale_graph_editor.panels._gating import is_macro_placement, is_modified_instance
|
|
19
|
-
from haybale_graph_editor.
|
|
19
|
+
from haybale_graph_editor.states.edit_state import EditState
|
|
20
20
|
from haybale_graph_editor.surfaces import SelectionActions, SelectionMacroMenu
|
|
21
|
-
from haywire.
|
|
22
|
-
from haywire.
|
|
23
|
-
from haywire.ui import elements as hui
|
|
24
|
-
from haywire.ui.panel import BasePanel
|
|
25
|
-
from haywire.ui.panel.decorator import panel
|
|
26
|
-
from haywire.ui.panel.layout import PanelLayout
|
|
21
|
+
from haywire.api import report_failure
|
|
22
|
+
from haywire.api.workbench import BasePanel, PanelLayout, Reveal, hui, panel
|
|
27
23
|
|
|
28
|
-
from haybale_haystack.
|
|
24
|
+
from haybale_haystack.states.haystack_state import HaystackState
|
|
29
25
|
|
|
30
26
|
if TYPE_CHECKING:
|
|
31
|
-
from haywire.
|
|
27
|
+
from haywire.api.workbench import SessionContext
|
|
32
28
|
|
|
33
29
|
|
|
34
30
|
@panel(
|
|
@@ -193,7 +189,7 @@ def _update_macro(ctx: "SessionContext", node_id: str) -> None:
|
|
|
193
189
|
"""
|
|
194
190
|
from nicegui import ui
|
|
195
191
|
|
|
196
|
-
from haybale_graph_editor.
|
|
192
|
+
from haybale_graph_editor.states.graph_app_state import route_for
|
|
197
193
|
from haywire.core.macro.promote import macro_document
|
|
198
194
|
from haywire.core.macro.source import (
|
|
199
195
|
count_placements,
|
{haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/panels/haystack_settings_panel.py
RENAMED
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
"""Library settings panel for the haystack library, on the ``
|
|
1
|
+
"""Library settings panel for the haystack library, on the ``BarnsSurface`` surface."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from typing import TYPE_CHECKING
|
|
6
6
|
|
|
7
|
-
from haywire.
|
|
8
|
-
from haywire.ui import elements as hui
|
|
9
|
-
from haywire.ui.panel import BasePanel, PanelLayout
|
|
10
|
-
from haywire.ui.panel.decorator import panel
|
|
11
|
-
from haywire.ui.panel.render_utils import render_schema
|
|
7
|
+
from haywire.api.workbench import BarnsSurface, BasePanel, PanelLayout, hui, panel, render_schema
|
|
12
8
|
|
|
13
9
|
from haybale_haystack.settings.flow_meter_settings import FlowMeterSettings
|
|
14
10
|
|
|
15
11
|
if TYPE_CHECKING:
|
|
16
|
-
from haywire.
|
|
12
|
+
from haywire.api.workbench import SessionContext
|
|
17
13
|
|
|
18
14
|
|
|
19
15
|
@panel(
|
|
20
|
-
surface=
|
|
16
|
+
surface=BarnsSurface,
|
|
21
17
|
label="Haystack",
|
|
22
18
|
description="Settings of the haystack library.",
|
|
23
19
|
icon=hui.icon.haystack,
|
|
@@ -9,24 +9,28 @@ from __future__ import annotations
|
|
|
9
9
|
|
|
10
10
|
from typing import TYPE_CHECKING
|
|
11
11
|
|
|
12
|
-
from haywire.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
from haywire.api.workbench import (
|
|
13
|
+
ActiveGraphMoved,
|
|
14
|
+
BasePanel,
|
|
15
|
+
ExecutionInspectorSurface,
|
|
16
|
+
GraphDataMutated,
|
|
17
|
+
PanelLayout,
|
|
18
|
+
hui,
|
|
19
|
+
panel,
|
|
20
|
+
render_settings,
|
|
21
|
+
)
|
|
18
22
|
|
|
19
|
-
from haybale_graph_editor.
|
|
20
|
-
from haybale_graph_editor.
|
|
23
|
+
from haybale_graph_editor.states.edit_state import EditState
|
|
24
|
+
from haybale_graph_editor.states.graph_app_state import GraphAppState
|
|
21
25
|
|
|
22
26
|
from haybale_haystack.graph_entry import GraphEntry
|
|
23
27
|
|
|
24
28
|
if TYPE_CHECKING:
|
|
25
|
-
from haywire.
|
|
29
|
+
from haywire.api.workbench import SessionContext
|
|
26
30
|
|
|
27
31
|
|
|
28
32
|
@panel(
|
|
29
|
-
surface=
|
|
33
|
+
surface=ExecutionInspectorSurface,
|
|
30
34
|
label="Graph Settings",
|
|
31
35
|
description="Renders the GraphRunSettings for the currently active graph.",
|
|
32
36
|
icon=hui.icon.graph,
|
{haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/settings/flow_meter_settings.py
RENAMED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""FlowMeterSettings — whether the haystack rows of running graphs show flow meters."""
|
|
2
2
|
|
|
3
|
-
from haywire.
|
|
4
|
-
from haywire.core.settings import LibrarySettings, setting, settings
|
|
3
|
+
from haywire.api import BOOL, LibrarySettings, setting, settings
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
@settings(namespace="flow_meters", label="Flow meters", description="Meters on the rows of running graphs")
|
{haybale_haystack-0.4.2 → haybale_haystack-0.5.0}/haybale_haystack/settings/haystack_settings.py
RENAMED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"""HaystackSettings — per-workspace settings for the haystack library."""
|
|
2
2
|
|
|
3
|
-
from haywire.
|
|
4
|
-
from haywire.core.settings import setting
|
|
5
|
-
from haywire.core.settings.decorator import settings
|
|
6
|
-
from haywire.barn.builtin.types import INT, STRING
|
|
3
|
+
from haywire.api import INT, STRING, LibrarySettings, setting, settings
|
|
7
4
|
|
|
8
5
|
|
|
9
6
|
@settings(namespace="haystack", label="Haystack", description="Per-workspace settings for haystack scalars.")
|
|
@@ -4,10 +4,15 @@ import logging
|
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
from typing import Optional
|
|
6
6
|
|
|
7
|
-
from haywire.
|
|
8
|
-
|
|
7
|
+
from haywire.api.workbench import (
|
|
8
|
+
AppState,
|
|
9
|
+
BaseGraph,
|
|
10
|
+
GraphDataMutated,
|
|
11
|
+
GraphUnsavedChanged,
|
|
12
|
+
get_library_state_container,
|
|
13
|
+
state,
|
|
14
|
+
)
|
|
9
15
|
|
|
10
|
-
from haywire.core.graph.base import BaseGraph
|
|
11
16
|
from haywire.core.graph.editor import Editor
|
|
12
17
|
from haywire.core.graph.types import ChangeReason
|
|
13
18
|
from haywire.core.graph.validation import ValidationResult
|
|
@@ -18,7 +23,7 @@ from haywire.core.execution.compile_result import CompileResult
|
|
|
18
23
|
from haybale_haystack.graph_entry import EntryKind, GraphEntry
|
|
19
24
|
from haybale_haystack.settings.haystack_settings import HaystackSettings
|
|
20
25
|
|
|
21
|
-
from haybale_graph_editor.
|
|
26
|
+
from haybale_graph_editor.states.graph_app_state import GraphAppState
|
|
22
27
|
|
|
23
28
|
logger = logging.getLogger(__name__)
|
|
24
29
|
|
|
@@ -37,7 +42,7 @@ class HaystackState(AppState):
|
|
|
37
42
|
|
|
38
43
|
# Dependencies resolved in on_enable. _dispatcher is NOT among
|
|
39
44
|
# them: AppState's base class provides it as a container-stamped
|
|
40
|
-
# weakref (see state/base.py), dereffed via self._dispatcher().
|
|
45
|
+
# weakref (see haywire/core/state/base.py), dereffed via self._dispatcher().
|
|
41
46
|
self._workspace_root: Optional[Path] = None
|
|
42
47
|
self._node_factory: Optional[NodeFactory] = None
|
|
43
48
|
self._library_state_container: Optional[LibraryStateContainer] = None
|
|
@@ -55,11 +60,7 @@ class HaystackState(AppState):
|
|
|
55
60
|
|
|
56
61
|
def on_enable(self) -> None:
|
|
57
62
|
"""Resolve ambient dependencies; rehydrate from settings."""
|
|
58
|
-
from haywire.core.di.context import
|
|
59
|
-
get_library_state_container,
|
|
60
|
-
get_node_factory,
|
|
61
|
-
get_workspace_root,
|
|
62
|
-
)
|
|
63
|
+
from haywire.core.di.context import get_node_factory, get_workspace_root
|
|
63
64
|
|
|
64
65
|
self._workspace_root = get_workspace_root()
|
|
65
66
|
self._node_factory = get_node_factory()
|
|
@@ -148,7 +149,6 @@ class HaystackState(AppState):
|
|
|
148
149
|
dispatcher = self._dispatcher()
|
|
149
150
|
if dispatcher is None:
|
|
150
151
|
return
|
|
151
|
-
from haywire.core.signals import GraphDataMutated
|
|
152
152
|
|
|
153
153
|
try:
|
|
154
154
|
dispatcher.broadcast(GraphDataMutated())
|
|
@@ -160,7 +160,6 @@ class HaystackState(AppState):
|
|
|
160
160
|
dispatcher = self._dispatcher()
|
|
161
161
|
if dispatcher is None:
|
|
162
162
|
return
|
|
163
|
-
from haywire.core.signals import GraphUnsavedChanged
|
|
164
163
|
|
|
165
164
|
try:
|
|
166
165
|
dispatcher.broadcast(GraphUnsavedChanged())
|
|
@@ -273,7 +272,6 @@ class HaystackState(AppState):
|
|
|
273
272
|
``DEVELOPMENT_CONFIG`` — every user graph therefore ran with debug
|
|
274
273
|
logging on and a hardcoded 50-step limit that ignored the setting.
|
|
275
274
|
"""
|
|
276
|
-
from haywire.core.graph.base import BaseGraph
|
|
277
275
|
from haywire.core.graph.editor import Editor
|
|
278
276
|
from haywire.core.graph.scheduler import LoopScheduler
|
|
279
277
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "haybale-haystack"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.5.0"
|
|
4
4
|
description = "File-centric multi-graph manager"
|
|
5
5
|
requires-python = ">=3.12"
|
|
6
6
|
license = {text = "MIT"}
|
|
7
7
|
|
|
8
8
|
dependencies = [
|
|
9
|
-
"haywire-core>=0.
|
|
10
|
-
"haybale-studio>=0.
|
|
11
|
-
"haybale-graph-editor>=0.
|
|
9
|
+
"haywire-core>=0.5.0",
|
|
10
|
+
"haybale-studio>=0.5.0",
|
|
11
|
+
"haybale-graph-editor>=0.5.0",
|
|
12
12
|
"nicegui>=3.18.0",
|
|
13
13
|
"toml>=0.10.2",
|
|
14
14
|
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|