wormclaude 1.0.10 → 1.0.11

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 CHANGED
@@ -63,7 +63,20 @@ setLang(loadLang() ?? 'tr'); // kayıtlı dili yükle (yoksa tr)
63
63
  loadSkills(); // .wormclaude/skills/*.md yükle
64
64
  // Kalıcı hafıza: açılışta .wormclaude/memory.md + WORMCLAUDE.md'yi context'e yükle
65
65
  const _memCtx = loadMemoryContext();
66
- const _initHistory = () => (_memCtx ? [{ role: 'system', content: _memCtx }] : []);
66
+ const _envContext = () => {
67
+ const plat = process.platform === 'win32' ? 'Windows' : process.platform === 'darwin' ? 'macOS' : 'Linux';
68
+ const shell = process.platform === 'win32' ? 'PowerShell (cmd.exe altinda calisir)' : 'bash/sh';
69
+ const winNote = process.platform === 'win32'
70
+ ? ' This is WINDOWS. Use Windows-correct commands. The Bash tool runs via cmd.exe so && chaining works, but do NOT assume a Unix shell: avoid grep/sed/awk/ls/cat — use the Read/Grep/Glob tools or PowerShell (Get-Content, Select-String, Get-ChildItem). Backslash paths are fine. AVOID interactive scaffolders that hang or are slow (create-react-app); prefer non-interactive, e.g. Vite: npm create vite@latest myapp -- --template react, then npm install. Always pass non-interactive flags (-y, --yes) when available.'
71
+ : ' Use POSIX shell commands.';
72
+ return `ENVIRONMENT: The user machine runs ${plat}. Bash tool shell: ${shell}. Current working directory: ${process.cwd()}.${winNote}`;
73
+ };
74
+ const _initHistory = () => {
75
+ const sys = [{ role: 'system', content: _envContext() }];
76
+ if (_memCtx)
77
+ sys.push({ role: 'system', content: _memCtx });
78
+ return sys;
79
+ };
67
80
  // FULLSCREEN (alternate screen) — WormClaude'un yöntemi: tüm ekranı ink yönetir,
68
81
  // scrollback YOK, resize'da HER ŞEY yeniden çizilir → sarmalanma/kaskad olmaz.
69
82
  // ?1049h alt-screen · ?1007h alternate-scroll (fare tekerleği → ok tuşu; seçim bozulmaz)
package/dist/commands.js CHANGED
@@ -35,10 +35,31 @@ export const COMMANDS = [
35
35
  { name: '/kill', desc: 'bir arka plan görevini durdur: /kill <id>' },
36
36
  { name: '/dream', desc: 'arka planda hafızayı konsolide et (.wormclaude/memory.md)' },
37
37
  { name: '/learn', desc: 'web-öğrenme datasını göster / aç-kapa (eğitim için)' },
38
+ { name: '/copy', desc: 'son yaniti panoya kopyala (/copy all = tum sohbet)' },
38
39
  { name: '/export', desc: 'sohbeti dosyaya kaydet' },
39
40
  { name: '/resume', desc: 'en son kaydedilen oturumu yükle' },
40
41
  { name: '/quit', desc: 'çıkış' },
41
42
  ];
43
+ function _copyClipboard(text) {
44
+ try {
45
+ if (process.platform === 'win32')
46
+ execSync('clip', { input: text });
47
+ else if (process.platform === 'darwin')
48
+ execSync('pbcopy', { input: text });
49
+ else {
50
+ try {
51
+ execSync('xclip -selection clipboard', { input: text });
52
+ }
53
+ catch {
54
+ execSync('wl-copy', { input: text });
55
+ }
56
+ }
57
+ return true;
58
+ }
59
+ catch {
60
+ return false;
61
+ }
62
+ }
42
63
  // Tek seferlik tam yanıt (stream'i biriktirir, araç çağrısı yok)
43
64
  async function complete(messages, config) {
44
65
  let out = '';
@@ -494,6 +515,28 @@ export async function runSlashCommand(input, ctx) {
494
515
  })();
495
516
  return true;
496
517
  }
518
+ case '/copy': {
519
+ const hist = ctx.getHistory().filter((m) => m.role !== 'system');
520
+ const all = arg === 'all' || arg === 'hepsi' || arg === 'tum' || arg === 'tümü';
521
+ let text = '';
522
+ if (all) {
523
+ const NL = String.fromCharCode(10);
524
+ text = hist.map((m) => `## ${m.role}` + NL + (typeof m.content === 'string' ? m.content : JSON.stringify(m.content))).join(NL + NL);
525
+ }
526
+ else {
527
+ const lastA = [...hist].reverse().find((m) => m.role === 'assistant');
528
+ text = lastA ? (typeof lastA.content === 'string' ? lastA.content : JSON.stringify(lastA.content)) : '';
529
+ }
530
+ if (!text.trim()) {
531
+ ctx.note('Kopyalanacak içerik yok.');
532
+ return true;
533
+ }
534
+ const ok = _copyClipboard(text);
535
+ ctx.note(ok
536
+ ? `Panoya kopyalandı (${text.length} karakter, ${all ? 'tüm sohbet' : 'son yanıt'}). Tümü için: /copy all`
537
+ : 'Pano aracı yok (win: clip · mac: pbcopy · linux: xclip/wl-copy). /export ile dosyaya kaydedebilirsin.');
538
+ return true;
539
+ }
497
540
  case '/export': {
498
541
  fs.mkdirSync(SESSION_DIR, { recursive: true });
499
542
  const file = path.join(SESSION_DIR, `session-${tsStamp()}.json`);
package/dist/theme.js CHANGED
@@ -8,4 +8,4 @@ export const theme = {
8
8
  green: '#4ade80',
9
9
  errorRed: '#ff6b6b',
10
10
  };
11
- export const VERSION = '1.0.10';
11
+ export const VERSION = '1.0.11';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wormclaude",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
5
5
  "type": "module",
6
6
  "bin": {