Skip to content

Commit 69d18da

Browse files
feat: Ko-fi support links in README + fix: strip leaked orchestration labels from chat responses
1 parent de51aa8 commit 69d18da

3 files changed

Lines changed: 59 additions & 4 deletions

File tree

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
<a href="docs/USER-GUIDE.md"><img src="https://img.shields.io/badge/📖_user_guide-docs-34d399?style=for-the-badge" alt="User Guide"/></a>
2020
&nbsp;
2121
<a href="project/Neko-Core.html"><img src="https://img.shields.io/badge/🏗️_architecture-deck-ec4899?style=for-the-badge" alt="Architecture Deck"/></a>
22+
&nbsp;
23+
<a href="https://ko-fi.com/nekocoreos"><img src="https://img.shields.io/badge/☕_support-ko--fi-ff5e5b?style=for-the-badge" alt="Support on Ko-fi"/></a>
2224
</p>
2325

2426
<p align="center">
@@ -885,6 +887,23 @@ The in-shell browser app uses an embedded page model — some sites block embedd
885887

886888
---
887889

890+
## ☕ Support NekoCore
891+
892+
<p align="center">
893+
NekoCore is free, open-source, and built by one developer fueled by curiosity, caffeine, and API tokens.<br>
894+
If this project sparks something for you, a small tip helps keep the neurons firing.
895+
</p>
896+
897+
<p align="center">
898+
<a href="https://ko-fi.com/nekocoreos"><img src="https://img.shields.io/badge/☕_Buy_a_Token-ko--fi-ff5e5b?style=for-the-badge" alt="Buy a Token on Ko-fi"/></a>
899+
</p>
900+
901+
<p align="center">
902+
<em>Every token goes toward LLM API calls, infrastructure, and late-night pizza. 🐱</em>
903+
</p>
904+
905+
---
906+
888907
<p align="center">
889908
<strong>MIT Licensed</strong> — Use it, fork it, extend it, build on it.
890909
</p>
@@ -899,4 +918,6 @@ The in-shell browser app uses an embedded page model — some sites block embedd
899918
<a href="docs/NEKOCORE-OS-ARCHITECTURE-v1.md">Architecture</a>
900919
&nbsp;·&nbsp;
901920
<a href="project/MA/README.md">Memory Architect</a>
921+
&nbsp;·&nbsp;
922+
<a href="https://ko-fi.com/nekocoreos">Support</a>
902923
</p>

project/server/brain/core/orchestrator.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,26 @@ class Orchestrator {
8787
return Boolean(runtime.endpoint);
8888
}
8989

90+
/**
91+
* Extract usable prose from raw conscious output when orchestrator fails.
92+
* Strips INTENT/MEMORY/EMOTION/ANGLE labels; returns text after "---" if present.
93+
*/
94+
_extractProseFromConscious(raw) {
95+
if (!raw || typeof raw !== 'string') return null;
96+
// If there's a "---" separator, the prose is after it
97+
const parts = raw.split(/^---+$/m);
98+
if (parts.length > 1) {
99+
const prose = parts[parts.length - 1].trim();
100+
if (prose.length > 10) return prose;
101+
}
102+
// Strip known label lines
103+
const stripped = raw
104+
.replace(/^(INTENT|MEMORY|EMOTION|ANGLE|BODY STATE|ACTIVATED MEMORIES|EMOTION SIGNAL|PATTERN ALERT|GUT FEELING|SUBCONSCIOUS NOTE|DREAM THREAD|INTUITIVE FLASH):.*$/gm, '')
105+
.replace(/\n{3,}/g, '\n\n')
106+
.trim();
107+
return stripped.length > 10 ? stripped : null;
108+
}
109+
90110
/**
91111
* Main orchestration entry point.
92112
* Runs the full inner dialog pipeline and returns unified response.
@@ -1007,16 +1027,16 @@ The Conscious reasoning notes above define what to address (INTENT), which memor
10071027
} catch (fbErr) {
10081028
console.error(' ⚠ Orchestrator fallback call also failed:', fbErr.message);
10091029
console.warn(' ⚠ FALLBACK: Using conscious output as response (orchestrator timed out + fallback failed)');
1010-
content = consciousOutput || '(Orchestrator timed out)';
1030+
content = this._extractProseFromConscious(consciousOutput) || '(Orchestrator timed out)';
10111031
}
10121032
} else {
10131033
console.warn(' ⚠ FALLBACK: Using conscious output as response (orchestrator timed out, no alternate runtime)');
1014-
content = consciousOutput || '(Orchestrator timed out)';
1034+
content = this._extractProseFromConscious(consciousOutput) || '(Orchestrator timed out)';
10151035
}
10161036
} else {
10171037
console.error(' ⚠ Orchestrator LLM call failed:', err.message);
10181038
console.warn(' ⚠ FALLBACK: Using conscious output as response (orchestrator call error)');
1019-
content = consciousOutput || '(Orchestrator failed — no response available)';
1039+
content = this._extractProseFromConscious(consciousOutput) || '(Orchestrator failed — no response available)';
10201040
}
10211041
}
10221042

project/server/services/chat-pipeline.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,8 +1039,22 @@ function createChatPipeline(deps) {
10391039
safe = safe.replace(/\[TASK_PLAN\][\s\S]*?\[\/TASK_PLAN\]/gi, '').trim();
10401040
safe = safe.replace(/\[TOOL:[^\]]*\]/g, '').trim();
10411041
safe = safe.replace(/\[TOOL:(?:ws_write|ws_append)[\s\S]*?"\]/g, '').trim();
1042+
// Strip leaked conscious-stage labels (INTENT/MEMORY/EMOTION/ANGLE)
1043+
// These appear when the orchestrator call fails and raw conscious output is used as fallback
1044+
const consciousLeakRe = /^(INTENT|MEMORY|EMOTION|ANGLE|BODY STATE|ACTIVATED MEMORIES|EMOTION SIGNAL|PATTERN ALERT|GUT FEELING|SUBCONSCIOUS NOTE|DREAM THREAD|INTUITIVE FLASH):.*$/gm;
1045+
if (consciousLeakRe.test(safe)) {
1046+
console.warn(' ⚠ Safety-stripped leaked conscious/subconscious stage labels from final response');
1047+
// Extract only the text after the last label block (the "---" separator + prose),
1048+
// or strip all label lines if no prose section exists
1049+
const afterSeparator = safe.split(/^---+$/m);
1050+
if (afterSeparator.length > 1) {
1051+
safe = afterSeparator[afterSeparator.length - 1].trim();
1052+
} else {
1053+
safe = safe.replace(consciousLeakRe, '').replace(/\n{3,}/g, '\n\n').trim();
1054+
}
1055+
}
10421056
if (safe !== result.finalResponse) {
1043-
console.warn(' ⚠ Safety-stripped leftover [TOOL:] or [TASK_PLAN] tags from final response');
1057+
console.warn(' ⚠ Safety-stripped leftover tags from final response');
10441058
result.finalResponse = safe || result.finalResponse;
10451059
}
10461060
}

0 commit comments

Comments
 (0)