codeep 1.1.29 → 1.1.31

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.
@@ -14,6 +14,7 @@ export type KeyHandler = (event: KeyEvent) => void;
14
14
  export declare class Input {
15
15
  private handlers;
16
16
  private rl;
17
+ private dataHandler;
17
18
  /**
18
19
  * Start listening for input
19
20
  */
@@ -5,6 +5,7 @@
5
5
  export class Input {
6
6
  handlers = [];
7
7
  rl = null;
8
+ dataHandler = null;
8
9
  /**
9
10
  * Start listening for input
10
11
  */
@@ -19,15 +20,21 @@ export class Input {
19
20
  // \x1b[?1000h - enable basic mouse tracking
20
21
  // \x1b[?1006h - enable SGR extended mouse mode
21
22
  process.stdout.write('\x1b[?1000h\x1b[?1006h');
22
- process.stdin.on('data', (data) => {
23
+ this.dataHandler = (data) => {
23
24
  const event = this.parseKey(data);
24
25
  this.emit(event);
25
- });
26
+ };
27
+ process.stdin.on('data', this.dataHandler);
26
28
  }
27
29
  /**
28
30
  * Stop listening
29
31
  */
30
32
  stop() {
33
+ // Remove data listener
34
+ if (this.dataHandler) {
35
+ process.stdin.removeListener('data', this.dataHandler);
36
+ this.dataHandler = null;
37
+ }
31
38
  // Disable mouse tracking
32
39
  process.stdout.write('\x1b[?1006l\x1b[?1000l');
33
40
  if (process.stdin.isTTY) {
@@ -29,6 +29,10 @@ export declare class LoginScreen {
29
29
  * Render login screen
30
30
  */
31
31
  render(): void;
32
+ /**
33
+ * Paste from clipboard
34
+ */
35
+ private pasteFromClipboard;
32
36
  /**
33
37
  * Reset state
34
38
  */
@@ -5,6 +5,7 @@ import { LineEditor } from '../Input.js';
5
5
  import { fg, style } from '../ansi.js';
6
6
  import { createBox, centerBox } from './Box.js';
7
7
  import { spawn } from 'child_process';
8
+ import clipboardy from 'clipboardy';
8
9
  // Primary color: #f02a30 (Codeep red)
9
10
  const PRIMARY_COLOR = fg.rgb(240, 42, 48);
10
11
  const PRIMARY_BRIGHT = fg.rgb(255, 80, 85);
@@ -39,6 +40,17 @@ export class LoginScreen {
39
40
  openUrl(this.options.subscribeUrl);
40
41
  return true;
41
42
  }
43
+ // Ctrl+V paste from clipboard
44
+ if (event.ctrl && event.key === 'v') {
45
+ this.pasteFromClipboard();
46
+ return true;
47
+ }
48
+ // Paste detection (fast input)
49
+ if (event.isPaste && event.key.length > 1) {
50
+ this.editor.setValue(event.key.trim());
51
+ this.render();
52
+ return true;
53
+ }
42
54
  // Submit
43
55
  if (event.key === 'enter') {
44
56
  const value = this.editor.getValue().trim();
@@ -70,7 +82,7 @@ export class LoginScreen {
70
82
  this.screen.write(titleX, 1, title, PRIMARY_COLOR + style.bold);
71
83
  // Box dimensions
72
84
  const boxWidth = Math.min(60, width - 4);
73
- const boxHeight = 12;
85
+ const boxHeight = 14;
74
86
  const { x: boxX, y: boxY } = centerBox(width, height, boxWidth, boxHeight);
75
87
  // Draw box
76
88
  const boxLines = createBox({
@@ -120,17 +132,34 @@ export class LoginScreen {
120
132
  contentY++;
121
133
  }
122
134
  // Help text
123
- const helpParts = ['Ctrl+T: Toggle visibility'];
135
+ this.screen.write(contentX, contentY, 'Ctrl+V: Paste | Ctrl+T: Toggle visibility', fg.gray);
136
+ contentY++;
137
+ const helpParts2 = [];
124
138
  if (this.options.subscribeUrl) {
125
- helpParts.push('Ctrl+B: Get API key');
139
+ helpParts2.push('Ctrl+B: Get API key');
126
140
  }
127
- helpParts.push('Esc: Cancel');
128
- this.screen.write(contentX, contentY, helpParts.join(' | '), fg.gray);
141
+ helpParts2.push('Esc: Cancel');
142
+ this.screen.write(contentX, contentY, helpParts2.join(' | '), fg.gray);
129
143
  // Position cursor
130
144
  this.screen.setCursor(cursorX, boxY + 5);
131
145
  this.screen.showCursor(true);
132
146
  this.screen.fullRender();
133
147
  }
148
+ /**
149
+ * Paste from clipboard
150
+ */
151
+ async pasteFromClipboard() {
152
+ try {
153
+ const text = await clipboardy.read();
154
+ if (text) {
155
+ this.editor.setValue(text.trim());
156
+ this.render();
157
+ }
158
+ }
159
+ catch {
160
+ // Clipboard not available
161
+ }
162
+ }
134
163
  /**
135
164
  * Reset state
136
165
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.1.29",
3
+ "version": "1.1.31",
4
4
  "description": "AI-powered coding assistant built for the terminal. Multiple LLM providers, project-aware context, and a seamless development workflow.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",