mindroot 10.5.0__py3-none-any.whl → 10.14.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.
- mindroot/coreplugins/admin/static/js/agent-form.js +26 -1
- mindroot/coreplugins/admin/static/js/persona-editor.js +14 -1
- mindroot/coreplugins/agent/agent.py +46 -21
- mindroot/coreplugins/agent/buagentz1.py +540 -0
- mindroot/coreplugins/agent/speech_to_speech.py +77 -0
- mindroot/coreplugins/agent/speech_to_speech.py.backup +46 -0
- mindroot/coreplugins/chat/buservices.py +625 -0
- mindroot/coreplugins/chat/commands.py +4 -0
- mindroot/coreplugins/chat/services.py +116 -10
- mindroot/coreplugins/chat/static/css/dark.css +90 -1
- mindroot/coreplugins/chat/static/css/default.css +90 -1
- mindroot/coreplugins/chat/static/css/light.css +724 -0
- mindroot/coreplugins/chat/static/js/chat.js +114 -86
- mindroot/coreplugins/chat/static/js/throttle.js +4 -2
- mindroot/coreplugins/chat/templates/chat.jinja2 +8 -0
- mindroot/lib/chatcontext.py +1 -0
- mindroot/lib/chatlog.py +40 -0
- mindroot/lib/logging/logfiles.py +1 -0
- {mindroot-10.5.0.dist-info → mindroot-10.14.0.dist-info}/METADATA +1 -1
- {mindroot-10.5.0.dist-info → mindroot-10.14.0.dist-info}/RECORD +24 -19
- {mindroot-10.5.0.dist-info → mindroot-10.14.0.dist-info}/WHEEL +0 -0
- {mindroot-10.5.0.dist-info → mindroot-10.14.0.dist-info}/entry_points.txt +0 -0
- {mindroot-10.5.0.dist-info → mindroot-10.14.0.dist-info}/licenses/LICENSE +0 -0
- {mindroot-10.5.0.dist-info → mindroot-10.14.0.dist-info}/top_level.txt +0 -0
|
@@ -15,6 +15,9 @@ import showNotification from './notification.js';
|
|
|
15
15
|
if (!window.lastParsed) window.lastParsed = Date.now();
|
|
16
16
|
if (!window.lastScrolled) window.lastScrolled = Date.now();
|
|
17
17
|
|
|
18
|
+
// Initialize ansi_up for ANSI color code rendering
|
|
19
|
+
const ansi_up = new AnsiUp();
|
|
20
|
+
|
|
18
21
|
window.lastScrolled = Date.now();
|
|
19
22
|
|
|
20
23
|
window.commandHandlers = {};
|
|
@@ -27,10 +30,15 @@ window.registerCommandHandler = function(command, handler) {
|
|
|
27
30
|
|
|
28
31
|
registerDelegate()
|
|
29
32
|
|
|
30
|
-
|
|
33
|
+
|
|
34
|
+
function tryParse_(markdown) {
|
|
31
35
|
return markdownRenderer.parse(markdown);
|
|
32
36
|
}
|
|
33
37
|
|
|
38
|
+
//const tryParse = throttle(tryParse_, 200)
|
|
39
|
+
const tryParse = tryParse_;
|
|
40
|
+
|
|
41
|
+
|
|
34
42
|
const noAction = [ 'say', 'json_encoded_md', 'wait_for_user_reply', 'markdown_await_user', 'tell_and_continue', 'think' ]
|
|
35
43
|
|
|
36
44
|
class Chat extends BaseEl {
|
|
@@ -104,15 +112,16 @@ class Chat extends BaseEl {
|
|
|
104
112
|
} else {
|
|
105
113
|
this.sse = new EventSource(`/chat/${this.sessionid}/events`);
|
|
106
114
|
}
|
|
107
|
-
|
|
108
|
-
const
|
|
115
|
+
|
|
116
|
+
const thisPartial_ = this._partialCmd.bind(this)
|
|
117
|
+
const thisPartial = throttle(thisPartial_, 300)
|
|
109
118
|
const thisRunning = this._runningCmd.bind(this)
|
|
110
119
|
const thisResult = this._cmdResult.bind(this)
|
|
111
120
|
const thisFinished = this._finished.bind(this)
|
|
112
121
|
const thisError = this._showError.bind(this)
|
|
113
122
|
|
|
114
123
|
this.sse.addEventListener('image', this._imageMsg.bind(this));
|
|
115
|
-
this.sse.addEventListener('partial_command', e => thisPartial(e)
|
|
124
|
+
this.sse.addEventListener('partial_command', e => thisPartial(e));
|
|
116
125
|
this.sse.addEventListener('running_command', e => thisRunning(e).catch(console.error));
|
|
117
126
|
this.sse.addEventListener('command_result', e => thisResult(e).catch(console.error));
|
|
118
127
|
this.sse.addEventListener('finished_chat', e => thisFinished(e).catch(console.error));
|
|
@@ -151,7 +160,7 @@ class Chat extends BaseEl {
|
|
|
151
160
|
const { content, sender, persona } = data;
|
|
152
161
|
|
|
153
162
|
// Parse the content as markdown
|
|
154
|
-
const parsed =
|
|
163
|
+
const parsed = tryParse_(content);
|
|
155
164
|
|
|
156
165
|
// Add the message to the chat log
|
|
157
166
|
this.messages = [...this.messages, {
|
|
@@ -175,14 +184,14 @@ class Chat extends BaseEl {
|
|
|
175
184
|
let combinedContent = '';
|
|
176
185
|
for (let item of content) {
|
|
177
186
|
if (item.type === 'text') {
|
|
178
|
-
combinedContent +=
|
|
187
|
+
combinedContent += tryParse_(item.text);
|
|
179
188
|
} else if (item.type === 'image') {
|
|
180
189
|
combinedContent += `<img src="${item.data}" class="image_input" alt="pasted image">`;
|
|
181
190
|
}
|
|
182
191
|
}
|
|
183
192
|
this.messages = [...this.messages, { content: combinedContent, spinning:'no', sender, persona }];
|
|
184
193
|
} else {
|
|
185
|
-
const parsed =
|
|
194
|
+
const parsed = tryParse_(content);
|
|
186
195
|
this.messages = [...this.messages, { content: parsed, spinning:'no', sender, persona }];
|
|
187
196
|
content = [{ type: 'text', text: content }]
|
|
188
197
|
}
|
|
@@ -249,95 +258,99 @@ class Chat extends BaseEl {
|
|
|
249
258
|
}
|
|
250
259
|
|
|
251
260
|
async _partialCmd(event) {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
content = await handler(data);
|
|
261
|
-
}
|
|
262
|
-
if (this.messages[this.messages.length - 1]?.sender != 'ai' || this.startNewMsg) {
|
|
263
|
-
console.log('adding message');
|
|
264
|
-
this.messages = [...this.messages, { content: '', sender: 'ai', persona: data.persona }];
|
|
265
|
-
this.startNewMsg = false
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
if (noAction.includes(data.command)) {
|
|
269
|
-
// Check if there's a registered handler for this command
|
|
261
|
+
try {
|
|
262
|
+
console.log('Event received');
|
|
263
|
+
console.log(event);
|
|
264
|
+
let content = null
|
|
265
|
+
const data = JSON.parse(event.data);
|
|
266
|
+
data.event = 'partial'
|
|
267
|
+
console.log("data:", data)
|
|
268
|
+
const handler = commandHandlers[data.command];
|
|
270
269
|
if (handler) {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
270
|
+
content = await handler(data);
|
|
271
|
+
}
|
|
272
|
+
if (this.messages[this.messages.length - 1]?.sender != 'ai' || this.startNewMsg) {
|
|
273
|
+
console.log('adding message');
|
|
274
|
+
this.messages = [...this.messages, { content: '', sender: 'ai', persona: data.persona }];
|
|
275
|
+
this.startNewMsg = false
|
|
275
276
|
}
|
|
276
277
|
|
|
277
|
-
|
|
278
|
-
if
|
|
279
|
-
if (
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
278
|
+
if (noAction.includes(data.command)) {
|
|
279
|
+
// Check if there's a registered handler for this command
|
|
280
|
+
if (handler) {
|
|
281
|
+
console.log('Used registered handler for', data.command);
|
|
282
|
+
this.msgSoFar = null
|
|
283
|
+
} else {
|
|
284
|
+
this.msgSoFar = this.textParam(data);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
try {
|
|
288
|
+
if (!window.lastParsed) window.lastParsed = Date.now();
|
|
289
|
+
if (content) {
|
|
290
|
+
this.messages[this.messages.length - 1].content = content
|
|
291
|
+
} else if (this.msgSoFar) {
|
|
292
|
+
let elapsed_ = Date.now() - window.lastParsed;
|
|
293
|
+
if (elapsed_ > 40 || this.msgSoFar + '' == '[object Object]' ) {
|
|
294
|
+
const parsed_ = tryParse(this.msgSoFar);
|
|
295
|
+
if (false && parsed_+'' == '[object Object]') {
|
|
296
|
+
console.log('msgSoFar is an object, not parsing:', this.msgSoFar);
|
|
297
|
+
} else {
|
|
298
|
+
this.messages[this.messages.length - 1].content = parsed_;
|
|
299
|
+
console.log(' parsed ', elapsed_);
|
|
300
|
+
window.lastParsed = Date.now();
|
|
301
|
+
}
|
|
287
302
|
} else {
|
|
288
|
-
|
|
289
|
-
console.log(' parsed ', elapsed_);
|
|
290
|
-
window.lastParsed = Date.now();
|
|
303
|
+
console.log('********************************* only ',elapsed_);
|
|
291
304
|
}
|
|
292
|
-
} else {
|
|
293
|
-
console.log('********************************* only ',elapsed_);
|
|
294
305
|
}
|
|
306
|
+
} catch (e) {
|
|
307
|
+
console.error("Could not parse markdown:", e)
|
|
308
|
+
console.log('msgSoFar:')
|
|
309
|
+
console.log(this.msgSoFar)
|
|
310
|
+
this.messages[this.messages.length - 1].content = `<pre><code>${this.msgSoFar}</code></pre>`
|
|
295
311
|
}
|
|
296
|
-
} catch (e) {
|
|
297
|
-
console.error("Could not parse markdown:", e)
|
|
298
|
-
console.log('msgSoFar:')
|
|
299
|
-
console.log(this.msgSoFar)
|
|
300
|
-
this.messages[this.messages.length - 1].content = `<pre><code>${this.msgSoFar}</code></pre>`
|
|
301
|
-
}
|
|
302
|
-
} else {
|
|
303
|
-
console.log('partial. data.params', data.params)
|
|
304
|
-
console.log("command is", data.command)
|
|
305
|
-
if (handler) {
|
|
306
|
-
data.event = 'partial'
|
|
307
|
-
console.log('handler:', handler)
|
|
308
|
-
content = handler(data);
|
|
309
|
-
this.requestUpdate();
|
|
310
312
|
} else {
|
|
311
|
-
console.
|
|
312
|
-
console.
|
|
313
|
-
|
|
313
|
+
console.log('partial. data.params', data.params)
|
|
314
|
+
console.log("command is", data.command)
|
|
315
|
+
if (handler) {
|
|
316
|
+
data.event = 'partial'
|
|
317
|
+
console.log('handler:', handler)
|
|
318
|
+
content = handler(data);
|
|
319
|
+
this.requestUpdate();
|
|
320
|
+
} else {
|
|
321
|
+
console.warn('No handler for command:', data.command)
|
|
322
|
+
console.warn(commandHandlers)
|
|
323
|
+
}
|
|
314
324
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
325
|
+
if (typeof(data.params) == 'array') {
|
|
326
|
+
data.params = {"val": data.params}
|
|
327
|
+
} else if (typeof(data.params) == 'string') {
|
|
328
|
+
data.params = {"val": data.params}
|
|
329
|
+
} else if (typeof(data.params) == 'object') {
|
|
330
|
+
data.params = {"val": data.params}
|
|
331
|
+
}
|
|
332
|
+
const paramStr = JSON.stringify(data.params)
|
|
333
|
+
const escaped = escapeJsonForHtml(paramStr)
|
|
334
|
+
if (content) {
|
|
335
|
+
console.log('found content, not using action component')
|
|
336
|
+
this.messages[this.messages.length - 1].content = content
|
|
337
|
+
} else {
|
|
338
|
+
if (this.messages[this.messages.length - 1].content == '' ||
|
|
339
|
+
Date.now()- window.lastParsed > 40) {
|
|
340
|
+
window.lastParsed = Date.now();
|
|
341
|
+
this.messages[this.messages.length - 1].content = `
|
|
342
|
+
<action-component funcName="${data.command}" params="${escaped}"
|
|
343
|
+
result="">
|
|
344
|
+
</action-component>`;
|
|
345
|
+
}
|
|
335
346
|
}
|
|
336
347
|
}
|
|
348
|
+
this.requestUpdate();
|
|
349
|
+
this._scrollToBottom()
|
|
350
|
+
window.initializeCodeCopyButtons();
|
|
351
|
+
} catch (e) {
|
|
352
|
+
console.error("Error in partialCmd", e)
|
|
337
353
|
}
|
|
338
|
-
this.requestUpdate();
|
|
339
|
-
this._scrollToBottom()
|
|
340
|
-
window.initializeCodeCopyButtons();
|
|
341
354
|
}
|
|
342
355
|
|
|
343
356
|
async _runningCmd(event) {
|
|
@@ -355,7 +368,7 @@ class Chat extends BaseEl {
|
|
|
355
368
|
}
|
|
356
369
|
|
|
357
370
|
if (data.args?.markdown?.split('\n').length < 3) {
|
|
358
|
-
this.messages[this.messages.length - 1].content =
|
|
371
|
+
this.messages[this.messages.length - 1].content = tryParse_(data.args.markdown);
|
|
359
372
|
}
|
|
360
373
|
|
|
361
374
|
console.log(event);
|
|
@@ -375,7 +388,7 @@ class Chat extends BaseEl {
|
|
|
375
388
|
if (!noAction.includes(data.command)) {
|
|
376
389
|
this.messages[this.messages.length - 1].content = `<action-component funcName="${data.command}" params="${escapeJsonForHtml(JSON.stringify(data.args))}" result=""></action-component>`;
|
|
377
390
|
} else {
|
|
378
|
-
this.messages[this.messages.length - 1].content =
|
|
391
|
+
this.messages[this.messages.length - 1].content = tryParse_(this.textParam(data));
|
|
379
392
|
}
|
|
380
393
|
}
|
|
381
394
|
window.initializeCodeCopyButtons();
|
|
@@ -389,6 +402,21 @@ class Chat extends BaseEl {
|
|
|
389
402
|
data.event = 'result'
|
|
390
403
|
if (handler) {
|
|
391
404
|
await handler(data);
|
|
405
|
+
} else {
|
|
406
|
+
try {
|
|
407
|
+
if (data.command == 'execute_command' || data.command == 'run_python') {
|
|
408
|
+
let skipWarning = data.result?.replace(' command result, NOT user reply','');
|
|
409
|
+
// Convert ANSI codes to HTML
|
|
410
|
+
const htmlOutput = ansi_up.ansi_to_html(skipWarning);
|
|
411
|
+
|
|
412
|
+
this.messages.push( {
|
|
413
|
+
role: 'user',
|
|
414
|
+
content: `<pre class="shellout"><code>${htmlOutput}</code></pre>`,
|
|
415
|
+
})
|
|
416
|
+
}
|
|
417
|
+
} catch (e) {
|
|
418
|
+
console.error("Could not parse command result:", e)
|
|
419
|
+
}
|
|
392
420
|
}
|
|
393
421
|
for (let msg of this.messages) {
|
|
394
422
|
msg.spinning = 'no'
|
|
@@ -6,14 +6,16 @@ export function throttle(func, wait) {
|
|
|
6
6
|
const now = Date.now();
|
|
7
7
|
|
|
8
8
|
if (now - lastCall >= wait) {
|
|
9
|
-
func(...args);
|
|
9
|
+
const res = func(...args);
|
|
10
10
|
lastCall = now;
|
|
11
|
+
return res
|
|
11
12
|
} else {
|
|
12
13
|
// Optional: ensure the last call still happens
|
|
13
14
|
clearTimeout(timeout);
|
|
14
15
|
timeout = setTimeout(() => {
|
|
15
|
-
func(...args);
|
|
16
|
+
const res2 = func(...args);
|
|
16
17
|
lastCall = Date.now();
|
|
18
|
+
return res2
|
|
17
19
|
}, wait - (now - lastCall));
|
|
18
20
|
}
|
|
19
21
|
};
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
|
|
12
12
|
{% block head_styles %}
|
|
13
13
|
<link rel="stylesheet" href="/chat/static/css/main.css">
|
|
14
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
15
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
16
|
+
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
|
|
14
17
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/styles/atom-one-dark.min.css">
|
|
15
18
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous">
|
|
16
19
|
{% endblock %}
|
|
@@ -18,6 +21,7 @@
|
|
|
18
21
|
{% block head_scripts %}
|
|
19
22
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
|
|
20
23
|
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js" integrity="sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8" crossorigin="anonymous"></script>
|
|
24
|
+
<script src="https://cdn.jsdelivr.net/npm/ansi_up@5.2.1/ansi_up.min.js"></script>
|
|
21
25
|
<script type="module" src="/chat/static/js/chatmessage.js"></script>
|
|
22
26
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
|
23
27
|
<!-- <script src="https://cdn.jsdelivr.net/npm/marked-highlight/lib/index.umd.js"></script> -->
|
|
@@ -72,6 +76,10 @@
|
|
|
72
76
|
</div>
|
|
73
77
|
{% endblock %}
|
|
74
78
|
|
|
79
|
+
{% block post_content %}
|
|
80
|
+
|
|
81
|
+
{% endblock %}
|
|
82
|
+
|
|
75
83
|
</div> <!-- page-container -->
|
|
76
84
|
|
|
77
85
|
<script type="module" src="/chat/static/js/code-copy-button.js"></script>
|
mindroot/lib/chatcontext.py
CHANGED
|
@@ -9,6 +9,7 @@ from .chatlog import ChatLog
|
|
|
9
9
|
from .chatlog import extract_delegate_task_log_ids, find_child_logs_by_parent_id, find_chatlog_file
|
|
10
10
|
from typing import TypeVar, Type, Protocol, runtime_checkable, Set
|
|
11
11
|
from .utils.debug import debug_box
|
|
12
|
+
|
|
12
13
|
contexts = {}
|
|
13
14
|
|
|
14
15
|
async def get_context(log_id, user):
|
mindroot/lib/chatlog.py
CHANGED
|
@@ -62,6 +62,8 @@ class ChatLog:
|
|
|
62
62
|
self.agent = log_data.get('agent')
|
|
63
63
|
self.messages = log_data.get('messages', [])
|
|
64
64
|
self.parent_log_id = log_data.get('parent_log_id', None)
|
|
65
|
+
# we need the last modification time of the file
|
|
66
|
+
self.last_modified = os.path.getmtime(log_file)
|
|
65
67
|
print("Loaded log file at ", log_file)
|
|
66
68
|
print("Message length: ", len(self.messages))
|
|
67
69
|
else:
|
|
@@ -71,12 +73,23 @@ class ChatLog:
|
|
|
71
73
|
def _save_log_sync(self) -> None:
|
|
72
74
|
"""Synchronous version for backward compatibility"""
|
|
73
75
|
log_file = os.path.join(self.log_dir, f'chatlog_{self.log_id}.json')
|
|
76
|
+
self.last_modified = time.time()
|
|
74
77
|
with open(log_file, 'w') as f:
|
|
75
78
|
json.dump(self._get_log_data(), f, indent=2)
|
|
76
79
|
|
|
80
|
+
|
|
81
|
+
def add_message_role(self, message: Dict[str, str]) -> None:
|
|
82
|
+
for i in range(len(self.messages)-1, -1, -1):
|
|
83
|
+
if self.messages[i]['role'] == message.get('role'):
|
|
84
|
+
self.messages[i]['content'].append(message)
|
|
85
|
+
self.last_modified = time.time()
|
|
86
|
+
self._save_log_sync()
|
|
87
|
+
return
|
|
88
|
+
|
|
77
89
|
def add_message(self, message: Dict[str, str]) -> None:
|
|
78
90
|
"""Synchronous version for backward compatibility"""
|
|
79
91
|
should_save = self._add_message_impl(message)
|
|
92
|
+
self.last_modified = time.time()
|
|
80
93
|
if should_save:
|
|
81
94
|
self._save_log_sync()
|
|
82
95
|
else:
|
|
@@ -133,6 +146,7 @@ class ChatLog:
|
|
|
133
146
|
debug_box("5")
|
|
134
147
|
self.messages.append(message)
|
|
135
148
|
self._save_log_sync()
|
|
149
|
+
|
|
136
150
|
async def add_message_async(self, message: Dict[str, str]) -> None:
|
|
137
151
|
"""Async version for new code that needs non-blocking operations"""
|
|
138
152
|
should_save = self._add_message_impl(message)
|
|
@@ -145,10 +159,36 @@ class ChatLog:
|
|
|
145
159
|
len(self.messages[-1]['content']) > 0 and
|
|
146
160
|
self.messages[-1]['content'][0].get('type') == 'image'):
|
|
147
161
|
await self.save_log()
|
|
162
|
+
|
|
163
|
+
async def drop_last(self, role) -> None:
|
|
164
|
+
if len(self.messages) == 0:
|
|
165
|
+
return
|
|
166
|
+
if self.messages[-1]['role'] == role:
|
|
167
|
+
self.messages = self.messages[:-1]
|
|
168
|
+
await self.save_log()
|
|
148
169
|
|
|
149
170
|
def get_history(self) -> List[Dict[str, str]]:
|
|
150
171
|
return self.messages
|
|
151
172
|
|
|
173
|
+
|
|
174
|
+
def parsed_commands(self) -> List[Dict[str, any]]:
|
|
175
|
+
commands = []
|
|
176
|
+
filtered = [m for m in self.messages if m['role'] == 'assistant']
|
|
177
|
+
for message in filtered:
|
|
178
|
+
content = message['content']
|
|
179
|
+
if isinstance(content, list) and len(content) > 0 and 'text' in content[0]:
|
|
180
|
+
text = content[0]['text']
|
|
181
|
+
else:
|
|
182
|
+
continue
|
|
183
|
+
try:
|
|
184
|
+
cmd_list = json.loads(text)
|
|
185
|
+
if not isinstance(cmd_list, list):
|
|
186
|
+
cmd_list = [cmd_list]
|
|
187
|
+
commands.extend(cmd_list)
|
|
188
|
+
except (json.JSONDecodeError, TypeError):
|
|
189
|
+
continue
|
|
190
|
+
return commands
|
|
191
|
+
|
|
152
192
|
def get_recent(self, max_tokens: int = 4096) -> List[Dict[str, str]]:
|
|
153
193
|
recent_messages = []
|
|
154
194
|
total_length = 0
|
mindroot/lib/logging/logfiles.py
CHANGED
|
@@ -36,7 +36,7 @@ mindroot/coreplugins/admin/static/css/reset.css,sha256=pN9wuf7laZeIt-QjbxqJXDfu7
|
|
|
36
36
|
mindroot/coreplugins/admin/static/css/update.css,sha256=J1lchkEY6WST1LLoyPhXjjCZ4-oqMu7ooWjJNduRmMs,3008
|
|
37
37
|
mindroot/coreplugins/admin/static/js/about-info.js,sha256=CRyI5xGX3huycwseT5c80zsqQkElcdZsKMofyzyCimI,9230
|
|
38
38
|
mindroot/coreplugins/admin/static/js/agent-editor.js,sha256=ZCJBNQ-l4kJj-ZufYuzEg45ZpqxwliNmxuqUa2GNiqY,2825
|
|
39
|
-
mindroot/coreplugins/admin/static/js/agent-form.js,sha256=
|
|
39
|
+
mindroot/coreplugins/admin/static/js/agent-form.js,sha256=cFyIAS6dVxvzqJgJra-a5aFtS6zau0roveDSgpUF63A,41403
|
|
40
40
|
mindroot/coreplugins/admin/static/js/agent-list.js,sha256=86mqFyHspx9EnzJpgUDyeAgEq-jcqQ4v96CrgfUXoGM,2239
|
|
41
41
|
mindroot/coreplugins/admin/static/js/api-key-script.js,sha256=By80j-cwgxRT96MUBiZbVJuRvr6OAhd-GPmAUdZDZ4E,11199
|
|
42
42
|
mindroot/coreplugins/admin/static/js/base.js,sha256=xGCA6ngMapQ_jqMgHXg__CS3R46qprycOjkKTFDCMlA,1307
|
|
@@ -52,7 +52,7 @@ mindroot/coreplugins/admin/static/js/missing-commands.js,sha256=adNF9GWN981_KX7H
|
|
|
52
52
|
mindroot/coreplugins/admin/static/js/model-preferences-v2.js,sha256=4SFZBia959kRrSZXzIdWB0dscg4WtVIGYuLFlLpqBBI,15669
|
|
53
53
|
mindroot/coreplugins/admin/static/js/model-preferences.js,sha256=J0G7gcGACaPyslWJO42urf5wbZZsqO0LyPicAu-uV_Y,3365
|
|
54
54
|
mindroot/coreplugins/admin/static/js/notification.js,sha256=296rVCr6MNtzvzdzW3bGiMa231-BnWJtwZZ_sDWX-3c,5633
|
|
55
|
-
mindroot/coreplugins/admin/static/js/persona-editor.js,sha256=
|
|
55
|
+
mindroot/coreplugins/admin/static/js/persona-editor.js,sha256=emJSPBXDk54ztWDYOcs-bHAf1qQSIpq11RjV9bt5adA,10382
|
|
56
56
|
mindroot/coreplugins/admin/static/js/plugin-advanced-install.js,sha256=-HDJ3lVuDwj6R-74TfVUo4dUxB8efl13m3R_sUicnJI,8038
|
|
57
57
|
mindroot/coreplugins/admin/static/js/plugin-base.js,sha256=KWp5DqueHtyTxYKbuHMoFpoFXrfMbIjzK4M1ulAR9m8,5095
|
|
58
58
|
mindroot/coreplugins/admin/static/js/plugin-index-browser.js,sha256=P-V4wqlYGxjr7oF2LiD5ti8Is3wtSsKPwpRgRJpT0VI,10028
|
|
@@ -439,8 +439,9 @@ mindroot/coreplugins/admin/static/js/lit-html/node/directives/when.js,sha256=NLe
|
|
|
439
439
|
mindroot/coreplugins/admin/static/js/lit-html/node/directives/when.js.map,sha256=tOonih_-EaqrunhNGshA9xN--WIVdGikjg8MkVp0itQ,1534
|
|
440
440
|
mindroot/coreplugins/admin/templates/admin.jinja2,sha256=H_oDqoWWk0Da0Jre67LIKvB3h30fmjcZz2T5knUyz0k,13272
|
|
441
441
|
mindroot/coreplugins/admin/templates/model-preferences-v2.jinja2,sha256=5J3rXYmtp_yMTFCk85SYN03gc4lbidF0Nip6YcqcIW4,891
|
|
442
|
-
mindroot/coreplugins/agent/agent.py,sha256=
|
|
442
|
+
mindroot/coreplugins/agent/agent.py,sha256=poQXA_HPVQHqgJ-dyS1Xa9Fxtn8tP51auiAP_X_HppM,22522
|
|
443
443
|
mindroot/coreplugins/agent/agent.py.bak,sha256=X-EmtrpEpdfo-iUw9gj7mLveRVzAApsDWPTwMAuv7Ww,20715
|
|
444
|
+
mindroot/coreplugins/agent/buagentz1.py,sha256=XVRKf-jEHgv6ru-iESg1uPJGgUz3pzeAG-0UjPA4bqw,22404
|
|
444
445
|
mindroot/coreplugins/agent/cmd_start_example.py,sha256=Mdcd9st6viI6-M7a0-zqkw3IxR9FAxIiZ_8G-tLdIJk,1416
|
|
445
446
|
mindroot/coreplugins/agent/command_parser.py,sha256=dgMqtVLPQWE2BU7iyjqwKGy5Gh74jcZkiy1JDs07t4E,13166
|
|
446
447
|
mindroot/coreplugins/agent/ensure_msg_type.py,sha256=P2XSBs3gtjlDQLOF7808nm-Dl5jswyO6qgv0lNRyHXM,240
|
|
@@ -449,6 +450,8 @@ mindroot/coreplugins/agent/escaping.md,sha256=b6VdJjQ3oYhLStV-72wzHm7DhQDnnJp5gK
|
|
|
449
450
|
mindroot/coreplugins/agent/init_models.py,sha256=-o5P3NNlWmgbGltngfq5VYZ9Dm81N9kkMqTkG4p5PDA,939
|
|
450
451
|
mindroot/coreplugins/agent/models.default.json,sha256=hX9-dlBWzJ-2QpMeG696hk7c483-CivujIcRRq4DcNs,1146
|
|
451
452
|
mindroot/coreplugins/agent/providers.default.json,sha256=FPmY5qVOrBy_Z4RgDJWQwLwxd-zWWI83nnAE6z5fEeg,1524
|
|
453
|
+
mindroot/coreplugins/agent/speech_to_speech.py,sha256=M3wvrv1Psgu_NOFmoe_7sZZ6uET6zMzweZaQmrE1WxQ,2797
|
|
454
|
+
mindroot/coreplugins/agent/speech_to_speech.py.backup,sha256=ZvyihqBj4juleDJx8BJb0Z4TpxIxGDMYyrM0Bw0cSXg,1687
|
|
452
455
|
mindroot/coreplugins/agent/system.j2.backup,sha256=itPx-urDBtKBqwps5T6yly4M9gX45AdrM-sznwefG_U,8927
|
|
453
456
|
mindroot/coreplugins/agent/Assistant/agent.json,sha256=P4CaQpQaUTwx0PoyV9bCJHvfvANsFyBZlNcMtVlxM3M,1281
|
|
454
457
|
mindroot/coreplugins/agent/SysAdmin/agent.json,sha256=Y_BRfIutEgiaB65Qrwl4trKXhXtEkk7SlRpviVhQV74,2735
|
|
@@ -461,14 +464,15 @@ mindroot/coreplugins/api_keys/router.py,sha256=pz6VjUDPryKxYgnPt8-5AP1P-wjIIQq2c
|
|
|
461
464
|
mindroot/coreplugins/api_keys/inject/admin.jinja2,sha256=t50he2aeK_GJ6838LekBcGjkYRbo5p6OHeTWtlggbyU,372
|
|
462
465
|
mindroot/coreplugins/api_keys/static/js/api-key-manager.js,sha256=imqlhd85Z-1e7uxDlprphGV_N467WKo8_BYVQsJJ1V0,5327
|
|
463
466
|
mindroot/coreplugins/chat/__init__.py,sha256=qVdTF1fHZJHwY_ChnPvNFx2Nlg07FHvK0V_JmzfWzdw,230
|
|
467
|
+
mindroot/coreplugins/chat/buservices.py,sha256=MHwkwlWNh8xJ_nnskSBj4N5B1xtFhOMfN-dUyxVC_M8,24635
|
|
464
468
|
mindroot/coreplugins/chat/buwidget_routes.py,sha256=MtwaPX2vEGDylifWOqcx7EAhDw0y1Y3Y91z58EJaLsc,9982
|
|
465
|
-
mindroot/coreplugins/chat/commands.py,sha256=
|
|
469
|
+
mindroot/coreplugins/chat/commands.py,sha256=YVmOMyihMoPMxeaQI2f9QAz91Z7lHfjZ01rTfogmyeM,17308
|
|
466
470
|
mindroot/coreplugins/chat/format_result_msgs.py,sha256=daEdpEyAJIa8b2VkCqSKcw8PaExcB6Qro80XNes_sHA,2
|
|
467
471
|
mindroot/coreplugins/chat/mod.py,sha256=Xydjv3feKJJRbwdiB7raqiQnWtaS_2GcdC9bXYQX3nE,425
|
|
468
472
|
mindroot/coreplugins/chat/models.py,sha256=GRcRuDUAJFpyWERPMxkxUaZ21igNlWeeamriruEKiEQ,692
|
|
469
473
|
mindroot/coreplugins/chat/router.py,sha256=vq9UwYoFoGQMVmDC0TkjH7TWivFwkIe6OU0Scu-dtHg,15998
|
|
470
474
|
mindroot/coreplugins/chat/router_dedup_patch.py,sha256=lDSpVMSd26pXJwrrdirUmR1Jv_N5VHiDzTS8t3XswDU,918
|
|
471
|
-
mindroot/coreplugins/chat/services.py,sha256=
|
|
475
|
+
mindroot/coreplugins/chat/services.py,sha256=nDWirlBgjZ-4AFvv2DqmEXQXaohTIDDm2HPKCjx5G0A,26012
|
|
472
476
|
mindroot/coreplugins/chat/utils.py,sha256=BiE14PpsAcQSO5vbU88klHGm8cAXJDXxgVgva-EXybU,155
|
|
473
477
|
mindroot/coreplugins/chat/widget_manager.py,sha256=LrMbZlHqpxbLwdN4XZ4GkLxORwxa1o6IVCrlUDBmGQs,4786
|
|
474
478
|
mindroot/coreplugins/chat/widget_routes.py,sha256=iV3OwLFnvLDsMHdckJnmVXcUgyyng-zIPNXyK2LAUjc,11802
|
|
@@ -481,8 +485,9 @@ mindroot/coreplugins/chat/static/site.webmanifest,sha256=5i_XHR8LaddNq95C2gqaFKR
|
|
|
481
485
|
mindroot/coreplugins/chat/static/user.png,sha256=J1krBpv71HvrF6-b0gpm57zye_vNW4QyPuSaDCiXGhg,206392
|
|
482
486
|
mindroot/coreplugins/chat/static/css/action-fix.css,sha256=XifijgB5CWVGun3iQcIiVrM00MS2mTtKOzjBh_tzwjA,714
|
|
483
487
|
mindroot/coreplugins/chat/static/css/admin-custom.css,sha256=_a3dsl9dv9d14NMev-BVtXYvXfQvpXfwzfnchAcmcnE,2844
|
|
484
|
-
mindroot/coreplugins/chat/static/css/dark.css,sha256=
|
|
485
|
-
mindroot/coreplugins/chat/static/css/default.css,sha256=
|
|
488
|
+
mindroot/coreplugins/chat/static/css/dark.css,sha256=l1TLDsEf-S_9fpHcEt6AvKB7Uj4bz66SvbP9Vp0e7dc,19464
|
|
489
|
+
mindroot/coreplugins/chat/static/css/default.css,sha256=l1TLDsEf-S_9fpHcEt6AvKB7Uj4bz66SvbP9Vp0e7dc,19464
|
|
490
|
+
mindroot/coreplugins/chat/static/css/light.css,sha256=dOsd8tp5ma6gFrKn95hSee1pkCJnsyyFCSUZVorsoCM,12755
|
|
486
491
|
mindroot/coreplugins/chat/static/css/main.css,sha256=4Hv1AjdedAiazfGS3NSV01L6KavopG-BHqX98WVGAi4,137
|
|
487
492
|
mindroot/coreplugins/chat/static/css/mobile.css,sha256=lmZBo4u2LNXVKGWAuMIm61JDnsvaCyy9qt3V6ouw2fI,3613
|
|
488
493
|
mindroot/coreplugins/chat/static/css/reset.css,sha256=pN9wuf7laZeIt-QjbxqJXDfu7yOTVy7fshf-VMeXPu0,696
|
|
@@ -491,7 +496,7 @@ mindroot/coreplugins/chat/static/js/auth.js,sha256=HbzBIz2yGdWQggVGzEsIzNG272T7x
|
|
|
491
496
|
mindroot/coreplugins/chat/static/js/authfetch.js,sha256=a05Vj4pt6Qnu4WdF7jsismVijubUXZuR6ndWeYBOtZY,526
|
|
492
497
|
mindroot/coreplugins/chat/static/js/base.js,sha256=AtaHATjxpQNQ7Lv8RUlV0n3icrpmC2dmnkAdSI_v714,1285
|
|
493
498
|
mindroot/coreplugins/chat/static/js/chat-history.js,sha256=FuJyEu0jcNomJeCbRT45Z_kcS5LVZdRbnC6kcH-Eyd8,6501
|
|
494
|
-
mindroot/coreplugins/chat/static/js/chat.js,sha256=
|
|
499
|
+
mindroot/coreplugins/chat/static/js/chat.js,sha256=VlIQ8EVosYdBO3p7INHTqG93ROzLxWs5aNjhKBxJhTY,16755
|
|
495
500
|
mindroot/coreplugins/chat/static/js/chat.js.diff,sha256=QdlbO_WiNXUWmvbwM5x_bC5WMFdzsXrXaNtmubPtnhE,8339
|
|
496
501
|
mindroot/coreplugins/chat/static/js/chatform.js,sha256=0tMTfeBTVLxiuTVS8tLD67UYVMrL1H_sa-0hAkm3EqA,17832
|
|
497
502
|
mindroot/coreplugins/chat/static/js/chatmessage.js,sha256=qoRb6XWKzzbMOIowIt3admWO8FaT2VqWGhN_anQlGSQ,1272
|
|
@@ -510,7 +515,7 @@ mindroot/coreplugins/chat/static/js/new_chatform.js,sha256=hxAYVCPodAhf2UyOuZweW
|
|
|
510
515
|
mindroot/coreplugins/chat/static/js/notification.js,sha256=296rVCr6MNtzvzdzW3bGiMa231-BnWJtwZZ_sDWX-3c,5633
|
|
511
516
|
mindroot/coreplugins/chat/static/js/property-escape.js,sha256=3-cYqEejyffHWzH-zRpha44fWW_HxZAKksKyXP7GfQY,433
|
|
512
517
|
mindroot/coreplugins/chat/static/js/sse.js,sha256=Nz8YDbILKlE--J3qGfEdPPNBIf3utK7fEuHuFGGQfWE,11375
|
|
513
|
-
mindroot/coreplugins/chat/static/js/throttle.js,sha256=
|
|
518
|
+
mindroot/coreplugins/chat/static/js/throttle.js,sha256=5lUpze3Wk-0VMbAwkgsliTcrVuDE8gDjFSSgJ0bG4V8,614
|
|
514
519
|
mindroot/coreplugins/chat/static/js/unsafe-html.js,sha256=KnCcFhzOhU_9sm6OsNd4tfQumG3syytZMr7TbwWgZ8k,838
|
|
515
520
|
mindroot/coreplugins/chat/static/js/unsafe-html.js.1,sha256=zFv0vnkg-YZiCKH9uSxaQj_Q7PWq57UgWCVkB2q2oO0,1962
|
|
516
521
|
mindroot/coreplugins/chat/static/js/backup/base.js,sha256=68MKyiJ1Wqld-dGrYUFE3EHrEZVNeC_VEyd8yC-iP34,1026
|
|
@@ -887,7 +892,7 @@ mindroot/coreplugins/chat/static/js/lit-html/node/directives/until.js,sha256=j1W
|
|
|
887
892
|
mindroot/coreplugins/chat/static/js/lit-html/node/directives/until.js.map,sha256=7xiwSZ7_fGtr5XwW-10Dzs8n9QE2VUfXaZ0Sd6d82L0,6567
|
|
888
893
|
mindroot/coreplugins/chat/static/js/lit-html/node/directives/when.js,sha256=NLe0NJ-6jqjVDUrT_DzmSpREsRaLo1yarzdYcV_5xHY,181
|
|
889
894
|
mindroot/coreplugins/chat/static/js/lit-html/node/directives/when.js.map,sha256=tOonih_-EaqrunhNGshA9xN--WIVdGikjg8MkVp0itQ,1534
|
|
890
|
-
mindroot/coreplugins/chat/templates/chat.jinja2,sha256=
|
|
895
|
+
mindroot/coreplugins/chat/templates/chat.jinja2,sha256=Lw_Xl6un1Ysa6H4dlXYdcOBuiIKNCJyXra7Xa0xhbOk,3592
|
|
891
896
|
mindroot/coreplugins/chat_avatar/__init__.py,sha256=MsSFjiLMLJZ7QhUPpVBWKiyDnCzryquRyr329NoCACI,2
|
|
892
897
|
mindroot/coreplugins/chat_avatar/inject/chat.jinja2,sha256=TDSSt_SdOOW4EJMQK7fA_L2W5GNbDICRmXyqSsw0wuE,1093
|
|
893
898
|
mindroot/coreplugins/check_list/__init__.py,sha256=SaaGvnpz37xRM7DjGWBz5CD27Jh2UVdPLGoVUAFrUSY,77
|
|
@@ -2195,8 +2200,8 @@ mindroot/lib/buchatlog.py,sha256=LJZc3ksKgJcStltmHrrwNLaON3EDzhOKVAWj0Wl22wk,586
|
|
|
2195
2200
|
mindroot/lib/buchatlog2.py,sha256=Va9FteBWePEjWD9OZcw-OtQfEb-IoCVGTmJeMRaX9is,13729
|
|
2196
2201
|
mindroot/lib/buchatlog3.py,sha256=SAvcK2m_CW0Jw8p1pqnbrTexcx24PotrsJTqvQ_D290,24573
|
|
2197
2202
|
mindroot/lib/butemplates.py,sha256=gfHGPTOjvoEenXsR7xokNuqMjOAPuC2DawheH1Ae4bU,12196
|
|
2198
|
-
mindroot/lib/chatcontext.py,sha256=
|
|
2199
|
-
mindroot/lib/chatlog.py,sha256=
|
|
2203
|
+
mindroot/lib/chatcontext.py,sha256=1NjD3YFmw5KpEi0rAUeFNYU1DRnu2k7kL3KRX4ebJc8,12438
|
|
2204
|
+
mindroot/lib/chatlog.py,sha256=RKEx29JB-48fntWIzsdI4NTu-hp6eKxcpwRmNW6cSAc,27629
|
|
2200
2205
|
mindroot/lib/chatlog_optimized.py,sha256=rL7KBP-V4_cGgMLihxPm3HoKcjFEyA1uEtPtqvkOa3A,20011
|
|
2201
2206
|
mindroot/lib/json_escape.py,sha256=5cAmAdNbnYX2uyfQcnse2fFtNI0CdB-AfZ23RwaDm-k,884
|
|
2202
2207
|
mindroot/lib/model_selector.py,sha256=Wz-8NZoiclmnhLeCNnI3WCuKFmjsO5HE4bK5F8GpZzU,1397
|
|
@@ -2217,7 +2222,7 @@ mindroot/lib/db/preferences.py,sha256=UCmJyjE20Lv51vFJJ7lOE08AJHqKRth6vBP4rkU8ed
|
|
|
2217
2222
|
mindroot/lib/json_str_block/__init__.py,sha256=VrB0YgLICZlnZNkt91hit9Mzx2ukhijS8O78tybMT_A,30
|
|
2218
2223
|
mindroot/lib/json_str_block/json_str_block.py,sha256=EL3TrCInP5LaJLZZ02_n1pC3udnVCZA1FMDakr_RKFA,3390
|
|
2219
2224
|
mindroot/lib/logging/log_router.py,sha256=BUj03xC0sSc03A2Oo9PWea2ap1p1paFY9ZSFisIgIzc,6274
|
|
2220
|
-
mindroot/lib/logging/logfiles.py,sha256=
|
|
2225
|
+
mindroot/lib/logging/logfiles.py,sha256=Exjd3gAIyzkYWvTTM2-_-HSs6vB1YCuJVJAfpf99kqE,2682
|
|
2221
2226
|
mindroot/lib/logging/logfiles_prev.py,sha256=Dqya4VlqXh5Wx7HC6uydkwkb5SLpcl6HQ46f6Tfjlvg,2593
|
|
2222
2227
|
mindroot/lib/pipelines/pipe.py,sha256=zlVI8BTjDaI87UZO61uVvXyZIbs_pPipi-zGVgDoCwk,527
|
|
2223
2228
|
mindroot/lib/pipelines/pipelines.py,sha256=Uv83Xvnpt34u6J0h0f1mef4M53ifgFco65nMECBJeMM,2654
|
|
@@ -2250,9 +2255,9 @@ mindroot/protocols/services/stream_chat.py,sha256=fMnPfwaB5fdNMBLTEg8BXKAGvrELKH
|
|
|
2250
2255
|
mindroot/registry/__init__.py,sha256=40Xy9bmPHsgdIrOzbtBGzf4XMqXVi9P8oZTJhn0r654,151
|
|
2251
2256
|
mindroot/registry/component_manager.py,sha256=WZFNPg4SNvpqsM5NFiC2DpgmrJQCyR9cNhrCBpp30Qk,995
|
|
2252
2257
|
mindroot/registry/data_access.py,sha256=81In5TwETpaqnnY1_-tBQM7rfWvUxZUZkG7lEelRUfU,5321
|
|
2253
|
-
mindroot-10.
|
|
2254
|
-
mindroot-10.
|
|
2255
|
-
mindroot-10.
|
|
2256
|
-
mindroot-10.
|
|
2257
|
-
mindroot-10.
|
|
2258
|
-
mindroot-10.
|
|
2258
|
+
mindroot-10.14.0.dist-info/licenses/LICENSE,sha256=8plAmZh8y9ccuuqFFz4kp7G-cO_qsPgAOoHNvabSB4U,1070
|
|
2259
|
+
mindroot-10.14.0.dist-info/METADATA,sha256=n9GjQHedhYDW020WBn2VnWdURczO2M3D1NWGykzR57Q,1036
|
|
2260
|
+
mindroot-10.14.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
2261
|
+
mindroot-10.14.0.dist-info/entry_points.txt,sha256=0bpyjMccLttx6VcjDp6zfJPN0Kk0rffor6IdIbP0j4c,50
|
|
2262
|
+
mindroot-10.14.0.dist-info/top_level.txt,sha256=gwKm7DmNjhdrCJTYCrxa9Szne4lLpCtrEBltfsX-Mm8,9
|
|
2263
|
+
mindroot-10.14.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|