codeep 1.1.28 → 1.1.30

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.
@@ -6,6 +6,7 @@ import { Screen } from './Screen.js';
6
6
  import { Input, LineEditor } from './Input.js';
7
7
  import { fg, style, stringWidth } from './ansi.js';
8
8
  import clipboardy from 'clipboardy';
9
+ import { spawn } from 'child_process';
9
10
  // Primary color: #f02a30 (Codeep red)
10
11
  const PRIMARY_COLOR = fg.rgb(240, 42, 48);
11
12
  // Syntax highlighting colors (One Dark theme inspired)
@@ -1295,7 +1296,6 @@ export class App {
1295
1296
  const cmd = process.platform === 'darwin' ? 'open'
1296
1297
  : process.platform === 'win32' ? 'start'
1297
1298
  : 'xdg-open';
1298
- const { spawn } = require('child_process');
1299
1299
  const child = spawn(cmd, [provider.subscribeUrl], { detached: true, stdio: 'ignore' });
1300
1300
  child.unref();
1301
1301
  }
@@ -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.28",
3
+ "version": "1.1.30",
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",