wormclaude 1.0.92 → 1.0.94

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
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import React, { useState, useRef, useEffect } from 'react';
3
3
  import { render, Box, Text, useApp, useInput } from 'ink';
4
- import TextInput from 'ink-text-input';
4
+ import LineEditor from './lineeditor.js';
5
5
  import * as path from 'node:path';
6
6
  import { theme, VERSION } from './theme.js';
7
7
  import { loadConfig, streamChat, fetchAccount } from './api.js';
@@ -1068,7 +1068,7 @@ function App() {
1068
1068
  React.createElement(Text, { color: theme.grey }, t('perm.feedbackPrompt')),
1069
1069
  React.createElement(Box, null,
1070
1070
  React.createElement(Text, { color: theme.redBright, bold: true }, "\u276F "),
1071
- React.createElement(TextInput, { value: permFeedback, onChange: setPermFeedback, onSubmit: (val) => { perm.resolve({ deny: val.trim() }); setPerm(null); setPermMode('select'); }, placeholder: t('perm.feedbackPlaceholder') })),
1071
+ React.createElement(LineEditor, { value: permFeedback, onChange: setPermFeedback, onSubmit: (val) => { perm.resolve({ deny: val.trim() }); setPerm(null); setPermMode('select'); }, placeholder: t('perm.feedbackPlaceholder'), isActive: permMode === 'feedback' })),
1072
1072
  React.createElement(Text, { color: theme.greyDim }, " Enter g\u00F6nder \u00B7 Esc iptal"))) : (React.createElement(React.Fragment, null,
1073
1073
  React.createElement(Text, { color: permSel === 0 ? theme.redBright : theme.grey, bold: permSel === 0 },
1074
1074
  permSel === 0 ? '❯ ' : ' ',
@@ -1102,7 +1102,7 @@ function App() {
1102
1102
  (React.createElement(Box, { flexDirection: "column" },
1103
1103
  React.createElement(Box, { borderStyle: "round", borderColor: busy ? theme.greyDim : theme.red, paddingX: 1 },
1104
1104
  React.createElement(Text, { color: theme.redBright, bold: true }, "\u276F "),
1105
- React.createElement(TextInput, { value: input, onChange: (val) => { setInput(val); setCmdSel(0); }, onSubmit: onSubmit, placeholder: busy ? 'cevap üretilirken yazabilirsin…' : t('input.placeholder') })),
1105
+ React.createElement(LineEditor, { value: input, onChange: (val) => { setInput(val); setCmdSel(0); }, onSubmit: onSubmit, placeholder: busy ? 'cevap üretilirken yazabilirsin…' : t('input.placeholder'), isActive: started && !perm && !ask && lang !== null })),
1106
1106
  input.startsWith('/') ? (() => {
1107
1107
  const filtered = cmdFilter(input);
1108
1108
  if (!filtered.length)
@@ -0,0 +1,60 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import { Text, useInput } from 'ink';
3
+ // Tam imleç-kontrollü satır editörü (ink-text-input yerine).
4
+ // Destekler: yazma (imleç konumuna ekleme), Backspace/Delete, ← →, Home/End (Ctrl+A/Ctrl+E).
5
+ // ↑↓/PageUp/PageDown/Esc/Tab'a DOKUNMAZ → menü/scroll/dialog handler'larına geçer.
6
+ export default function LineEditor({ value, onChange, onSubmit, placeholder, isActive = true, color }) {
7
+ const [cursor, setCursor] = useState(value.length);
8
+ // value dışarıdan değişirse imleci sınırda tut (örn. submit'te temizlenince).
9
+ useEffect(() => { setCursor((c) => Math.min(c, value.length)); }, [value]);
10
+ useInput((input, key) => {
11
+ if (key.leftArrow) {
12
+ setCursor((c) => Math.max(0, c - 1));
13
+ return;
14
+ }
15
+ if (key.rightArrow) {
16
+ setCursor((c) => Math.min(value.length, c + 1));
17
+ return;
18
+ }
19
+ if (key.return) {
20
+ onSubmit?.(value);
21
+ return;
22
+ }
23
+ if (key.backspace || key.delete) {
24
+ if (cursor > 0) {
25
+ onChange(value.slice(0, cursor - 1) + value.slice(cursor));
26
+ setCursor(cursor - 1);
27
+ }
28
+ return;
29
+ }
30
+ if (key.ctrl && input === 'a') {
31
+ setCursor(0);
32
+ return;
33
+ }
34
+ if (key.ctrl && input === 'e') {
35
+ setCursor(value.length);
36
+ return;
37
+ }
38
+ // Gezinme/özel tuşlar bize ait değil → metne yazma, başka handler'lara bırak.
39
+ if (key.ctrl || key.meta || key.tab || key.escape || key.upArrow || key.downArrow || key.pageUp || key.pageDown)
40
+ return;
41
+ if (input) {
42
+ onChange(value.slice(0, cursor) + input + value.slice(cursor));
43
+ setCursor(cursor + input.length);
44
+ }
45
+ }, { isActive });
46
+ // Placeholder (boş input)
47
+ if (!value) {
48
+ return React.createElement(Text, { color: color, dimColor: true },
49
+ isActive ? React.createElement(Text, { inverse: true }, " ") : ' ',
50
+ placeholder || '');
51
+ }
52
+ // İmleçli metin: imleçteki karakter ters-renkli (blok imleç)
53
+ const before = value.slice(0, cursor);
54
+ const at = value.slice(cursor, cursor + 1) || ' ';
55
+ const after = value.slice(cursor + 1);
56
+ return (React.createElement(Text, { color: color },
57
+ before,
58
+ isActive ? React.createElement(Text, { inverse: true }, at) : at,
59
+ after));
60
+ }
package/dist/theme.js CHANGED
@@ -16,4 +16,4 @@ export const theme = {
16
16
  synType: '#a78bfa', // tip/sınıf adları, sabitler
17
17
  synProp: '#e0e0e0', // özellik/anahtar adları
18
18
  };
19
- export const VERSION = '1.0.84';
19
+ export const VERSION = '1.0.94';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wormclaude",
3
- "version": "1.0.92",
3
+ "version": "1.0.94",
4
4
  "description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "scripts": {
10
10
  "dev": "tsx src/cli.tsx",
11
- "build": "tsc && node scripts/copy-skills.mjs && node scripts/copy-extensions.mjs",
11
+ "build": "node scripts/sync-version.mjs && tsc && node scripts/copy-skills.mjs && node scripts/copy-extensions.mjs",
12
12
  "start": "node dist/cli.js",
13
13
  "prepublishOnly": "npm run build"
14
14
  },