agencode 0.1.0__py3-none-any.whl
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.
- agencli/__init__.py +5 -0
- agencli/__main__.py +9 -0
- agencli/agents/__init__.py +1 -0
- agencli/agents/editor.py +110 -0
- agencli/agents/factory.py +335 -0
- agencli/agents/management_tools.py +277 -0
- agencli/agents/prebuilt/__init__.py +1 -0
- agencli/agents/prebuilt/catalog.py +66 -0
- agencli/agents/registry.py +50 -0
- agencli/agents/runtime.py +266 -0
- agencli/agents/supervisor.py +67 -0
- agencli/cli.py +561 -0
- agencli/core/__init__.py +1 -0
- agencli/core/config.py +179 -0
- agencli/core/keystore.py +14 -0
- agencli/core/logger.py +17 -0
- agencli/core/paths.py +37 -0
- agencli/core/session.py +513 -0
- agencli/mcp/__init__.py +1 -0
- agencli/mcp/client.py +33 -0
- agencli/mcp/config.py +99 -0
- agencli/providers/__init__.py +1 -0
- agencli/providers/model.py +180 -0
- agencli/skills/__init__.py +37 -0
- agencli/skills/cli_backend.py +446 -0
- agencli/skills/loader.py +77 -0
- agencli/skills/manager.py +153 -0
- agencli/tools/__init__.py +1 -0
- agencli/tools/mcp.py +106 -0
- agencli/tui/__init__.py +1 -0
- agencli/tui/app.py +4274 -0
- agencli/tui/commands.py +86 -0
- agencli/tui/screens.py +939 -0
- agencli/tui/trace.py +334 -0
- agencli/tui/voice.py +77 -0
- agencode-0.1.0.dist-info/METADATA +44 -0
- agencode-0.1.0.dist-info/RECORD +39 -0
- agencode-0.1.0.dist-info/WHEEL +4 -0
- agencode-0.1.0.dist-info/entry_points.txt +3 -0
agencli/tui/commands.py
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@dataclass(slots=True)
|
|
7
|
+
class SlashCommand:
|
|
8
|
+
name: str
|
|
9
|
+
description: str
|
|
10
|
+
usage: str
|
|
11
|
+
aliases: tuple[str, ...] = ()
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def get_slash_commands() -> list[SlashCommand]:
|
|
15
|
+
return [
|
|
16
|
+
SlashCommand("agent", "Manage saved supervisor subagents and their active state.", "/agent", ("use",)),
|
|
17
|
+
SlashCommand("build", "Build the currently selected agent.", "/build"),
|
|
18
|
+
SlashCommand("new-thread", "Start a fresh thread for the selected agent.", "/new-thread", ("thread",)),
|
|
19
|
+
SlashCommand("history", "Open the inline persisted thread picker.", "/history", ("threads",)),
|
|
20
|
+
SlashCommand("resume", "Resume the latest or a chosen persisted thread.", "/resume [thread-id]", ("continue",)),
|
|
21
|
+
SlashCommand("reset", "Reset the current deepagent session back to a fresh default state.", "/reset", ("fresh",)),
|
|
22
|
+
SlashCommand("fork", "Fork the current thread into a new persisted thread.", "/fork"),
|
|
23
|
+
SlashCommand("compact", "Summarize the current conversation into a compact session note.", "/compact"),
|
|
24
|
+
SlashCommand("select-skill", "Attach one or more skills to only the current thread.", "/select-skill", ("thread-skills",)),
|
|
25
|
+
SlashCommand("mention", "Attach a file or folder as extra context for future prompts.", "/mention <path>", ("attach",)),
|
|
26
|
+
SlashCommand("diff", "Show the current git diff for the workspace.", "/diff"),
|
|
27
|
+
SlashCommand("init", "Create an AGENTS.md scaffold in the workspace root.", "/init"),
|
|
28
|
+
SlashCommand("personality", "Set shell response style such as concise or collaborative.", "/personality [concise|collaborative|direct]", ("style",)),
|
|
29
|
+
SlashCommand("permissions", "Set approval behavior such as auto, confirm, or read-only.", "/permissions [auto|confirm|read-only]", ("approval",)),
|
|
30
|
+
SlashCommand("plan", "Toggle plan mode before execution, or set it explicitly.", "/plan [on|off]", ("plan-mode",)),
|
|
31
|
+
SlashCommand("skills", "Browse, install, and update skills through the Skills CLI.", "/skills"),
|
|
32
|
+
SlashCommand("mcp", "Open the inline MCP server manager.", "/mcp"),
|
|
33
|
+
SlashCommand("bootstrap-mcp", "Seed the default MCP servers.", "/bootstrap-mcp"),
|
|
34
|
+
SlashCommand("model", "Open model/provider settings.", "/model", ("models",)),
|
|
35
|
+
SlashCommand("theme", "Switch between dark and light shell themes.", "/theme [dark|light]", ("appearance",)),
|
|
36
|
+
SlashCommand("voice", "Toggle voice-to-text and fill the prompt from your microphone.", "/voice", ("mic", "dictate")),
|
|
37
|
+
SlashCommand("status", "Show the current agent, thread, model, and provider status.", "/status"),
|
|
38
|
+
SlashCommand("cancel", "Dismiss the current waiting-for-input prompt.", "/cancel"),
|
|
39
|
+
SlashCommand("refresh", "Reload agent and runtime state.", "/refresh"),
|
|
40
|
+
SlashCommand("clear", "Clear the conversation and runtime panes.", "/clear"),
|
|
41
|
+
SlashCommand("help", "Show the available slash commands.", "/help", ("?",)),
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def match_slash_commands(query: str) -> list[SlashCommand]:
|
|
46
|
+
normalized = query.strip().lower().lstrip("/")
|
|
47
|
+
token, _, _ = normalized.partition(" ")
|
|
48
|
+
commands = get_slash_commands()
|
|
49
|
+
if not token:
|
|
50
|
+
return commands
|
|
51
|
+
|
|
52
|
+
exact_matches = [command for command in commands if token == command.name or token in command.aliases]
|
|
53
|
+
if exact_matches:
|
|
54
|
+
return exact_matches
|
|
55
|
+
|
|
56
|
+
prefix_matches = [
|
|
57
|
+
command
|
|
58
|
+
for command in commands
|
|
59
|
+
if command.name.startswith(token) or any(alias.startswith(token) for alias in command.aliases)
|
|
60
|
+
]
|
|
61
|
+
if prefix_matches:
|
|
62
|
+
return prefix_matches
|
|
63
|
+
|
|
64
|
+
filtered: list[SlashCommand] = []
|
|
65
|
+
for command in commands:
|
|
66
|
+
haystacks = [command.name, *command.aliases, command.description, command.usage]
|
|
67
|
+
if any(token in value.lower() for value in haystacks):
|
|
68
|
+
filtered.append(command)
|
|
69
|
+
return filtered
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def filter_slash_commands(query: str) -> list[SlashCommand]:
|
|
73
|
+
return match_slash_commands(query)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def resolve_slash_command(name: str) -> SlashCommand | None:
|
|
77
|
+
normalized = name.strip().lower().lstrip("/")
|
|
78
|
+
for command in get_slash_commands():
|
|
79
|
+
if normalized == command.name or normalized in command.aliases:
|
|
80
|
+
return command
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def best_slash_command_match(query: str) -> SlashCommand | None:
|
|
85
|
+
matches = match_slash_commands(query)
|
|
86
|
+
return matches[0] if matches else None
|