@yemi33/minions 0.1.1755 → 0.1.1756
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.
- package/CHANGELOG.md +5 -0
- package/dashboard.js +35 -3
- package/engine/copilot-models.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dashboard.js
CHANGED
|
@@ -2653,10 +2653,40 @@ function _recoverPartialDocChatResponse(result, sessionKey) {
|
|
|
2653
2653
|
}
|
|
2654
2654
|
|
|
2655
2655
|
|
|
2656
|
+
// Wraps the streaming onChunk so that once the document delimiter is observed
|
|
2657
|
+
// in the growing text, subsequent chunks reuse the locked answer instead of
|
|
2658
|
+
// re-scanning the tail. The model emits "<explanation> ---DOCUMENT--- <full file>"
|
|
2659
|
+
// — the answer portion can't grow after the delimiter, so re-parsing every
|
|
2660
|
+
// chunk through the regenerated file body is wasted O(n²) work.
|
|
2661
|
+
//
|
|
2662
|
+
// Also dedups identical post-strip answers: the upstream accumulator dedups
|
|
2663
|
+
// against the raw growing text, but that text keeps changing as the document
|
|
2664
|
+
// body streams in even though the visible answer is locked. Without this
|
|
2665
|
+
// guard the SSE writer fires a duplicate `chunk` event for every doc-body
|
|
2666
|
+
// delta, which triggers a client DOM rerender and localStorage write each time.
|
|
2667
|
+
function _makeDocChatStreamStripper(onChunk) {
|
|
2668
|
+
if (!onChunk) return undefined;
|
|
2669
|
+
let lockedAnswer = null;
|
|
2670
|
+
let lastSent;
|
|
2671
|
+
return (text) => {
|
|
2672
|
+
let answer;
|
|
2673
|
+
if (lockedAnswer !== null) {
|
|
2674
|
+
answer = lockedAnswer;
|
|
2675
|
+
} else {
|
|
2676
|
+
const parsed = _parseDocChatResultText(text);
|
|
2677
|
+
if (parsed.content !== null) lockedAnswer = parsed.answer;
|
|
2678
|
+
answer = parsed.answer;
|
|
2679
|
+
}
|
|
2680
|
+
if (answer === lastSent) return;
|
|
2681
|
+
lastSent = answer;
|
|
2682
|
+
onChunk(answer);
|
|
2683
|
+
};
|
|
2684
|
+
}
|
|
2685
|
+
|
|
2656
2686
|
// Doc-specific wrapper — adds document context, parses ---DOCUMENT---
|
|
2657
2687
|
async function ccDocCall({ message, document, title, filePath, selection, canEdit, isJson, model, freshSession, onAbortReady }) {
|
|
2658
2688
|
const sessionKey = filePath || title;
|
|
2659
|
-
const docSlice = document
|
|
2689
|
+
const docSlice = String(document || '');
|
|
2660
2690
|
|
|
2661
2691
|
// freshSession: true → discard any prior session for this key so the call starts clean.
|
|
2662
2692
|
// Used by one-shot generation flows (e.g. Create Plan from meeting) that must not
|
|
@@ -2720,7 +2750,8 @@ async function ccDocCall({ message, document, title, filePath, selection, canEdi
|
|
|
2720
2750
|
|
|
2721
2751
|
async function ccDocCallStreaming({ message, document, title, filePath, selection, canEdit, isJson, model, freshSession, onAbortReady, onChunk, onToolUse, onRetry }) {
|
|
2722
2752
|
const sessionKey = filePath || title;
|
|
2723
|
-
const docSlice = document
|
|
2753
|
+
const docSlice = String(document || '');
|
|
2754
|
+
const streamStripper = _makeDocChatStreamStripper(onChunk);
|
|
2724
2755
|
|
|
2725
2756
|
if (freshSession && sessionKey) {
|
|
2726
2757
|
docSessions.delete(sessionKey);
|
|
@@ -2742,7 +2773,7 @@ async function ccDocCallStreaming({ message, document, title, filePath, selectio
|
|
|
2742
2773
|
systemPrompt: DOC_CHAT_SYSTEM_PROMPT,
|
|
2743
2774
|
...(model ? { model } : {}),
|
|
2744
2775
|
onAbortReady,
|
|
2745
|
-
onChunk:
|
|
2776
|
+
onChunk: streamStripper,
|
|
2746
2777
|
onToolUse,
|
|
2747
2778
|
onRetry,
|
|
2748
2779
|
});
|
|
@@ -7464,6 +7495,7 @@ module.exports = {
|
|
|
7464
7495
|
parsePinnedEntries,
|
|
7465
7496
|
_parseDocChatResultText,
|
|
7466
7497
|
_formatDocChatContext,
|
|
7498
|
+
_makeDocChatStreamStripper,
|
|
7467
7499
|
_docChatErrorMessage,
|
|
7468
7500
|
_docChatPartialWarning,
|
|
7469
7501
|
_docChatFailureResponse,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yemi33/minions",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1756",
|
|
4
4
|
"description": "Multi-agent AI dev team that runs from ~/.minions/ — five autonomous agents share a single engine, dashboard, and knowledge base",
|
|
5
5
|
"bin": {
|
|
6
6
|
"minions": "bin/minions.js"
|