htmlgraph 0.28.8__py3-none-any.whl → 0.28.9__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.
- htmlgraph/__init__.py +27 -1
- htmlgraph/operations/initialization.py +17 -2
- htmlgraph/sdk/__init__.py +8 -0
- htmlgraph/sdk/auto_help.py +183 -0
- htmlgraph/sdk/delegation_warnings.py +232 -0
- {htmlgraph-0.28.8.dist-info → htmlgraph-0.28.9.dist-info}/METADATA +1 -1
- {htmlgraph-0.28.8.dist-info → htmlgraph-0.28.9.dist-info}/RECORD +13 -11
- {htmlgraph-0.28.8.data → htmlgraph-0.28.9.data}/data/htmlgraph/styles.css +0 -0
- {htmlgraph-0.28.8.data → htmlgraph-0.28.9.data}/data/htmlgraph/templates/AGENTS.md.template +0 -0
- {htmlgraph-0.28.8.data → htmlgraph-0.28.9.data}/data/htmlgraph/templates/CLAUDE.md.template +0 -0
- {htmlgraph-0.28.8.data → htmlgraph-0.28.9.data}/data/htmlgraph/templates/GEMINI.md.template +0 -0
- {htmlgraph-0.28.8.dist-info → htmlgraph-0.28.9.dist-info}/WHEEL +0 -0
- {htmlgraph-0.28.8.dist-info → htmlgraph-0.28.9.dist-info}/entry_points.txt +0 -0
htmlgraph/__init__.py
CHANGED
|
@@ -89,6 +89,20 @@ from htmlgraph.query_builder import Condition, Operator, QueryBuilder
|
|
|
89
89
|
from htmlgraph.reflection import ComputationalReflection, get_reflection_context
|
|
90
90
|
from htmlgraph.repo_hash import RepoHash
|
|
91
91
|
from htmlgraph.sdk import SDK
|
|
92
|
+
from htmlgraph.sdk.auto_help import (
|
|
93
|
+
AutoHelpWrapper,
|
|
94
|
+
enable_auto_help,
|
|
95
|
+
get_help_for_exception,
|
|
96
|
+
show_help_on_error,
|
|
97
|
+
)
|
|
98
|
+
from htmlgraph.sdk.delegation_warnings import (
|
|
99
|
+
get_delegation_warning,
|
|
100
|
+
is_in_subagent_context,
|
|
101
|
+
is_orchestrator_mode_active,
|
|
102
|
+
should_show_delegation_warning,
|
|
103
|
+
show_delegation_warning,
|
|
104
|
+
track_tool_execution,
|
|
105
|
+
)
|
|
92
106
|
from htmlgraph.server import serve
|
|
93
107
|
from htmlgraph.session_context import (
|
|
94
108
|
GitHooksInstaller,
|
|
@@ -123,7 +137,7 @@ from htmlgraph.types import (
|
|
|
123
137
|
)
|
|
124
138
|
from htmlgraph.work_type_utils import infer_work_type, infer_work_type_from_id
|
|
125
139
|
|
|
126
|
-
__version__ = "0.28.
|
|
140
|
+
__version__ = "0.28.9"
|
|
127
141
|
__all__ = [
|
|
128
142
|
# Exceptions
|
|
129
143
|
"HtmlGraphError",
|
|
@@ -244,4 +258,16 @@ __all__ = [
|
|
|
244
258
|
"cleanup_orphaned_temp_files",
|
|
245
259
|
"safe_temp_file",
|
|
246
260
|
"validate_atomic_write",
|
|
261
|
+
# Auto-help system (Feature 1: Auto-Help on Failure)
|
|
262
|
+
"AutoHelpWrapper",
|
|
263
|
+
"enable_auto_help",
|
|
264
|
+
"get_help_for_exception",
|
|
265
|
+
"show_help_on_error",
|
|
266
|
+
# Delegation warnings (Feature 2: Orchestrator Mode Warnings)
|
|
267
|
+
"get_delegation_warning",
|
|
268
|
+
"is_in_subagent_context",
|
|
269
|
+
"is_orchestrator_mode_active",
|
|
270
|
+
"should_show_delegation_warning",
|
|
271
|
+
"show_delegation_warning",
|
|
272
|
+
"track_tool_execution",
|
|
247
273
|
]
|
|
@@ -484,9 +484,24 @@ def create_dashboard_index(base_dir: Path) -> str | None:
|
|
|
484
484
|
import htmlgraph
|
|
485
485
|
|
|
486
486
|
htmlgraph_dir = Path(htmlgraph.__file__).parent
|
|
487
|
-
dashboard_path = htmlgraph_dir / "dashboard.html"
|
|
488
487
|
|
|
489
|
-
|
|
488
|
+
# Try multiple possible locations for dashboard.html
|
|
489
|
+
# Try archive first (preferred, has COLOR SYSTEM & THEME), then API templates, then package root
|
|
490
|
+
possible_paths = [
|
|
491
|
+
htmlgraph_dir.parent.parent.parent
|
|
492
|
+
/ "_archive"
|
|
493
|
+
/ "dashboard.html", # In project archive (preferred)
|
|
494
|
+
htmlgraph_dir / "dashboard.html", # In package root
|
|
495
|
+
htmlgraph_dir / "api" / "templates" / "dashboard.html", # In API templates
|
|
496
|
+
]
|
|
497
|
+
|
|
498
|
+
dashboard_path = None
|
|
499
|
+
for path in possible_paths:
|
|
500
|
+
if path.exists():
|
|
501
|
+
dashboard_path = path
|
|
502
|
+
break
|
|
503
|
+
|
|
504
|
+
if dashboard_path is None:
|
|
490
505
|
return None
|
|
491
506
|
|
|
492
507
|
# Copy to root as index.html
|
htmlgraph/sdk/__init__.py
CHANGED
|
@@ -148,6 +148,7 @@ class SDK(
|
|
|
148
148
|
agent: str | None = None,
|
|
149
149
|
parent_session: str | None = None,
|
|
150
150
|
db_path: str | None = None,
|
|
151
|
+
auto_help: bool = True,
|
|
151
152
|
):
|
|
152
153
|
"""
|
|
153
154
|
Initialize SDK.
|
|
@@ -162,6 +163,7 @@ class SDK(
|
|
|
162
163
|
Raises ValueError if not provided and cannot be detected
|
|
163
164
|
parent_session: Parent session ID to log activities to (for nested contexts)
|
|
164
165
|
db_path: Path to SQLite database file (optional, defaults to ~/.htmlgraph/htmlgraph.db)
|
|
166
|
+
auto_help: Enable automatic help display on operation failures (default: True)
|
|
165
167
|
"""
|
|
166
168
|
if directory is None:
|
|
167
169
|
directory = self._discover_htmlgraph()
|
|
@@ -283,6 +285,12 @@ class SDK(
|
|
|
283
285
|
session_id=None, # Will be set by session manager if available
|
|
284
286
|
)
|
|
285
287
|
|
|
288
|
+
# Enable auto-help on operation failures (Feature 1)
|
|
289
|
+
if auto_help:
|
|
290
|
+
from htmlgraph.sdk.auto_help import enable_auto_help
|
|
291
|
+
|
|
292
|
+
enable_auto_help(self)
|
|
293
|
+
|
|
286
294
|
@staticmethod
|
|
287
295
|
def _discover_htmlgraph() -> Path:
|
|
288
296
|
"""
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Auto-help system for SDK operations.
|
|
3
|
+
|
|
4
|
+
Provides automatic help display when SDK operations fail,
|
|
5
|
+
showing relevant documentation for the failed operation.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import logging
|
|
11
|
+
from typing import TYPE_CHECKING, Any
|
|
12
|
+
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from htmlgraph.sdk import SDK
|
|
15
|
+
|
|
16
|
+
logger = logging.getLogger(__name__)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def get_help_for_exception(sdk: SDK, exception: Exception, context: str = "") -> str:
|
|
20
|
+
"""
|
|
21
|
+
Generate helpful error message with SDK documentation.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
sdk: SDK instance to get help from
|
|
25
|
+
exception: The exception that was raised
|
|
26
|
+
context: Context string (e.g., "features.create", "bugs.where")
|
|
27
|
+
|
|
28
|
+
Returns:
|
|
29
|
+
Formatted help text with error and relevant documentation
|
|
30
|
+
"""
|
|
31
|
+
# Extract topic from context (e.g., "features" from "features.create")
|
|
32
|
+
topic = context.split(".")[0] if "." in context else context
|
|
33
|
+
|
|
34
|
+
# Get base error message
|
|
35
|
+
error_msg = str(exception)
|
|
36
|
+
|
|
37
|
+
# Get relevant help
|
|
38
|
+
help_text = ""
|
|
39
|
+
if topic:
|
|
40
|
+
try:
|
|
41
|
+
help_text = sdk.help(topic)
|
|
42
|
+
except Exception:
|
|
43
|
+
# Fallback to general help if topic-specific help fails
|
|
44
|
+
help_text = sdk.help()
|
|
45
|
+
|
|
46
|
+
# Format combined message
|
|
47
|
+
output = f"""
|
|
48
|
+
❌ SDK Operation Failed: {error_msg}
|
|
49
|
+
|
|
50
|
+
{"=" * 60}
|
|
51
|
+
📚 RELEVANT DOCUMENTATION
|
|
52
|
+
{"=" * 60}
|
|
53
|
+
|
|
54
|
+
{help_text}
|
|
55
|
+
|
|
56
|
+
💡 TIP: Use sdk.help('{topic}') for more details on this collection.
|
|
57
|
+
"""
|
|
58
|
+
return output
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def show_help_on_error(sdk: SDK, exception: Exception, context: str = "") -> None:
|
|
62
|
+
"""
|
|
63
|
+
Display help message for exception to stderr.
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
sdk: SDK instance
|
|
67
|
+
exception: The exception that occurred
|
|
68
|
+
context: Context string for the operation
|
|
69
|
+
"""
|
|
70
|
+
help_msg = get_help_for_exception(sdk, exception, context)
|
|
71
|
+
# Use logger to output to stderr (configured with Rich in __init__.py)
|
|
72
|
+
logger.error(help_msg)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class AutoHelpWrapper:
|
|
76
|
+
"""
|
|
77
|
+
Wrapper for collection methods that automatically shows help on errors.
|
|
78
|
+
|
|
79
|
+
This wrapper catches exceptions from collection operations and displays
|
|
80
|
+
relevant SDK documentation to help users understand what went wrong.
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
def __init__(self, sdk: SDK, collection_name: str):
|
|
84
|
+
"""
|
|
85
|
+
Initialize wrapper.
|
|
86
|
+
|
|
87
|
+
Args:
|
|
88
|
+
sdk: Parent SDK instance
|
|
89
|
+
collection_name: Name of the collection (e.g., "features", "bugs")
|
|
90
|
+
"""
|
|
91
|
+
self._sdk = sdk
|
|
92
|
+
self._collection_name = collection_name
|
|
93
|
+
|
|
94
|
+
def wrap_method(self, method: Any, method_name: str) -> Any:
|
|
95
|
+
"""
|
|
96
|
+
Wrap a method to show help on exceptions.
|
|
97
|
+
|
|
98
|
+
Args:
|
|
99
|
+
method: The method to wrap
|
|
100
|
+
method_name: Name of the method
|
|
101
|
+
|
|
102
|
+
Returns:
|
|
103
|
+
Wrapped method
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
def wrapped(*args: Any, **kwargs: Any) -> Any:
|
|
107
|
+
try:
|
|
108
|
+
return method(*args, **kwargs)
|
|
109
|
+
except Exception as e:
|
|
110
|
+
# Show help automatically
|
|
111
|
+
context = f"{self._collection_name}.{method_name}"
|
|
112
|
+
show_help_on_error(self._sdk, e, context)
|
|
113
|
+
# Re-raise the original exception
|
|
114
|
+
raise
|
|
115
|
+
|
|
116
|
+
return wrapped
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def enable_auto_help(sdk: SDK) -> None:
|
|
120
|
+
"""
|
|
121
|
+
Enable auto-help for all SDK collections.
|
|
122
|
+
|
|
123
|
+
This wraps common collection methods to automatically show help on errors.
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
sdk: SDK instance to enable auto-help for
|
|
127
|
+
"""
|
|
128
|
+
# Collections to wrap
|
|
129
|
+
collections = [
|
|
130
|
+
"features",
|
|
131
|
+
"bugs",
|
|
132
|
+
"spikes",
|
|
133
|
+
"chores",
|
|
134
|
+
"epics",
|
|
135
|
+
"phases",
|
|
136
|
+
"tracks",
|
|
137
|
+
"sessions",
|
|
138
|
+
"patterns",
|
|
139
|
+
"insights",
|
|
140
|
+
"metrics",
|
|
141
|
+
"todos",
|
|
142
|
+
]
|
|
143
|
+
|
|
144
|
+
# Methods to wrap (common operations that might fail)
|
|
145
|
+
methods_to_wrap = [
|
|
146
|
+
"create",
|
|
147
|
+
"get",
|
|
148
|
+
"edit",
|
|
149
|
+
"where",
|
|
150
|
+
"claim",
|
|
151
|
+
"release",
|
|
152
|
+
"mark_done",
|
|
153
|
+
"assign",
|
|
154
|
+
"batch_update",
|
|
155
|
+
"batch_delete",
|
|
156
|
+
]
|
|
157
|
+
|
|
158
|
+
for collection_name in collections:
|
|
159
|
+
if not hasattr(sdk, collection_name):
|
|
160
|
+
continue
|
|
161
|
+
|
|
162
|
+
collection = getattr(sdk, collection_name)
|
|
163
|
+
wrapper = AutoHelpWrapper(sdk, collection_name)
|
|
164
|
+
|
|
165
|
+
for method_name in methods_to_wrap:
|
|
166
|
+
if not hasattr(collection, method_name):
|
|
167
|
+
continue
|
|
168
|
+
|
|
169
|
+
original_method = getattr(collection, method_name)
|
|
170
|
+
wrapped_method = wrapper.wrap_method(original_method, method_name)
|
|
171
|
+
|
|
172
|
+
# Store original method for testing
|
|
173
|
+
setattr(collection, f"_{method_name}_original", original_method)
|
|
174
|
+
# Replace with wrapped version
|
|
175
|
+
setattr(collection, method_name, wrapped_method)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
__all__ = [
|
|
179
|
+
"get_help_for_exception",
|
|
180
|
+
"show_help_on_error",
|
|
181
|
+
"AutoHelpWrapper",
|
|
182
|
+
"enable_auto_help",
|
|
183
|
+
]
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Delegation warnings for orchestrator mode.
|
|
3
|
+
|
|
4
|
+
Provides warnings when orchestrators execute tools directly instead of delegating,
|
|
5
|
+
with automatic suppression when running in subagent contexts.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import logging
|
|
11
|
+
import os
|
|
12
|
+
from typing import Any
|
|
13
|
+
|
|
14
|
+
logger = logging.getLogger(__name__)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def is_orchestrator_mode_active() -> bool:
|
|
18
|
+
"""
|
|
19
|
+
Check if orchestrator mode is active.
|
|
20
|
+
|
|
21
|
+
Returns:
|
|
22
|
+
True if orchestrator mode is enabled
|
|
23
|
+
"""
|
|
24
|
+
# Check environment variable override
|
|
25
|
+
if os.environ.get("HTMLGRAPH_ORCHESTRATOR_DISABLED") == "1":
|
|
26
|
+
return False
|
|
27
|
+
|
|
28
|
+
# Check orchestrator mode file
|
|
29
|
+
try:
|
|
30
|
+
from pathlib import Path
|
|
31
|
+
|
|
32
|
+
from htmlgraph.orchestrator_mode import OrchestratorModeManager
|
|
33
|
+
|
|
34
|
+
# Find .htmlgraph directory
|
|
35
|
+
cwd = Path.cwd()
|
|
36
|
+
graph_dir = cwd / ".htmlgraph"
|
|
37
|
+
|
|
38
|
+
if not graph_dir.exists():
|
|
39
|
+
for parent in [cwd.parent, cwd.parent.parent, cwd.parent.parent.parent]:
|
|
40
|
+
candidate = parent / ".htmlgraph"
|
|
41
|
+
if candidate.exists():
|
|
42
|
+
graph_dir = candidate
|
|
43
|
+
break
|
|
44
|
+
|
|
45
|
+
if not graph_dir.exists():
|
|
46
|
+
return False
|
|
47
|
+
|
|
48
|
+
manager = OrchestratorModeManager(graph_dir)
|
|
49
|
+
return manager.is_enabled()
|
|
50
|
+
except Exception:
|
|
51
|
+
return False
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def is_in_subagent_context() -> bool:
|
|
55
|
+
"""
|
|
56
|
+
Check if running in a subagent context.
|
|
57
|
+
|
|
58
|
+
Subagents are spawned via Task() and should be allowed to execute
|
|
59
|
+
tools directly without delegation warnings.
|
|
60
|
+
|
|
61
|
+
Returns:
|
|
62
|
+
True if in subagent context
|
|
63
|
+
"""
|
|
64
|
+
# Check for subagent environment variable
|
|
65
|
+
subagent_type = os.environ.get("HTMLGRAPH_SUBAGENT_TYPE")
|
|
66
|
+
if subagent_type:
|
|
67
|
+
return True
|
|
68
|
+
|
|
69
|
+
# Check for general subagent marker
|
|
70
|
+
if os.environ.get("HTMLGRAPH_IS_SUBAGENT") == "1":
|
|
71
|
+
return True
|
|
72
|
+
|
|
73
|
+
# Check if spawned by Task tool (Claude Code sets this)
|
|
74
|
+
if os.environ.get("CLAUDE_SPAWNED_BY_TASK") == "1":
|
|
75
|
+
return True
|
|
76
|
+
|
|
77
|
+
return False
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def should_show_delegation_warning() -> bool:
|
|
81
|
+
"""
|
|
82
|
+
Determine if delegation warnings should be shown.
|
|
83
|
+
|
|
84
|
+
Warnings are shown when:
|
|
85
|
+
- Orchestrator mode is active
|
|
86
|
+
- NOT running in subagent context
|
|
87
|
+
- Warnings are not explicitly disabled
|
|
88
|
+
|
|
89
|
+
Returns:
|
|
90
|
+
True if warnings should be shown
|
|
91
|
+
"""
|
|
92
|
+
# Check explicit disable
|
|
93
|
+
if os.environ.get("HTMLGRAPH_DISABLE_DELEGATION_WARNINGS") == "1":
|
|
94
|
+
return False
|
|
95
|
+
|
|
96
|
+
# Don't warn in subagent contexts
|
|
97
|
+
if is_in_subagent_context():
|
|
98
|
+
return False
|
|
99
|
+
|
|
100
|
+
# Only warn if orchestrator mode is active
|
|
101
|
+
return is_orchestrator_mode_active()
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def get_delegation_warning(tool_name: str, context: str = "") -> str:
|
|
105
|
+
"""
|
|
106
|
+
Generate delegation warning message.
|
|
107
|
+
|
|
108
|
+
Args:
|
|
109
|
+
tool_name: Name of the tool being executed directly
|
|
110
|
+
context: Additional context about the operation
|
|
111
|
+
|
|
112
|
+
Returns:
|
|
113
|
+
Formatted warning message
|
|
114
|
+
"""
|
|
115
|
+
# Map tools to suggested subagent types
|
|
116
|
+
tool_to_agent = {
|
|
117
|
+
"Read": "Explore",
|
|
118
|
+
"Grep": "Explore",
|
|
119
|
+
"Glob": "Explore",
|
|
120
|
+
"Edit": "general-purpose",
|
|
121
|
+
"Write": "general-purpose",
|
|
122
|
+
"NotebookEdit": "general-purpose",
|
|
123
|
+
"Bash": "general-purpose",
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
suggested_agent = tool_to_agent.get(tool_name, "general-purpose")
|
|
127
|
+
|
|
128
|
+
warning = f"""
|
|
129
|
+
⚠️ ORCHESTRATOR MODE: Direct tool execution detected
|
|
130
|
+
|
|
131
|
+
Tool: {tool_name}
|
|
132
|
+
Suggestion: Delegate to subagent using Task()
|
|
133
|
+
|
|
134
|
+
Recommended subagent type: {suggested_agent}
|
|
135
|
+
|
|
136
|
+
Example delegation:
|
|
137
|
+
Task(
|
|
138
|
+
prompt='''<describe task>
|
|
139
|
+
|
|
140
|
+
🔴 CRITICAL - Report Results:
|
|
141
|
+
from htmlgraph import SDK
|
|
142
|
+
sdk = SDK(agent='subagent')
|
|
143
|
+
sdk.spikes.create('Task Results') \\
|
|
144
|
+
.set_findings('...') \\
|
|
145
|
+
.save()
|
|
146
|
+
''',
|
|
147
|
+
subagent_type='{suggested_agent}'
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
Why delegate?
|
|
151
|
+
- Reduces orchestrator context usage
|
|
152
|
+
- Enables parallel execution
|
|
153
|
+
- Improves cost efficiency
|
|
154
|
+
- Follows delegation pattern
|
|
155
|
+
|
|
156
|
+
To disable warnings:
|
|
157
|
+
- Set HTMLGRAPH_DISABLE_DELEGATION_WARNINGS=1
|
|
158
|
+
- Or: uv run htmlgraph orchestrator disable
|
|
159
|
+
"""
|
|
160
|
+
|
|
161
|
+
if context:
|
|
162
|
+
warning += f"\nContext: {context}\n"
|
|
163
|
+
|
|
164
|
+
return warning
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
def show_delegation_warning(
|
|
168
|
+
tool_name: str, params: dict[str, Any] | None = None
|
|
169
|
+
) -> None:
|
|
170
|
+
"""
|
|
171
|
+
Display delegation warning if appropriate.
|
|
172
|
+
|
|
173
|
+
Args:
|
|
174
|
+
tool_name: Name of the tool being executed
|
|
175
|
+
params: Tool parameters (optional, for context)
|
|
176
|
+
"""
|
|
177
|
+
if not should_show_delegation_warning():
|
|
178
|
+
return
|
|
179
|
+
|
|
180
|
+
# Extract context from params
|
|
181
|
+
context = ""
|
|
182
|
+
if params:
|
|
183
|
+
if "file_path" in params:
|
|
184
|
+
context = f"File: {params['file_path']}"
|
|
185
|
+
elif "pattern" in params:
|
|
186
|
+
context = f"Pattern: {params['pattern']}"
|
|
187
|
+
elif "command" in params:
|
|
188
|
+
cmd = params["command"]
|
|
189
|
+
if len(cmd) > 80:
|
|
190
|
+
cmd = cmd[:77] + "..."
|
|
191
|
+
context = f"Command: {cmd}"
|
|
192
|
+
|
|
193
|
+
warning = get_delegation_warning(tool_name, context)
|
|
194
|
+
# Use logger to output to stderr
|
|
195
|
+
logger.warning(warning)
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def track_tool_execution(tool_name: str, params: dict[str, Any] | None = None) -> None:
|
|
199
|
+
"""
|
|
200
|
+
Track tool execution and show delegation warning if needed.
|
|
201
|
+
|
|
202
|
+
This is the main entry point for tracking tool usage in orchestrator mode.
|
|
203
|
+
|
|
204
|
+
Args:
|
|
205
|
+
tool_name: Name of the tool being executed
|
|
206
|
+
params: Tool parameters (optional)
|
|
207
|
+
"""
|
|
208
|
+
# Only track direct tool execution, not SDK operations
|
|
209
|
+
tracked_tools = [
|
|
210
|
+
"Read",
|
|
211
|
+
"Write",
|
|
212
|
+
"Edit",
|
|
213
|
+
"NotebookEdit",
|
|
214
|
+
"Grep",
|
|
215
|
+
"Glob",
|
|
216
|
+
"Bash",
|
|
217
|
+
]
|
|
218
|
+
|
|
219
|
+
if tool_name not in tracked_tools:
|
|
220
|
+
return
|
|
221
|
+
|
|
222
|
+
show_delegation_warning(tool_name, params)
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
__all__ = [
|
|
226
|
+
"is_orchestrator_mode_active",
|
|
227
|
+
"is_in_subagent_context",
|
|
228
|
+
"should_show_delegation_warning",
|
|
229
|
+
"get_delegation_warning",
|
|
230
|
+
"show_delegation_warning",
|
|
231
|
+
"track_tool_execution",
|
|
232
|
+
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: htmlgraph
|
|
3
|
-
Version: 0.28.
|
|
3
|
+
Version: 0.28.9
|
|
4
4
|
Summary: HTML is All You Need - Graph database on web standards
|
|
5
5
|
Project-URL: Homepage, https://github.com/Shakes-tzd/htmlgraph
|
|
6
6
|
Project-URL: Documentation, https://github.com/Shakes-tzd/htmlgraph#readme
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
htmlgraph/__init__.py,sha256=
|
|
1
|
+
htmlgraph/__init__.py,sha256=h74L3yWUw2IJ523jruD2AjQB7tTOXef3Gx06pz8-JKw,7378
|
|
2
2
|
htmlgraph/__init__.pyi,sha256=8JuFVuDll9jMx9s8ZQHt2tXic-geOJHiXUMB2YjmHhU,6683
|
|
3
3
|
htmlgraph/agent_detection.py,sha256=wEmrDv4hssPX2OkEnJZBHPbalxcaloiJF_hOOow_5WE,3511
|
|
4
4
|
htmlgraph/agent_registry.py,sha256=80TPYr4P0YMizPUbTH4N5wH6D84IKs-HPBLHGeeP6bY,9449
|
|
@@ -260,7 +260,7 @@ htmlgraph/operations/bootstrap.py,sha256=PK0DNw7Mop-B9tE7yBEJYw-KDyCz2AYsbfGHMVs
|
|
|
260
260
|
htmlgraph/operations/events.py,sha256=LIMn16qfgwolf8L7DIzBbqivxP-kLrHdzEz4y4a50_U,6843
|
|
261
261
|
htmlgraph/operations/fastapi_server.py,sha256=ITHX4clotCHNiLjfNfLw3KYUMfVKKIukPypJZdQ_6OU,5802
|
|
262
262
|
htmlgraph/operations/hooks.py,sha256=SlZcEtLPIysVmBPtO2bV-z3CnBx_mmYT5ia9R5bdGZw,10038
|
|
263
|
-
htmlgraph/operations/initialization.py,sha256=
|
|
263
|
+
htmlgraph/operations/initialization.py,sha256=ebpuOdsMak2rB4LCicxWw109FPms6ndT9e8VJQZbtI4,17648
|
|
264
264
|
htmlgraph/operations/initialization.py.backup,sha256=U0ZibrAUFMgx8fhD_6rh-Ifve9e0eUDK8a-IxQ9i3Is,7067
|
|
265
265
|
htmlgraph/operations/server.py,sha256=ls3_3ULB2ktFN0WNbJrVCvWRPrzXpQuNuNy76tbyTI8,8747
|
|
266
266
|
htmlgraph/orchestration/__init__.py,sha256=udK-EtJ49wONOWc8S0pkZn40q9Io8BjB45xkC7AO4nY,1337
|
|
@@ -297,11 +297,13 @@ htmlgraph/repositories/track_repository_memory.py,sha256=KFbo3rJDEGCa-kWqR7U7ULx
|
|
|
297
297
|
htmlgraph/repositories/track_repository_sqlite.py,sha256=72Xy3nttrz1bQ6-UDgBNuMFstjLgLO7WF_SOr4kaRtc,20881
|
|
298
298
|
htmlgraph/scripts/__init__.py,sha256=a_ef7jnypTH3fzjutKYtUquJospdbA6IOR4o9dgv8Gk,48
|
|
299
299
|
htmlgraph/scripts/deploy.py,sha256=TAdUvnHRuWHgoyUgif8Eln-aY9JWLbXAhkMpzQ1kC9A,4191
|
|
300
|
-
htmlgraph/sdk/__init__.py,sha256=
|
|
300
|
+
htmlgraph/sdk/__init__.py,sha256=IO2y4gbEKZkRiouN42he0F70ChJlvzPayvYG_fDpWnw,14964
|
|
301
301
|
htmlgraph/sdk/__init__.pyi,sha256=Xpe64vXTg7XzURXoP6sPexsHSvdJR5pKVgp8ptLPcMU,495
|
|
302
|
+
htmlgraph/sdk/auto_help.py,sha256=2BqqvJ_CubyRthhCDPQDMKD8wh_pTDLDnb5czWESwjo,4803
|
|
302
303
|
htmlgraph/sdk/base.py,sha256=aw4rz6iykefHs2rLMsYlEXzmnV8Dvtz554oA5xDVwLA,17124
|
|
303
304
|
htmlgraph/sdk/constants.py,sha256=puZ-QPk9OWI9JgNca9kEldu1O9CN6dVjF0q7F-l4USs,6467
|
|
304
305
|
htmlgraph/sdk/core.pyi,sha256=Kk5kAS--qwqsnzszFNB3MIlrnQ1fXIhjDkuNUjJlt8g,9793
|
|
306
|
+
htmlgraph/sdk/delegation_warnings.py,sha256=HGubXpvqqgywQUjNt-A1M_BH-TRC0lO1-kd5LbhzjX4,5932
|
|
305
307
|
htmlgraph/sdk/discovery.py,sha256=4CT6D3AY2ydFgUtYkJyDyhE4gOMcC3AWzzv3NicdyMY,3181
|
|
306
308
|
htmlgraph/sdk/analytics/__init__.py,sha256=cPx54IQZrmREHE-p69R4ZlhsxJMS7Wr23HmLCSzEXvU,526
|
|
307
309
|
htmlgraph/sdk/analytics/engine.py,sha256=T3PW7PHZH5D1bRtUfEqLVYohBYz-wV7pUDLu-72AB9I,4970
|
|
@@ -341,11 +343,11 @@ htmlgraph/templates/AGENTS.md.template,sha256=f96h7V6ygwj-v-fanVI48eYMxR6t_se4be
|
|
|
341
343
|
htmlgraph/templates/CLAUDE.md.template,sha256=h1kG2hTX2XYig2KszsHBfzrwa_4Cfcq2Pj4SwqzeDlM,1984
|
|
342
344
|
htmlgraph/templates/GEMINI.md.template,sha256=gAGzE53Avki87BM_otqy5HdcYCoLsHgqaKjVzNzPMX8,1622
|
|
343
345
|
htmlgraph/templates/orchestration-view.html,sha256=DlS7LlcjH0oO_KYILjuF1X42t8QhKLH4F85rkO54alY,10472
|
|
344
|
-
htmlgraph-0.28.
|
|
345
|
-
htmlgraph-0.28.
|
|
346
|
-
htmlgraph-0.28.
|
|
347
|
-
htmlgraph-0.28.
|
|
348
|
-
htmlgraph-0.28.
|
|
349
|
-
htmlgraph-0.28.
|
|
350
|
-
htmlgraph-0.28.
|
|
351
|
-
htmlgraph-0.28.
|
|
346
|
+
htmlgraph-0.28.9.data/data/htmlgraph/styles.css,sha256=oDUSC8jG-V-hKojOBO9J88hxAeY2wJrBYTq0uCwX_Y4,7135
|
|
347
|
+
htmlgraph-0.28.9.data/data/htmlgraph/templates/AGENTS.md.template,sha256=f96h7V6ygwj-v-fanVI48eYMxR6t_se4bet1H4ZsDpI,7642
|
|
348
|
+
htmlgraph-0.28.9.data/data/htmlgraph/templates/CLAUDE.md.template,sha256=h1kG2hTX2XYig2KszsHBfzrwa_4Cfcq2Pj4SwqzeDlM,1984
|
|
349
|
+
htmlgraph-0.28.9.data/data/htmlgraph/templates/GEMINI.md.template,sha256=gAGzE53Avki87BM_otqy5HdcYCoLsHgqaKjVzNzPMX8,1622
|
|
350
|
+
htmlgraph-0.28.9.dist-info/METADATA,sha256=pSO2X9sHT-bWOaZ9cr0mLY7X55eGGhlaLfMgbHhgYKY,10220
|
|
351
|
+
htmlgraph-0.28.9.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
352
|
+
htmlgraph-0.28.9.dist-info/entry_points.txt,sha256=Wmdo5cx8pt6NoMsssVE2mZH1CZLSUsrg_3iSWatiyn0,103
|
|
353
|
+
htmlgraph-0.28.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|