mindroot 9.23.0__py3-none-any.whl → 10.0.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.
Potentially problematic release.
This version of mindroot might be problematic. Click here for more details.
- mindroot/coreplugins/chat/static/js/chat.js +13 -2
- mindroot/coreplugins/chat/static/js/chatform.js +1 -1
- mindroot/coreplugins/check_list/helpers.py +221 -0
- mindroot/coreplugins/check_list/mod.py +383 -126
- mindroot/coreplugins/check_list/mod.py.backup +378 -0
- mindroot/coreplugins/check_list/mod.py.backup2 +506 -0
- mindroot/coreplugins/check_list/mod.py.backup3 +506 -0
- mindroot/coreplugins/check_list/plugin_info.json +14 -0
- mindroot/docs/.env +1 -0
- mindroot/docs/.gitignore +1 -0
- mindroot/docs/_build/doctrees/chat_with_assistant.doctree +0 -0
- mindroot/docs/_build/doctrees/developer_documentation.doctree +0 -0
- mindroot/docs/_build/doctrees/environment.pickle +0 -0
- mindroot/docs/_build/doctrees/getting_started.doctree +0 -0
- mindroot/docs/_build/doctrees/index.doctree +0 -0
- mindroot/docs/_build/doctrees/install_plugins_with_tools.doctree +0 -0
- mindroot/docs/_build/doctrees/installation.doctree +0 -0
- mindroot/docs/_build/doctrees/llm_api_key.doctree +0 -0
- mindroot/docs/_build/doctrees/llm_plugin_installation.doctree +0 -0
- mindroot/docs/_build/doctrees/programming_task.doctree +0 -0
- mindroot/docs/_build/doctrees/source/ahp.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.admin.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.api_keys.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.chat.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.chat_avatar.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.check_list.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.credits.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.email.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.env_manager.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.events.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.index.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.index.handlers.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.jwt_auth.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.l8n.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.mcp_.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.persona.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.startup.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.subscriptions.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.usage.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.coreplugins.user_service.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.lib.auth.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.lib.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.lib.json_str_block.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.lib.plugins.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.lib.providers.backup.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.lib.providers.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mindroot.registry.doctree +0 -0
- mindroot/docs/_build/doctrees/source/modules.doctree +0 -0
- mindroot/docs/_build/doctrees/source/mr_agent_expert_instr.doctree +0 -0
- mindroot/docs/_build/doctrees/starting_mindroot.doctree +0 -0
- mindroot/docs/_build/doctrees/user_documentation.doctree +0 -0
- mindroot/docs/_build/html/_modules/mindroot/coreplugins/admin/settings_router.html +287 -89
- mindroot/docs/_build/html/_modules/mindroot/coreplugins/jwt_auth/middleware.html +281 -89
- mindroot/docs/_build/html/_modules/mindroot/lib/providers/model_preferences_v2.html +293 -91
- mindroot/docs/_build/html/_modules/mindroot/lib/templates.html +342 -98
- mindroot/docs/_build/html/_modules/mindroot/server.html +291 -87
- mindroot/docs/_build/html/_sources/developer_documentation.rst.txt +21 -1
- mindroot/docs/_build/html/developer_documentation.html +44 -4
- mindroot/docs/_build/html/getting_started.html +18 -15
- mindroot/docs/_build/html/index.html +1 -0
- mindroot/docs/_build/html/searchindex.js +1 -1
- mindroot/docs/_build/html/source/mindroot.coreplugins.api_keys.html +15 -2
- mindroot/docs/_build/html/source/mindroot.coreplugins.chat_avatar.html +15 -2
- mindroot/docs/_build/html/source/mindroot.coreplugins.check_list.html +15 -2
- mindroot/docs/_build/html/source/mindroot.coreplugins.credits.html +15 -2
- mindroot/docs/_build/html/source/mindroot.coreplugins.env_manager.html +15 -2
- mindroot/docs/_build/html/source/mindroot.coreplugins.events.html +15 -2
- mindroot/docs/_build/html/source/mindroot.coreplugins.index.handlers.html +15 -2
- mindroot/docs/_build/html/source/mindroot.coreplugins.index.html +15 -2
- mindroot/docs/_build/html/source/mindroot.coreplugins.persona.html +15 -2
- mindroot/docs/_build/html/source/mindroot.coreplugins.startup.html +15 -2
- mindroot/docs/_build/html/source/mindroot.coreplugins.subscriptions.html +15 -2
- mindroot/docs/_build/html/source/mindroot.coreplugins.usage.html +15 -2
- mindroot/docs/_build/html/source/mindroot.coreplugins.user_service.html +15 -2
- mindroot/docs/_build/html/source/mindroot.lib.auth.html +15 -2
- mindroot/docs/_build/html/source/mindroot.lib.html +2 -1
- mindroot/docs/_build/html/source/mindroot.lib.json_str_block.html +15 -2
- mindroot/docs/_build/html/source/mindroot.lib.plugins.html +15 -2
- mindroot/docs/_build/html/source/mindroot.registry.html +15 -2
- mindroot/docs/_build/html/source/modules.html +15 -2
- mindroot/docs/developer_documentation.rst +21 -1
- mindroot/lib/buchatlog3.py +592 -0
- mindroot/lib/chatlog.py +155 -5
- {mindroot-9.23.0.dist-info → mindroot-10.0.0.dist-info}/METADATA +1 -1
- {mindroot-9.23.0.dist-info → mindroot-10.0.0.dist-info}/RECORD +91 -83
- {mindroot-9.23.0.dist-info → mindroot-10.0.0.dist-info}/WHEEL +0 -0
- {mindroot-9.23.0.dist-info → mindroot-10.0.0.dist-info}/entry_points.txt +0 -0
- {mindroot-9.23.0.dist-info → mindroot-10.0.0.dist-info}/licenses/LICENSE +0 -0
- {mindroot-9.23.0.dist-info → mindroot-10.0.0.dist-info}/top_level.txt +0 -0
|
@@ -17,7 +17,7 @@ if (!window.lastScrolled) window.lastScrolled = Date.now();
|
|
|
17
17
|
|
|
18
18
|
window.lastScrolled = Date.now();
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
window.commandHandlers = {};
|
|
21
21
|
|
|
22
22
|
// Function to register command handlers
|
|
23
23
|
window.registerCommandHandler = function(command, handler) {
|
|
@@ -205,7 +205,18 @@ class Chat extends BaseEl {
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
textParam (data) {
|
|
208
|
-
|
|
208
|
+
console.log('textParam', data);
|
|
209
|
+
if (typeof(data) == 'string') {
|
|
210
|
+
try {
|
|
211
|
+
data = JSON.parse(data);
|
|
212
|
+
} catch (e) {
|
|
213
|
+
console.error('Could not parse data string:', e);
|
|
214
|
+
return data;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if (data.args.text) {
|
|
218
|
+
return data.args.text;
|
|
219
|
+
} else if (data.params.text) {
|
|
209
220
|
return data.params.text;
|
|
210
221
|
} else if (data.params.markdown) {
|
|
211
222
|
return data.params.markdown;
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Helper functions for nested subtask handling in the checklist system.
|
|
4
|
+
|
|
5
|
+
This module provides utilities for:
|
|
6
|
+
- Finding nested subtasks within parent task bodies
|
|
7
|
+
- Updating nested subtask completion status
|
|
8
|
+
- Managing hierarchical task structures
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import re
|
|
12
|
+
from typing import Dict, List, Optional, Tuple, Any
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def find_nested_subtask(subtask_id: str, tasks: List[Dict]) -> Dict[str, Any]:
|
|
16
|
+
"""
|
|
17
|
+
Search for a nested subtask within all top-level tasks.
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
subtask_id: The label of the nested subtask to find
|
|
21
|
+
tasks: List of top-level task dictionaries
|
|
22
|
+
|
|
23
|
+
Returns:
|
|
24
|
+
Dictionary with:
|
|
25
|
+
- found: bool - Whether the nested subtask was found
|
|
26
|
+
- nested_task: dict - The nested task if found
|
|
27
|
+
- nested_index: int - Index of nested task within parent
|
|
28
|
+
- parent_task: dict - The parent task containing the nested task
|
|
29
|
+
- parent_index: int - Index of parent task in main list
|
|
30
|
+
- parent_nested_tasks: list - All nested tasks from the parent
|
|
31
|
+
"""
|
|
32
|
+
print(f"\nSearching for nested subtask: '{subtask_id}'")
|
|
33
|
+
|
|
34
|
+
# Import the parser from the main module
|
|
35
|
+
from .mod import _parse
|
|
36
|
+
|
|
37
|
+
# Iterate through each top-level task
|
|
38
|
+
for parent_index, parent_task in enumerate(tasks):
|
|
39
|
+
print(f"\nChecking parent task {parent_index}: '{parent_task['label']}'")
|
|
40
|
+
|
|
41
|
+
# Parse nested tasks from this parent's body
|
|
42
|
+
nested_tasks = _parse(parent_task['body'])
|
|
43
|
+
print(f"Found {len(nested_tasks)} nested tasks")
|
|
44
|
+
|
|
45
|
+
# Search through nested tasks for matching subtask_id
|
|
46
|
+
for nested_index, nested_task in enumerate(nested_tasks):
|
|
47
|
+
print(f" Nested task {nested_index}: '{nested_task['label']}'")
|
|
48
|
+
|
|
49
|
+
# Check if this nested task matches our search
|
|
50
|
+
if nested_task['label'] == subtask_id:
|
|
51
|
+
print(f"FOUND MATCH!")
|
|
52
|
+
return {
|
|
53
|
+
'found': True,
|
|
54
|
+
'nested_task': nested_task,
|
|
55
|
+
'nested_index': nested_index,
|
|
56
|
+
'parent_task': parent_task,
|
|
57
|
+
'parent_index': parent_index,
|
|
58
|
+
'parent_nested_tasks': nested_tasks
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
# Not found in any nested tasks
|
|
62
|
+
print("Not found in nested tasks")
|
|
63
|
+
return {'found': False}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def update_nested_subtask_status(parent_task: Dict, nested_index: int,
|
|
67
|
+
nested_tasks: List[Dict], done: bool) -> str:
|
|
68
|
+
"""
|
|
69
|
+
Update the completion status of a nested subtask within its parent's body.
|
|
70
|
+
|
|
71
|
+
Args:
|
|
72
|
+
parent_task: The parent task dictionary
|
|
73
|
+
nested_index: Index of the nested task to update
|
|
74
|
+
nested_tasks: List of all nested tasks from the parent
|
|
75
|
+
done: New completion status
|
|
76
|
+
|
|
77
|
+
Returns:
|
|
78
|
+
Updated body text for the parent task
|
|
79
|
+
"""
|
|
80
|
+
# Update the nested task status
|
|
81
|
+
nested_tasks[nested_index]['done'] = done
|
|
82
|
+
|
|
83
|
+
# Reconstruct the parent's body with updated nested tasks
|
|
84
|
+
body_lines = parent_task['body'].splitlines()
|
|
85
|
+
updated_lines = []
|
|
86
|
+
|
|
87
|
+
nested_task_line_indices = []
|
|
88
|
+
|
|
89
|
+
# Find all nested task lines in the original body
|
|
90
|
+
for i, line in enumerate(body_lines):
|
|
91
|
+
stripped = line.lstrip()
|
|
92
|
+
if (stripped.startswith('- [ ]') or
|
|
93
|
+
stripped.startswith('- [x]') or
|
|
94
|
+
stripped.startswith('- [X]')):
|
|
95
|
+
nested_task_line_indices.append(i)
|
|
96
|
+
|
|
97
|
+
# Update the body by replacing task lines with updated status
|
|
98
|
+
current_nested_idx = 0
|
|
99
|
+
i = 0
|
|
100
|
+
|
|
101
|
+
while i < len(body_lines):
|
|
102
|
+
line = body_lines[i]
|
|
103
|
+
stripped = line.lstrip()
|
|
104
|
+
|
|
105
|
+
# Check if this is a nested task line
|
|
106
|
+
if (stripped.startswith('- [ ]') or
|
|
107
|
+
stripped.startswith('- [x]') or
|
|
108
|
+
stripped.startswith('- [X]')):
|
|
109
|
+
|
|
110
|
+
if current_nested_idx < len(nested_tasks):
|
|
111
|
+
# Replace with updated status
|
|
112
|
+
indent = len(line) - len(stripped)
|
|
113
|
+
checkbox = '- [x]' if nested_tasks[current_nested_idx]['done'] else '- [ ]'
|
|
114
|
+
updated_line = ' ' * indent + checkbox + ' ' + nested_tasks[current_nested_idx]['label']
|
|
115
|
+
updated_lines.append(updated_line)
|
|
116
|
+
current_nested_idx += 1
|
|
117
|
+
else:
|
|
118
|
+
updated_lines.append(line)
|
|
119
|
+
else:
|
|
120
|
+
updated_lines.append(line)
|
|
121
|
+
|
|
122
|
+
i += 1
|
|
123
|
+
|
|
124
|
+
return '\n'.join(updated_lines)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def resolve_subtask_id_with_nesting(subtask_id: Any, tasks: List[Dict],
|
|
128
|
+
cursor: int) -> Tuple[int, Optional[Dict]]:
|
|
129
|
+
"""
|
|
130
|
+
Resolve a subtask_id to an index, checking both top-level and nested tasks.
|
|
131
|
+
|
|
132
|
+
Args:
|
|
133
|
+
subtask_id: The subtask identifier (int, string, or None)
|
|
134
|
+
tasks: List of top-level tasks
|
|
135
|
+
cursor: Current cursor position
|
|
136
|
+
|
|
137
|
+
Returns:
|
|
138
|
+
Tuple of (index, nested_info)
|
|
139
|
+
- index: The resolved index (-1 if not found)
|
|
140
|
+
- nested_info: Dict with nested task info if found, None if top-level
|
|
141
|
+
"""
|
|
142
|
+
# Default to current cursor position
|
|
143
|
+
if subtask_id is None or subtask_id == -1:
|
|
144
|
+
return cursor, None
|
|
145
|
+
|
|
146
|
+
# If it's a number, convert from 1-based to 0-based for top-level
|
|
147
|
+
if isinstance(subtask_id, int):
|
|
148
|
+
idx = subtask_id - 1
|
|
149
|
+
if 0 <= idx < len(tasks):
|
|
150
|
+
return idx, None
|
|
151
|
+
else:
|
|
152
|
+
return -1, None
|
|
153
|
+
|
|
154
|
+
# It's a string, try to find a matching label
|
|
155
|
+
# First check top-level tasks
|
|
156
|
+
for i, task in enumerate(tasks):
|
|
157
|
+
if task["label"] == subtask_id:
|
|
158
|
+
return i, None
|
|
159
|
+
|
|
160
|
+
# If not found in top-level, search nested tasks
|
|
161
|
+
nested_result = find_nested_subtask(subtask_id, tasks)
|
|
162
|
+
if nested_result['found']:
|
|
163
|
+
return nested_result['parent_index'], nested_result
|
|
164
|
+
|
|
165
|
+
# No match found anywhere
|
|
166
|
+
return -1, None
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def format_nested_task_status(nested_info: Dict) -> str:
|
|
170
|
+
"""
|
|
171
|
+
Format a nested task for display.
|
|
172
|
+
|
|
173
|
+
Args:
|
|
174
|
+
nested_info: Dictionary containing nested task information
|
|
175
|
+
|
|
176
|
+
Returns:
|
|
177
|
+
Formatted string showing the nested task status
|
|
178
|
+
"""
|
|
179
|
+
nested_task = nested_info['nested_task']
|
|
180
|
+
parent_task = nested_info['parent_task']
|
|
181
|
+
|
|
182
|
+
status = "✅" if nested_task["done"] else "❌"
|
|
183
|
+
|
|
184
|
+
return (
|
|
185
|
+
f"{status} **Nested Subtask**: {nested_task['label']} "
|
|
186
|
+
f"(within '{parent_task['label']}')\n"
|
|
187
|
+
f"{nested_task['body']}"
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
def get_next_incomplete_task(tasks: List[Dict], current_cursor: int) -> int:
|
|
192
|
+
"""
|
|
193
|
+
Find the next incomplete task starting from the given cursor position.
|
|
194
|
+
|
|
195
|
+
Args:
|
|
196
|
+
tasks: List of top-level tasks
|
|
197
|
+
current_cursor: Current cursor position
|
|
198
|
+
|
|
199
|
+
Returns:
|
|
200
|
+
Index of next incomplete task, or len(tasks) if all complete
|
|
201
|
+
"""
|
|
202
|
+
return next(
|
|
203
|
+
(i for i, t in enumerate(tasks[current_cursor:], current_cursor) if not t["done"]),
|
|
204
|
+
len(tasks),
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def has_incomplete_nested_tasks(task: Dict) -> bool:
|
|
209
|
+
"""
|
|
210
|
+
Check if a task has any incomplete nested subtasks.
|
|
211
|
+
|
|
212
|
+
Args:
|
|
213
|
+
task: Task dictionary to check
|
|
214
|
+
|
|
215
|
+
Returns:
|
|
216
|
+
True if there are incomplete nested tasks, False otherwise
|
|
217
|
+
"""
|
|
218
|
+
from .mod import _parse
|
|
219
|
+
|
|
220
|
+
nested_tasks = _parse(task['body'])
|
|
221
|
+
return any(not nested_task['done'] for nested_task in nested_tasks)
|