wormclaude 1.0.8 → 1.0.9
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/dist/cli.js +6 -3
- package/dist/memory.js +19 -0
- package/dist/theme.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -16,7 +16,7 @@ import { tasks } from './tasks.js';
|
|
|
16
16
|
import { connectMcpServers } from './mcp.js';
|
|
17
17
|
import * as usage from './usage.js';
|
|
18
18
|
import { shouldAutoCompact, runCompact, isContextError } from './compact.js';
|
|
19
|
-
import { shouldExtract, triggerMemory } from './memory.js';
|
|
19
|
+
import { shouldExtract, triggerMemory, loadMemoryContext } from './memory.js';
|
|
20
20
|
// --- WORMCLAUDE SUBCOMMANDS (TUI oncesi) ---
|
|
21
21
|
const _arg = (process.argv[2] || '').toLowerCase();
|
|
22
22
|
if (_arg === 'login' || _arg === 'logout' || _arg === 'whoami' || _arg === '--version' || _arg === '-v' || _arg === 'update') {
|
|
@@ -60,6 +60,9 @@ setToolConfig(config); // Agent/alt-agent araçları aynı config'i kullanır
|
|
|
60
60
|
const MAX_TURNS = Number(process.env.WORMCLAUDE_MAX_TURNS) || 50; // tur limiti
|
|
61
61
|
setLang(loadLang() ?? 'tr'); // kayıtlı dili yükle (yoksa tr)
|
|
62
62
|
loadSkills(); // .wormclaude/skills/*.md yükle
|
|
63
|
+
// Kalıcı hafıza: açılışta .wormclaude/memory.md + WORMCLAUDE.md'yi context'e yükle
|
|
64
|
+
const _memCtx = loadMemoryContext();
|
|
65
|
+
const _initHistory = () => (_memCtx ? [{ role: 'system', content: _memCtx }] : []);
|
|
63
66
|
// FULLSCREEN (alternate screen) — WormClaude'un yöntemi: tüm ekranı ink yönetir,
|
|
64
67
|
// scrollback YOK, resize'da HER ŞEY yeniden çizilir → sarmalanma/kaskad olmaz.
|
|
65
68
|
// ?1049h alt-screen · ?1007h alternate-scroll (fare tekerleği → ok tuşu; seçim bozulmaz)
|
|
@@ -297,7 +300,7 @@ function App() {
|
|
|
297
300
|
const allowedToolsRef = useRef(new Set()); // oturum boyu izinli araçlar
|
|
298
301
|
const [ask, setAsk] = useState(null);
|
|
299
302
|
const [askSel, setAskSel] = useState(0); // AskUserQuestion seçimi
|
|
300
|
-
const historyRef = useRef(
|
|
303
|
+
const historyRef = useRef(_initHistory());
|
|
301
304
|
// Acilis: klasore guven sorusu (WormClaude tarzi) — yon tuslari/1-2 sec, Enter onay
|
|
302
305
|
// Dil seçimi (ilk açılış)
|
|
303
306
|
useInput((inp, key) => {
|
|
@@ -710,7 +713,7 @@ function App() {
|
|
|
710
713
|
setHistory: (h) => { historyRef.current = h; setCtxTokens(Math.round(JSON.stringify(h).length / 4)); },
|
|
711
714
|
note: (text) => push({ kind: 'note', text }),
|
|
712
715
|
assistant: (text) => push({ kind: 'assistant', text }),
|
|
713
|
-
clearConv: () => { setItems([{ kind: 'banner' }]); historyRef.current =
|
|
716
|
+
clearConv: () => { setItems([{ kind: 'banner' }]); historyRef.current = _initHistory(); },
|
|
714
717
|
exit,
|
|
715
718
|
};
|
|
716
719
|
setBusy(true);
|
package/dist/memory.js
CHANGED
|
@@ -133,3 +133,22 @@ export function dreamTimeGatePassed() {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
export function getMemoryPath() { return MEM_FILE; }
|
|
136
|
+
// Kalıcı hafızayı başlangıçta context'e yüklemek için oku.
|
|
137
|
+
// .wormclaude/memory.md (oturumlar arası hafıza) + WORMCLAUDE.md (proje notu).
|
|
138
|
+
export function loadMemoryContext() {
|
|
139
|
+
const parts = [];
|
|
140
|
+
try {
|
|
141
|
+
const proj = path.join(process.cwd(), 'WORMCLAUDE.md');
|
|
142
|
+
const c = fs.readFileSync(proj, 'utf8').trim();
|
|
143
|
+
if (c)
|
|
144
|
+
parts.push('# Proje notu (WORMCLAUDE.md)\n' + c.slice(0, 6000));
|
|
145
|
+
}
|
|
146
|
+
catch { }
|
|
147
|
+
try {
|
|
148
|
+
const c = fs.readFileSync(MEM_FILE, 'utf8').trim();
|
|
149
|
+
if (c)
|
|
150
|
+
parts.push('# Hatırlanan bilgiler — önceki oturumlardan\n' + c.slice(0, 6000));
|
|
151
|
+
}
|
|
152
|
+
catch { }
|
|
153
|
+
return parts.join('\n\n');
|
|
154
|
+
}
|
package/dist/theme.js
CHANGED