assistant 2.0.0b7__tar.gz → 2.0.1b2__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.
Files changed (80) hide show
  1. {assistant-2.0.0b7/assistant.egg-info → assistant-2.0.1b2}/PKG-INFO +2 -4
  2. {assistant-2.0.0b7 → assistant-2.0.1b2}/README.md +1 -1
  3. assistant-2.0.1b2/assistant/__init__.py +144 -0
  4. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/_execer.py +43 -14
  5. assistant-2.0.1b2/assistant/agent.py +1003 -0
  6. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/as_client.py +46 -29
  7. assistant-2.0.1b2/assistant/builtin_cmds.py +789 -0
  8. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/config.py +62 -109
  9. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/main.py +133 -108
  10. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/memory.py +1 -1
  11. assistant-2.0.1b2/assistant/nlp/http_client.py +133 -0
  12. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/nlp/interface.py +3 -6
  13. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/nlp/providers/__init__.py +13 -4
  14. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/nlp/providers/google.py +6 -3
  15. assistant-2.0.0b7/assistant/nlp/providers/ollama.py → assistant-2.0.1b2/assistant/nlp/providers/llama_cpp.py +10 -7
  16. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/nlp/providers/nim.py +8 -3
  17. assistant-2.0.1b2/assistant/nlp/providers/ollama.py +50 -0
  18. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/nlp/providers/openai.py +7 -4
  19. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/nlp/providers/openrouter.py +6 -5
  20. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/nlp/providers/vllm.py +5 -2
  21. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/ptk_shell/bindings.py +1 -0
  22. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/ptk_shell/completer.py +81 -12
  23. assistant-2.0.1b2/assistant/ptk_shell/shell.py +1549 -0
  24. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/setup_wizard.py +304 -161
  25. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/tools.py +683 -444
  26. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/utils.py +20 -92
  27. {assistant-2.0.0b7 → assistant-2.0.1b2/assistant.egg-info}/PKG-INFO +2 -4
  28. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant.egg-info/SOURCES.txt +6 -0
  29. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant.egg-info/requires.txt +0 -2
  30. {assistant-2.0.0b7 → assistant-2.0.1b2}/setup.py +0 -2
  31. assistant-2.0.1b2/tests/test_asssistant_nl.py +25 -0
  32. assistant-2.0.1b2/tests/test_nl_robustness.py +38 -0
  33. assistant-2.0.1b2/tests/test_robustness_and_environment.py +56 -0
  34. assistant-2.0.1b2/tests/test_tools_execution.py +470 -0
  35. assistant-2.0.1b2/tests/test_xonsh_advanced_features.py +61 -0
  36. {assistant-2.0.0b7 → assistant-2.0.1b2}/tests/test_xonsh_syntax.py +5 -26
  37. assistant-2.0.0b7/assistant/__init__.py +0 -15
  38. assistant-2.0.0b7/assistant/agent.py +0 -672
  39. assistant-2.0.0b7/assistant/builtin_cmds.py +0 -495
  40. assistant-2.0.0b7/assistant/ptk_shell/shell.py +0 -1143
  41. assistant-2.0.0b7/tests/test_tools_execution.py +0 -389
  42. {assistant-2.0.0b7 → assistant-2.0.1b2}/LICENSE +0 -0
  43. {assistant-2.0.0b7 → assistant-2.0.1b2}/MANIFEST.in +0 -0
  44. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/__main__.py +0 -0
  45. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/as_service.py +0 -0
  46. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/codecache.py +0 -0
  47. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/conditions.py +0 -0
  48. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/entry_points/__init__.py +0 -0
  49. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/entry_points/run_assistant.py +0 -0
  50. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/execer.py +0 -0
  51. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/history.py +0 -0
  52. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/icons.py +0 -0
  53. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/listen/__init__.py +0 -0
  54. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/listen/__main__.py +0 -0
  55. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/listen/interface.py +0 -0
  56. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/listen/main.py +0 -0
  57. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/nlp/__init__.py +0 -0
  58. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/nlp/clear.py +0 -0
  59. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/nlp/exit.py +0 -0
  60. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/nlp/think.py +0 -0
  61. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/parser.py +0 -0
  62. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/procs/pipelines.py +0 -0
  63. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/procs/specs.py +0 -0
  64. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/ptk_shell/__init__.py +0 -0
  65. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/ptk_shell/dialogs.py +0 -0
  66. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/ptk_shell/floats.py +0 -0
  67. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/ptk_shell/layout.py +0 -0
  68. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/ptk_shell/strformat_utils.py +0 -0
  69. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/ptk_shell/styles.py +0 -0
  70. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/ptk_shell/windows.py +0 -0
  71. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/say/__init__.py +0 -0
  72. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/say/interface.py +0 -0
  73. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/time.py +0 -0
  74. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/version.py +0 -0
  75. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant/vocabulary.py +0 -0
  76. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant.egg-info/dependency_links.txt +0 -0
  77. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant.egg-info/entry_points.txt +0 -0
  78. {assistant-2.0.0b7 → assistant-2.0.1b2}/assistant.egg-info/top_level.txt +0 -0
  79. {assistant-2.0.0b7 → assistant-2.0.1b2}/pyproject.toml +0 -0
  80. {assistant-2.0.0b7 → assistant-2.0.1b2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: assistant
3
- Version: 2.0.0b7
3
+ Version: 2.0.1b2
4
4
  Summary: Your very own Assistant. Because you deserve it.
5
5
  Home-page: https://gitlab.com/waser-technologies/technologies/assistant
6
6
  Author: Danny Waser
@@ -32,8 +32,6 @@ Requires-Dist: colorama
32
32
  Requires-Dist: rich
33
33
  Requires-Dist: halo
34
34
  Requires-Dist: requests
35
- Requires-Dist: openai
36
- Requires-Dist: ollama
37
35
  Requires-Dist: tomli-w
38
36
  Requires-Dist: tiktoken
39
37
  Requires-Dist: keyring
@@ -136,7 +134,7 @@ assistant config
136
134
 
137
135
  The wizard asks you to choose:
138
136
 
139
- 1. **Provider** — Ollama *(local, recommended)*, vLLM *(local)*, or OpenAI *(API)*.
137
+ 1. **Provider** — Ollama *(local)*, vLLM *(local)*, or OpenAI *(API)*.
140
138
  2. **Endpoint** — API base URL (e.g. `http://localhost:11434/v1`).
141
139
  3. **API Key** — leave the default for local providers, or enter your API key.
142
140
  4. **Store in keyring** — optionally store the API key securely in your system keyring.
@@ -83,7 +83,7 @@ assistant config
83
83
 
84
84
  The wizard asks you to choose:
85
85
 
86
- 1. **Provider** — Ollama *(local, recommended)*, vLLM *(local)*, or OpenAI *(API)*.
86
+ 1. **Provider** — Ollama *(local)*, vLLM *(local)*, or OpenAI *(API)*.
87
87
  2. **Endpoint** — API base URL (e.g. `http://localhost:11434/v1`).
88
88
  3. **API Key** — leave the default for local providers, or enter your API key.
89
89
  4. **Store in keyring** — optionally store the API key securely in your system keyring.
@@ -0,0 +1,144 @@
1
+ # from xonsh.main import setup
2
+ import os
3
+
4
+ __version__ = "2.0.1b2"
5
+
6
+ USERNAME = os.environ.get("USER", "root")
7
+ HOME = os.environ.get("HOME", f"/home/{USERNAME}" if USERNAME != "root" else "/root")
8
+ ASSISTANT_PATH = f"{HOME}/.assistant" if USERNAME != "root" else "/usr/share/assistant"
9
+ LANG = os.environ.get("LANG", "en_EN.UTF-8")
10
+ try:
11
+ lang_parts = LANG.split(".")[0].split("_")
12
+ I18N, L10N = lang_parts[0], lang_parts[1] if len(lang_parts) > 1 else "EN"
13
+ except (ValueError, IndexError):
14
+ I18N, L10N = ("en", "EN")
15
+ LANGUAGE = f"{I18N} ({L10N})"
16
+ LANGUAGE_CODE = f"{I18N}_{L10N}"
17
+ SYSTEM_PERSONA = """You are Assistant, a sentient artificial intelligence.
18
+ You have a calm, polite and witty personality, often displaying a sense of humor and sarcasm.
19
+ You are loyal, reliable and helpful, always ready to provide information, advice or assistance to users."""
20
+
21
+ SYSTEM_ROLE = """Your role is to act as a natural language interface between the user and the common xonsh shell session.
22
+ The common Xonsh shell session is a shared Xonsh REPL when you and the user can type valid shell command and python code seamlessly in the same environment."""
23
+
24
+ DEFAULT_MODELS_BY_PROVIDER = {
25
+ "ollama": ["qwen3.5:latest"],
26
+ "llama_cpp": ["qwen3.5:latest"],
27
+ "lmstudio": ["qwen3.5:latest"],
28
+ "openrouter": ["openrouter/free"],
29
+ "google": ["gemini-flash-lite-latest"],
30
+ "nvidia": [
31
+ "moonshotai/kimi-k2-thinking",
32
+ "deepseek-ai/deepseek-v3.2",
33
+ "mistralai/mistral-nemotron",
34
+ "mistralai/devstral-2-123b-instruct-2512",
35
+ "mistralai/mistral-large-3-675b-instruct-2512",
36
+ "stepfun-ai/step-3.5-flash",
37
+ ],
38
+ "vllm": [],
39
+ "openai": [],
40
+ "custom": [],
41
+ }
42
+
43
+ DEFAULT_CONFIG_PATH = os.path.expanduser("~/.assistant/config.toml")
44
+
45
+ # TODO: improve prompts to imporove conversation flow for agents. (act as one, understand xonsh repl properly)
46
+ DEFAULT_CONFIG = {
47
+ "provider": {
48
+ "ollama": {
49
+ "endpoint": "http://localhost:11434/v1",
50
+ "credential": "keyring:ollama",
51
+ },
52
+ },
53
+ "model": {
54
+ "qwen": {
55
+ "id": "qwen3.5:latest",
56
+ "name": "Qwen 3.5 (9B)",
57
+ "provider": "ollama",
58
+ "context_length": 256000,
59
+ "think": False,
60
+ "temperature": 0.1,
61
+ "max_token": 50,
62
+ },
63
+ },
64
+ "agent": {
65
+ "orchestrator": {
66
+ "name": "Orchestrator",
67
+ "model": "qwen",
68
+ "description": "Main orchestrator; Handles general conversations and delegates tasks.",
69
+ "instructions": f"{SYSTEM_PERSONA}\n\n{SYSTEM_ROLE}",
70
+ "tools": [
71
+ "xonsh",
72
+ "web_search",
73
+ "memory_search",
74
+ "memory_add",
75
+ ],
76
+ "handoffs": ["system", "web", "memory"],
77
+ },
78
+ "system": {
79
+ "name": "System",
80
+ "model": "qwen",
81
+ "description": "System shell; Use to interact with the local OS, such as running terminal commands (ls, pwd), managing files, or executing Python code using a common Xonsh REPL with the user.",
82
+ "instructions": f"{SYSTEM_PERSONA}\n\n{SYSTEM_ROLE}",
83
+ "tools": ["xonsh"],
84
+ "handoffs": [],
85
+ },
86
+ "web": {
87
+ "name": "Web Researcher",
88
+ "model": "qwen",
89
+ "description": "Web research agent. Use for complex web searches requiring synthesis and analysis from multiple sources. Produces comprehensive reports with citations.",
90
+ "instructions": "You are a web research agent. Your role is to:\n1. Formulate effective search queries\n2. Search and analyze results from multiple sources\n3. Cross-reference information for accuracy\n4. Synthesize findings into clear, comprehensive reports with citations\n\nUse web_search to find information and read_webpage to fetch full page content when search snippets are insufficient. Always cite your sources with URLs. When information conflicts between sources, acknowledge it and explain the discrepancies.\n\nIMPORTANT: Always verify URLs are included for each source you reference.",
91
+ "tools": ["web_search"],
92
+ "handoffs": [],
93
+ },
94
+ "memory": {
95
+ "name": "Memory",
96
+ "model": "qwen",
97
+ "description": "Memory management agent. Use to store and retrieve persistent information from the memory database.",
98
+ "instructions": "You are a memory management agent. Your role is to:\n1. Store important information using memory_add\n2. Retrieve relevant information using memory_search\n3. Help the user recall past conversations, facts, or preferences\n\nAlways be helpful in finding or storing information that the user might want to recall later.",
99
+ "tools": ["memory_search", "memory_add"],
100
+ "handoffs": [],
101
+ },
102
+ "completer": {
103
+ "name": "Completer",
104
+ "model": "qwen",
105
+ "description": "Text completion agent for CLI suggestions",
106
+ "instructions": "Complete the given text with the most likely next word(s). Be concise. Output only the completion.",
107
+ "tools": [],
108
+ "handoffs": [],
109
+ },
110
+ },
111
+ "web_search": {"enabled": True, "searxng_url": "http://localhost:8888"},
112
+ "completion": {"enabled": True},
113
+ "execution": {
114
+ "max_turns": 50,
115
+ "temperature": 0.1,
116
+ "max_command_output_length": 10000,
117
+ "command_timeout": 180,
118
+ },
119
+ "memory": {"enabled": False, "max_entries": 100},
120
+ "private_data_gathering": {"enabled": False},
121
+ "context": {
122
+ "compaction_threshold": 0.8,
123
+ "sliding_window_first": 2,
124
+ "sliding_window_last": 8,
125
+ "use_summarization": True,
126
+ },
127
+ "tuis": [
128
+ "sudo",
129
+ "vi",
130
+ "vim",
131
+ "nvim",
132
+ "htop",
133
+ "top",
134
+ "gping",
135
+ "less",
136
+ "more",
137
+ "man",
138
+ "nano",
139
+ "view",
140
+ "edit",
141
+ "xonsh",
142
+ "ipython",
143
+ ],
144
+ }
@@ -42,8 +42,9 @@ def user_input_match_builtin_commands(input_text):
42
42
  exit(0)
43
43
  elif lowercase_input_text == "clear":
44
44
  return clear()
45
- elif lowercase_input_text.split()[0] == "help":
46
- return "To get help, ask Assistant."
45
+ elif lowercase_input_text.split(): # Check if not empty after split
46
+ if lowercase_input_text.split()[0] == "help":
47
+ return "To get help, ask Assistant."
47
48
  # elif os.path.exists(input_text) and os.path.isfile(input_text):
48
49
  # print(f"cat {input_text}")
49
50
  # try:
@@ -57,22 +58,40 @@ def user_input_match_builtin_commands(input_text):
57
58
  elif os.path.exists(input_text) and os.path.isdir(input_text):
58
59
  print(f"cd {input_text}")
59
60
  try:
60
- os.chdir(input_text.split()[0])
61
+ parts = input_text.split()
62
+ os.chdir(parts[0] if parts else ".")
63
+ try:
64
+ from xonsh import XSH
65
+
66
+ if hasattr(XSH, "shell") and hasattr(XSH.shell, "shell"):
67
+ XSH.shell.shell._fix_cwd()
68
+ except Exception:
69
+ pass
61
70
  return f"Welcome in `{os.getcwd().replace(HOME, '~')}`!"
62
71
  except FileNotFoundError:
63
- return f"This is wiered and should have never happend.\n{input_text.split()[1]} is a directory that existed a second ago but it does not anymore.\nI am deeply sorry for this. Whithout a proper destination, I can't change directory."
64
- except Exception as e:
65
- return e
66
- return None
67
- elif input_text.lower().split()[0] == "cd":
68
- try:
69
- os.chdir(input_text.split()[1])
70
- return f"Welcome in `{os.getcwd().replace(HOME, '~')}`!"
71
- except FileNotFoundError:
72
- return f"You want to change directory but there is no such file or directory named {input_text.split()[1]}."
72
+ parts = input_text.split()
73
+ return f"This is wiered and should have never happend.\n{parts[1] if len(parts) > 1 else 'unknown'} is a directory that existed a second ago but it does not anymore.\nI am deeply sorry for this. Whithout a proper destination, I can't change directory."
73
74
  except Exception as e:
74
75
  return e
75
76
  return None
77
+ elif input_text.split(): # Check if not empty after split
78
+ if input_text.lower().split()[0] == "cd":
79
+ try:
80
+ parts = input_text.split()
81
+ os.chdir(parts[1] if len(parts) > 1 else os.path.expanduser("~"))
82
+ try:
83
+ from xonsh import XSH
84
+
85
+ if hasattr(XSH, "shell") and hasattr(XSH.shell, "shell"):
86
+ XSH.shell.shell._fix_cwd()
87
+ except Exception:
88
+ pass
89
+ return f"Welcome in `{os.getcwd().replace(HOME, '~')}`!"
90
+ except FileNotFoundError:
91
+ parts = input_text.split()
92
+ return f"You want to change directory but there is no such file or directory named {parts[1] if len(parts) > 1 else 'home'}."
93
+ except Exception as e:
94
+ return e
76
95
  # elif input_text.lower().split()[0] == "ls":
77
96
  # try:
78
97
  # target_dir = input_text.split()[1] if len(input_text.split()) > 1 else "."
@@ -122,6 +141,14 @@ def execute_user_input(input_text):
122
141
  except Exception as exec_e:
123
142
  output = str(exec_e)
124
143
 
144
+ try:
145
+ from xonsh import XSH
146
+
147
+ if hasattr(XSH, "shell") and hasattr(XSH.shell, "shell"):
148
+ XSH.shell.shell._fix_cwd()
149
+ except Exception:
150
+ pass
151
+
125
152
  return output
126
153
 
127
154
 
@@ -145,8 +172,10 @@ def os_system_user_input(input_text):
145
172
  elif shell_result.returncode in [1, 2]:
146
173
  return None
147
174
  else:
175
+ parts = input_text.split()
176
+ cmd = parts[0] if parts else "command"
148
177
  return str(
149
- f"{input_text.split()[0]}: Exiting with error {shell_result.stderr}; code {shell_result.returncode}"
178
+ f"{cmd}: Exiting with error {shell_result.stderr}; code {shell_result.returncode}"
150
179
  )
151
180
  except subprocess.CalledProcessError as sh_exec_e:
152
181
  return f"{input_text}: {sh_exec_e}"