local-operator 0.2.2__tar.gz → 0.2.3__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.
Potentially problematic release.
This version of local-operator might be problematic. Click here for more details.
- {local_operator-0.2.2 → local_operator-0.2.3}/PKG-INFO +1 -1
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator/cli.py +4 -11
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator/operator.py +23 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator.egg-info/PKG-INFO +1 -1
- {local_operator-0.2.2 → local_operator-0.2.3}/pyproject.toml +1 -1
- {local_operator-0.2.2 → local_operator-0.2.3}/LICENSE +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/README.md +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator/__init__.py +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator/agents.py +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator/config.py +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator/console.py +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator/credentials.py +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator/executor.py +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator/mocks.py +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator/model.py +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator/prompts.py +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator/server.py +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator/tools.py +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator/types.py +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator.egg-info/SOURCES.txt +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator.egg-info/dependency_links.txt +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator.egg-info/entry_points.txt +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator.egg-info/requires.txt +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/local_operator.egg-info/top_level.txt +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/setup.cfg +0 -0
- {local_operator-0.2.2 → local_operator-0.2.3}/setup.py +0 -0
|
@@ -29,12 +29,7 @@ from local_operator.config import ConfigManager
|
|
|
29
29
|
from local_operator.credentials import CredentialManager
|
|
30
30
|
from local_operator.executor import LocalCodeExecutor
|
|
31
31
|
from local_operator.model import configure_model
|
|
32
|
-
from local_operator.operator import
|
|
33
|
-
ConversationRole,
|
|
34
|
-
Operator,
|
|
35
|
-
OperatorType,
|
|
36
|
-
create_system_prompt,
|
|
37
|
-
)
|
|
32
|
+
from local_operator.operator import Operator, OperatorType
|
|
38
33
|
|
|
39
34
|
CLI_DESCRIPTION = """
|
|
40
35
|
Local Operator - An environment for agentic AI models to perform tasks on the local device.
|
|
@@ -63,10 +58,12 @@ def build_cli_parser() -> argparse.ArgumentParser:
|
|
|
63
58
|
help="Enable debug mode for verbose output",
|
|
64
59
|
)
|
|
65
60
|
parent_parser.add_argument(
|
|
61
|
+
"--agent",
|
|
66
62
|
"--agent-name",
|
|
67
63
|
type=str,
|
|
68
64
|
help="Name of the agent to use for this session. If not provided, the default"
|
|
69
65
|
" agent will be used which does not persist its session.",
|
|
66
|
+
dest="agent_name",
|
|
70
67
|
)
|
|
71
68
|
parent_parser.add_argument(
|
|
72
69
|
"--train",
|
|
@@ -412,11 +409,7 @@ def main() -> int:
|
|
|
412
409
|
|
|
413
410
|
# Start the async chat interface or execute single command
|
|
414
411
|
if args.subcommand == "exec":
|
|
415
|
-
|
|
416
|
-
operator.executor.conversation_history = [
|
|
417
|
-
{"role": ConversationRole.SYSTEM.value, "content": system_prompt}
|
|
418
|
-
]
|
|
419
|
-
message = asyncio.run(operator.handle_user_input(args.command))
|
|
412
|
+
message = asyncio.run(operator.execute_single_command(args.command))
|
|
420
413
|
if message:
|
|
421
414
|
print(message.response)
|
|
422
415
|
return 0
|
|
@@ -292,6 +292,29 @@ class Operator:
|
|
|
292
292
|
print(f"\033[1;35m│ {line}\033[0m")
|
|
293
293
|
print("\033[1;35m╰──────────────────────────────────────────────────\033[0m\n")
|
|
294
294
|
|
|
295
|
+
async def execute_single_command(self, command: str) -> ResponseJsonSchema | None:
|
|
296
|
+
"""Execute a single command in non-interactive mode.
|
|
297
|
+
|
|
298
|
+
This method is used for one-off command execution rather than interactive chat.
|
|
299
|
+
It initializes a fresh conversation history (if not already initialized),
|
|
300
|
+
processes the command through the language model, and returns the result.
|
|
301
|
+
|
|
302
|
+
Args:
|
|
303
|
+
command (str): The command/instruction to execute
|
|
304
|
+
|
|
305
|
+
Returns:
|
|
306
|
+
ResponseJsonSchema | None: The processed response from the language model,
|
|
307
|
+
or None if no valid response was generated
|
|
308
|
+
"""
|
|
309
|
+
try:
|
|
310
|
+
self.executor.initialize_conversation_history()
|
|
311
|
+
except ExecutorInitError:
|
|
312
|
+
# Conversation history already initialized
|
|
313
|
+
pass
|
|
314
|
+
|
|
315
|
+
result = await self.handle_user_input(command)
|
|
316
|
+
return result
|
|
317
|
+
|
|
295
318
|
async def chat(self) -> None:
|
|
296
319
|
"""Run the interactive chat interface with code execution capabilities.
|
|
297
320
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "local-operator"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.3"
|
|
8
8
|
description = "A Python-based agent for local command execution"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Damian Tran", email = "damianvtran@gmail.com" }]
|
|
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
|