codeep 1.0.11 → 1.0.13

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.
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState, useMemo, useEffect } from 'react';
3
3
  import { Text, Box, useInput } from 'ink';
4
4
  import TextInput from 'ink-text-input';
5
+ import clipboard from 'clipboardy';
5
6
  const COMMANDS = [
6
7
  { cmd: '/help', desc: 'Show help' },
7
8
  { cmd: '/status', desc: 'Show status' },
@@ -29,12 +30,14 @@ const COMMANDS = [
29
30
  ];
30
31
  export const ChatInput = ({ onSubmit, disabled, history = [], clearTrigger = 0 }) => {
31
32
  const [value, setValue] = useState('');
33
+ const [displayValue, setDisplayValue] = useState('');
32
34
  const [selectedIndex, setSelectedIndex] = useState(0);
33
35
  const [isSelectingCommand, setIsSelectingCommand] = useState(false);
34
36
  // Clear input when clearTrigger changes
35
37
  useEffect(() => {
36
38
  if (clearTrigger > 0) {
37
39
  setValue('');
40
+ setDisplayValue('');
38
41
  setSelectedIndex(0);
39
42
  setIsSelectingCommand(false);
40
43
  }
@@ -55,9 +58,33 @@ export const ChatInput = ({ onSubmit, disabled, history = [], clearTrigger = 0 }
55
58
  setIsSelectingCommand(false);
56
59
  }
57
60
  }, [suggestions.length]);
58
- // Handle keyboard navigation for command suggestions
59
- useInput((input, key) => {
60
- if (disabled || suggestions.length === 0)
61
+ // Handle keyboard navigation for command suggestions and paste
62
+ useInput(async (input, key) => {
63
+ if (disabled)
64
+ return;
65
+ // Handle paste (Ctrl+V) - read from clipboard and insert
66
+ if (key.ctrl && input === 'v') {
67
+ try {
68
+ const clipboardText = await clipboard.read();
69
+ // Replace newlines with spaces to prevent multi-line issues
70
+ const sanitized = clipboardText.replace(/\r?\n/g, ' ').trim();
71
+ // Store full text in value (for submission)
72
+ setValue(prev => prev + sanitized);
73
+ // If text is longer than 100 chars, show "pasted -X" in display
74
+ if (sanitized.length > 100) {
75
+ const hiddenChars = sanitized.length - 100;
76
+ setDisplayValue(prev => prev + sanitized.substring(0, 100) + ` [pasted -${hiddenChars}]`);
77
+ }
78
+ else {
79
+ setDisplayValue(prev => prev + sanitized);
80
+ }
81
+ }
82
+ catch (error) {
83
+ // Clipboard read failed, ignore
84
+ }
85
+ return;
86
+ }
87
+ if (suggestions.length === 0)
61
88
  return;
62
89
  // Navigate suggestions with up/down arrows
63
90
  if (key.upArrow) {
@@ -74,16 +101,18 @@ export const ChatInput = ({ onSubmit, disabled, history = [], clearTrigger = 0 }
74
101
  setIsSelectingCommand(false);
75
102
  return;
76
103
  }
77
- }, { isActive: isSelectingCommand });
104
+ }, { isActive: !disabled });
78
105
  const handleChange = (newValue) => {
79
106
  setValue(newValue);
107
+ setDisplayValue(newValue);
80
108
  };
81
- const handleSubmit = (text) => {
82
- if (text.trim() && !disabled) {
83
- onSubmit(text.trim());
109
+ const handleSubmit = () => {
110
+ if (value.trim() && !disabled) {
111
+ onSubmit(value.trim());
84
112
  setValue('');
113
+ setDisplayValue('');
85
114
  setIsSelectingCommand(false);
86
115
  }
87
116
  };
88
- return (_jsxs(Box, { flexDirection: "column", children: [suggestions.length > 0 && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [suggestions.map((s, i) => (_jsxs(Text, { children: [i === selectedIndex ? _jsx(Text, { color: "#f02a30", children: "\u25B8 " }) : ' ', _jsx(Text, { color: i === selectedIndex ? '#f02a30' : undefined, bold: i === selectedIndex, children: s.cmd }), _jsxs(Text, { color: i === selectedIndex ? undefined : 'gray', children: [" - ", s.desc] })] }, s.cmd))), _jsxs(Text, { color: "gray", children: ["\u2191\u2193 Navigate \u2022 Tab Complete \u2022 ", suggestions.length, " ", suggestions.length === 1 ? 'command' : 'commands'] })] })), _jsxs(Box, { children: [_jsx(Text, { color: "#f02a30", bold: true, children: '> ' }), disabled ? (_jsx(Text, { children: "..." })) : (_jsx(TextInput, { value: value, onChange: handleChange, onSubmit: handleSubmit, placeholder: "Type a message or /command..." }))] })] }));
117
+ return (_jsxs(Box, { flexDirection: "column", children: [suggestions.length > 0 && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [suggestions.map((s, i) => (_jsxs(Text, { children: [i === selectedIndex ? _jsx(Text, { color: "#f02a30", children: "\u25B8 " }) : ' ', _jsx(Text, { color: i === selectedIndex ? '#f02a30' : undefined, bold: i === selectedIndex, children: s.cmd }), _jsxs(Text, { color: i === selectedIndex ? undefined : 'gray', children: [" - ", s.desc] })] }, s.cmd))), _jsxs(Text, { color: "gray", children: ["\u2191\u2193 Navigate \u2022 Tab Complete \u2022 ", suggestions.length, " ", suggestions.length === 1 ? 'command' : 'commands'] })] })), _jsxs(Box, { children: [_jsx(Text, { color: "#f02a30", bold: true, children: '> ' }), disabled ? (_jsx(Text, { children: "..." })) : (_jsx(TextInput, { value: displayValue || value, onChange: handleChange, onSubmit: handleSubmit, placeholder: "Type a message or /command..." }))] })] }));
89
118
  };
@@ -11,7 +11,7 @@ import { planTasks, getNextTask, formatTaskPlan } from './taskPlanner.js';
11
11
  const DEFAULT_OPTIONS = {
12
12
  maxIterations: 100, // Increased for large tasks
13
13
  maxDuration: 20 * 60 * 1000, // 20 minutes
14
- usePlanning: true, // Enable task planning by default
14
+ usePlanning: false, // Disable task planning - causes more problems than it solves
15
15
  };
16
16
  /**
17
17
  * Generate system prompt for agent mode (used with native tool calling)
@@ -509,7 +509,7 @@ export async function runAgent(prompt, projectContext, options = {}) {
509
509
  messages.push({ role: 'assistant', content: finalResponse });
510
510
  messages.push({
511
511
  role: 'user',
512
- content: `Excellent! Task ${prevTask?.id} is complete.\n\nProgress so far:\n${progressSummary}\n\nNow continue with:\n${nextTask.id}. ${nextTask.description}\n\nOriginal request: ${taskPlan.originalPrompt}`
512
+ content: `Good! Task ${prevTask?.id} done.\n\nCompleted:\n${progressSummary}\n\nNEXT TASK (do it now):\n${nextTask.id}. ${nextTask.description}\n\nUse your tools immediately to complete this task. Do NOT ask for permission or confirmation.`
513
513
  });
514
514
  finalResponse = ''; // Reset for next task
515
515
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
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",