rubber-ducky 1.4.0__tar.gz → 1.5.0__tar.gz
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.
- {rubber_ducky-1.4.0/rubber_ducky.egg-info → rubber_ducky-1.5.0}/PKG-INFO +1 -1
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/ducky/config.py +3 -3
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/ducky/ducky.py +29 -4
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/pyproject.toml +1 -1
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0/rubber_ducky.egg-info}/PKG-INFO +1 -1
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/LICENSE +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/MANIFEST.in +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/README.md +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/crumbs/disk-usage/disk-usage.sh +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/crumbs/disk-usage/info.txt +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/crumbs/git-log/git-log.sh +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/crumbs/git-log/info.txt +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/crumbs/git-status/git-status.sh +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/crumbs/git-status/info.txt +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/crumbs/process-list/info.txt +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/crumbs/process-list/process-list.sh +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/crumbs/recent-files/info.txt +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/crumbs/recent-files/recent-files.sh +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/crumbs/system-health/info.txt +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/crumbs/system-health/system-health.sh +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/ducky/__init__.py +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/examples/POLLING_USER_GUIDE.md +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/examples/mock-logs/info.txt +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/examples/mock-logs/mock-logs.sh +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/rubber_ducky.egg-info/SOURCES.txt +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/rubber_ducky.egg-info/dependency_links.txt +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/rubber_ducky.egg-info/entry_points.txt +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/rubber_ducky.egg-info/requires.txt +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/rubber_ducky.egg-info/top_level.txt +0 -0
- {rubber_ducky-1.4.0 → rubber_ducky-1.5.0}/setup.cfg +0 -0
|
@@ -17,7 +17,7 @@ class ConfigManager:
|
|
|
17
17
|
def load_config(self) -> Dict[str, Any]:
|
|
18
18
|
"""Load configuration from file, returning defaults if not found."""
|
|
19
19
|
default_config = {
|
|
20
|
-
"last_model": "
|
|
20
|
+
"last_model": "glm-4.7:cloud",
|
|
21
21
|
"last_host": "https://ollama.com"
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -45,12 +45,12 @@ class ConfigManager:
|
|
|
45
45
|
|
|
46
46
|
def get_last_model(self) -> tuple[str, str]:
|
|
47
47
|
"""Get the last used model and host.
|
|
48
|
-
|
|
48
|
+
|
|
49
49
|
Returns:
|
|
50
50
|
Tuple of (model_name, host)
|
|
51
51
|
"""
|
|
52
52
|
config = self.load_config()
|
|
53
|
-
return config.get("last_model", "
|
|
53
|
+
return config.get("last_model", "glm-4.7:cloud"), config.get("last_host", "https://ollama.com")
|
|
54
54
|
|
|
55
55
|
def save_last_model(self, model_name: str, host: str) -> None:
|
|
56
56
|
"""Save the last used model and host."""
|
|
@@ -6,6 +6,7 @@ import json
|
|
|
6
6
|
import os
|
|
7
7
|
import re
|
|
8
8
|
import shlex
|
|
9
|
+
import subprocess
|
|
9
10
|
import sys
|
|
10
11
|
import signal
|
|
11
12
|
from dataclasses import dataclass
|
|
@@ -363,7 +364,7 @@ class RubberDuck:
|
|
|
363
364
|
model=self.model,
|
|
364
365
|
messages=self.messages,
|
|
365
366
|
stream=False,
|
|
366
|
-
think=
|
|
367
|
+
think=False,
|
|
367
368
|
)
|
|
368
369
|
|
|
369
370
|
assistant_message: Any | None = response.message
|
|
@@ -703,8 +704,6 @@ class InlineInterface:
|
|
|
703
704
|
self._code_sent = True
|
|
704
705
|
self.last_command = result.command
|
|
705
706
|
self.pending_command = result.command
|
|
706
|
-
# Set last_shell_output to True so empty Enter will explain the result
|
|
707
|
-
self.last_shell_output = True
|
|
708
707
|
|
|
709
708
|
async def _explain_last_command(self) -> None:
|
|
710
709
|
if not self.assistant.messages or len(self.assistant.messages) < 2:
|
|
@@ -1056,6 +1055,16 @@ async def run_single_prompt(
|
|
|
1056
1055
|
return result
|
|
1057
1056
|
|
|
1058
1057
|
|
|
1058
|
+
def copy_to_clipboard(text: str) -> bool:
|
|
1059
|
+
"""Copy text to system clipboard using pbcopy on macOS."""
|
|
1060
|
+
try:
|
|
1061
|
+
process = subprocess.Popen(['pbcopy'], stdin=subprocess.PIPE)
|
|
1062
|
+
process.communicate(text.encode('utf-8'))
|
|
1063
|
+
return process.returncode == 0
|
|
1064
|
+
except Exception:
|
|
1065
|
+
return False
|
|
1066
|
+
|
|
1067
|
+
|
|
1059
1068
|
def confirm(prompt: str, default: bool = False) -> bool:
|
|
1060
1069
|
suffix = " [Y/n]: " if default else " [y/N]: "
|
|
1061
1070
|
try:
|
|
@@ -1275,7 +1284,13 @@ async def ducky() -> None:
|
|
|
1275
1284
|
help="Override crumb's polling prompt",
|
|
1276
1285
|
default=None,
|
|
1277
1286
|
)
|
|
1278
|
-
|
|
1287
|
+
parser.add_argument(
|
|
1288
|
+
"single_prompt",
|
|
1289
|
+
nargs="?",
|
|
1290
|
+
help="Run a single prompt and copy the suggested command to clipboard",
|
|
1291
|
+
default=None,
|
|
1292
|
+
)
|
|
1293
|
+
args = parser.parse_args()
|
|
1279
1294
|
|
|
1280
1295
|
ensure_history_dir()
|
|
1281
1296
|
logger = ConversationLogger(CONVERSATION_LOG_FILE)
|
|
@@ -1328,6 +1343,16 @@ async def ducky() -> None:
|
|
|
1328
1343
|
console.print("No input received from stdin.", style="yellow")
|
|
1329
1344
|
return
|
|
1330
1345
|
|
|
1346
|
+
# Handle single prompt mode
|
|
1347
|
+
if args.single_prompt:
|
|
1348
|
+
result = await run_single_prompt(
|
|
1349
|
+
rubber_ducky, args.single_prompt, code=code, logger=logger
|
|
1350
|
+
)
|
|
1351
|
+
if result.command:
|
|
1352
|
+
if copy_to_clipboard(result.command):
|
|
1353
|
+
console.print("\n[green]✓[/green] Command copied to clipboard")
|
|
1354
|
+
return
|
|
1355
|
+
|
|
1331
1356
|
# Handle polling mode
|
|
1332
1357
|
if args.poll:
|
|
1333
1358
|
crumb_name = args.poll
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|