deepy-cli 0.2.8__tar.gz → 0.2.9__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.
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/PKG-INFO +1 -1
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/pyproject.toml +1 -1
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/__init__.py +1 -1
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/terminal.py +87 -1
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/README.md +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/__main__.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/cli.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/config/__init__.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/config/settings.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/data/__init__.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/data/skills/skill-creator/SKILL.md +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/data/skills/skill-installer/SKILL.md +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/data/tools/AskUserQuestion.md +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/data/tools/WebFetch.md +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/data/tools/WebSearch.md +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/data/tools/__init__.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/data/tools/edit.md +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/data/tools/modify.md +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/data/tools/read.md +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/data/tools/shell.md +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/data/tools/todo_write.md +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/data/tools/write.md +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/errors.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/input_suggestions.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/llm/__init__.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/llm/agent.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/llm/compaction.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/llm/context.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/llm/events.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/llm/model_capabilities.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/llm/provider.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/llm/replay.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/llm/runner.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/llm/thinking.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/mcp.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/prompts/__init__.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/prompts/compact.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/prompts/init_agents.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/prompts/rules.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/prompts/runtime_context.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/prompts/system.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/prompts/tool_docs.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/sessions/__init__.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/sessions/jsonl.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/sessions/manager.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/skill_market.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/skills.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/status.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/todos.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/tools/__init__.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/tools/agents.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/tools/builtin.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/tools/file_state.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/tools/result.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/tools/shell_output.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/tools/shell_utils.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/tui/__init__.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/tui/app.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/tui/commands.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/tui/compat.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/tui/diff.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/tui/runner.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/tui/screens.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/tui/state.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/tui/widgets.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/types/__init__.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/types/sdk.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/types/tool_payloads.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/__init__.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/app.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/ask_user_question.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/exit_summary.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/file_mentions.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/loading_text.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/local_command.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/markdown.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/message_view.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/model_picker.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/prompt_buffer.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/prompt_input.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/session_list.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/session_picker.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/skill_picker.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/slash_commands.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/status_footer.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/styles.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/theme_picker.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/thinking_state.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/ui/welcome.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/update_check.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/usage.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/utils/__init__.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/utils/debug_logger.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/utils/error_logger.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/utils/json.py +0 -0
- {deepy_cli-0.2.8 → deepy_cli-0.2.9}/src/deepy/utils/notify.py +0 -0
|
@@ -2,6 +2,8 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import asyncio
|
|
4
4
|
import contextlib
|
|
5
|
+
import ctypes
|
|
6
|
+
from ctypes import wintypes
|
|
5
7
|
import os
|
|
6
8
|
import re
|
|
7
9
|
import select
|
|
@@ -2379,7 +2381,9 @@ def _submitted_prompt_needs_status_anchor(console: Console, text: str) -> bool:
|
|
|
2379
2381
|
return False
|
|
2380
2382
|
rows = shutil.get_terminal_size((80, 24)).lines
|
|
2381
2383
|
cursor_row = _terminal_cursor_row(console)
|
|
2382
|
-
|
|
2384
|
+
if cursor_row is not None:
|
|
2385
|
+
return cursor_row >= rows
|
|
2386
|
+
return _should_fallback_anchor_submitted_prompt(console, text)
|
|
2383
2387
|
|
|
2384
2388
|
|
|
2385
2389
|
def _clear_submitted_prompt_echo(console: Console, text: str) -> None:
|
|
@@ -2405,6 +2409,12 @@ def _terminal_columns(console: Console) -> int:
|
|
|
2405
2409
|
|
|
2406
2410
|
|
|
2407
2411
|
def _terminal_cursor_row(console: Console, *, timeout: float = 0.03) -> int | None:
|
|
2412
|
+
if os.name == "nt":
|
|
2413
|
+
return _windows_terminal_cursor_row()
|
|
2414
|
+
return _posix_terminal_cursor_row(console, timeout=timeout)
|
|
2415
|
+
|
|
2416
|
+
|
|
2417
|
+
def _posix_terminal_cursor_row(console: Console, *, timeout: float = 0.03) -> int | None:
|
|
2408
2418
|
if termios is None or tty is None or not Path("/dev/tty").exists():
|
|
2409
2419
|
return None
|
|
2410
2420
|
file = getattr(console, "file", None)
|
|
@@ -2450,6 +2460,56 @@ def _terminal_cursor_row(console: Console, *, timeout: float = 0.03) -> int | No
|
|
|
2450
2460
|
return None
|
|
2451
2461
|
|
|
2452
2462
|
|
|
2463
|
+
def _windows_terminal_cursor_row() -> int | None:
|
|
2464
|
+
try:
|
|
2465
|
+
windll = getattr(ctypes, "windll")
|
|
2466
|
+
kernel32 = windll.kernel32
|
|
2467
|
+
with contextlib.suppress(Exception):
|
|
2468
|
+
kernel32.GetStdHandle.argtypes = [wintypes.DWORD]
|
|
2469
|
+
kernel32.GetStdHandle.restype = wintypes.HANDLE
|
|
2470
|
+
kernel32.GetConsoleScreenBufferInfo.argtypes = [
|
|
2471
|
+
wintypes.HANDLE,
|
|
2472
|
+
ctypes.POINTER(_WindowsConsoleScreenBufferInfo),
|
|
2473
|
+
]
|
|
2474
|
+
kernel32.GetConsoleScreenBufferInfo.restype = wintypes.BOOL
|
|
2475
|
+
handle = kernel32.GetStdHandle(_STD_OUTPUT_HANDLE)
|
|
2476
|
+
if handle in {None, 0, _INVALID_HANDLE_VALUE}:
|
|
2477
|
+
return None
|
|
2478
|
+
info = _WindowsConsoleScreenBufferInfo()
|
|
2479
|
+
if not kernel32.GetConsoleScreenBufferInfo(handle, ctypes.byref(info)):
|
|
2480
|
+
return None
|
|
2481
|
+
return _visible_cursor_row_from_windows_buffer(
|
|
2482
|
+
cursor_y=int(info.dwCursorPosition.Y),
|
|
2483
|
+
window_top=int(info.srWindow.Top),
|
|
2484
|
+
window_bottom=int(info.srWindow.Bottom),
|
|
2485
|
+
)
|
|
2486
|
+
except Exception:
|
|
2487
|
+
return None
|
|
2488
|
+
|
|
2489
|
+
|
|
2490
|
+
def _visible_cursor_row_from_windows_buffer(
|
|
2491
|
+
*,
|
|
2492
|
+
cursor_y: int,
|
|
2493
|
+
window_top: int,
|
|
2494
|
+
window_bottom: int,
|
|
2495
|
+
) -> int | None:
|
|
2496
|
+
if window_top > window_bottom:
|
|
2497
|
+
return None
|
|
2498
|
+
if cursor_y < window_top or cursor_y > window_bottom:
|
|
2499
|
+
return None
|
|
2500
|
+
return cursor_y - window_top + 1
|
|
2501
|
+
|
|
2502
|
+
|
|
2503
|
+
def _should_fallback_anchor_submitted_prompt(console: Console, text: str) -> bool:
|
|
2504
|
+
if os.name != "nt":
|
|
2505
|
+
return False
|
|
2506
|
+
return _submitted_prompt_echo_rows(text, _terminal_columns(console)) > 1
|
|
2507
|
+
|
|
2508
|
+
|
|
2509
|
+
_STD_OUTPUT_HANDLE = ctypes.c_ulong(-11).value
|
|
2510
|
+
_INVALID_HANDLE_VALUE = ctypes.c_void_p(-1).value
|
|
2511
|
+
|
|
2512
|
+
|
|
2453
2513
|
def _cursor_row_from_terminal_response(data: bytes) -> int | None:
|
|
2454
2514
|
match = re.search(rb"\x1b\[(\d+);\d+R", data)
|
|
2455
2515
|
if match is None:
|
|
@@ -2465,6 +2525,32 @@ def _submitted_prompt_echo_rows(text: str, columns: int) -> int:
|
|
|
2465
2525
|
)
|
|
2466
2526
|
|
|
2467
2527
|
|
|
2528
|
+
class _WindowsCoord(ctypes.Structure):
|
|
2529
|
+
_fields_ = [
|
|
2530
|
+
("X", ctypes.c_short),
|
|
2531
|
+
("Y", ctypes.c_short),
|
|
2532
|
+
]
|
|
2533
|
+
|
|
2534
|
+
|
|
2535
|
+
class _WindowsSmallRect(ctypes.Structure):
|
|
2536
|
+
_fields_ = [
|
|
2537
|
+
("Left", ctypes.c_short),
|
|
2538
|
+
("Top", ctypes.c_short),
|
|
2539
|
+
("Right", ctypes.c_short),
|
|
2540
|
+
("Bottom", ctypes.c_short),
|
|
2541
|
+
]
|
|
2542
|
+
|
|
2543
|
+
|
|
2544
|
+
class _WindowsConsoleScreenBufferInfo(ctypes.Structure):
|
|
2545
|
+
_fields_ = [
|
|
2546
|
+
("dwSize", _WindowsCoord),
|
|
2547
|
+
("dwCursorPosition", _WindowsCoord),
|
|
2548
|
+
("wAttributes", ctypes.c_ushort),
|
|
2549
|
+
("srWindow", _WindowsSmallRect),
|
|
2550
|
+
("dwMaximumWindowSize", _WindowsCoord),
|
|
2551
|
+
]
|
|
2552
|
+
|
|
2553
|
+
|
|
2468
2554
|
def _print_user_input(console: Console, text: str, *, palette: UiPalette | None = None) -> None:
|
|
2469
2555
|
palette = palette or DARK_PALETTE
|
|
2470
2556
|
if not text.strip():
|
|
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
|
|
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
|
|
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
|
|
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
|