vamp-cli 0.1.3__tar.gz → 0.1.5__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.
- {vamp_cli-0.1.3/src/vamp_cli.egg-info → vamp_cli-0.1.5}/PKG-INFO +32 -4
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/README.md +30 -3
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/pyproject.toml +2 -1
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/agent/nodes.py +52 -49
- vamp_cli-0.1.5/src/vamp_cli/main.py +901 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/persistence/__init__.py +2 -2
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/persistence/loader.py +6 -0
- vamp_cli-0.1.5/src/vamp_cli/persistence/transcript.py +117 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/tools/registry.py +18 -8
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/tools/tools_classes.py +40 -8
- vamp_cli-0.1.5/src/vamp_cli/utils/auto_complete.py +93 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/utils/ignore.py +12 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/utils/token_tracker.py +7 -5
- {vamp_cli-0.1.3 → vamp_cli-0.1.5/src/vamp_cli.egg-info}/PKG-INFO +32 -4
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli.egg-info/SOURCES.txt +1 -1
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli.egg-info/requires.txt +1 -0
- vamp_cli-0.1.3/src/vamp_cli/main.py +0 -1023
- vamp_cli-0.1.3/src/vamp_cli/persistence/transcript.py +0 -160
- vamp_cli-0.1.3/src/vamp_cli/utils/sha_256.py +0 -32
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/LICENSE +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/MANIFEST.in +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/setup.cfg +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/__init__.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/agent/__init__.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/agent/context_sync.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/agent/graph.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/agent/instructions.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/agent/roles.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/agent/runtime/__init__.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/agent/runtime/runtime.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/agent/state.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/agent/status.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/config/__init__.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/config/default_config.yaml +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/config/loader.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/config/schema.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/llm/__init__.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/llm/adapter.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/llm/adapter_registry.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/llm/debug_callbacks.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/llm/router.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/llm/usage.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/logging_setup/logging_setup.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/persistence/compaction.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/persistence/emitter.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/persistence/event_log.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/persistence/fork.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/prompts/agent.md +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/prompts/coder.md +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/prompts/planner.md +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/prompts/prompts.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/sandbox/__init__.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/sandbox/base.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/sandbox/config.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/sandbox/docker.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/sandbox/manager.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/sandbox/result.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/sandbox/terminal.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/tools/__init__.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/tools/base.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/tools/diagnostic.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/tools/execute_cmd.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/tools/files.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/utils/__init__.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/utils/error_codes.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/workspace/__init__.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli/workspace/workspace.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli.egg-info/dependency_links.txt +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli.egg-info/entry_points.txt +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/src/vamp_cli.egg-info/top_level.txt +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/tests/test_list_dir.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/tests/test_loader.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/tests/test_model_fallbacks.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/tests/test_persistence.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/tests/test_registry_async.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/tests/test_sandbox_roundtrip.py +0 -0
- {vamp_cli-0.1.3 → vamp_cli-0.1.5}/tests/test_system_verification.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vamp-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: VAMP-CLI is an interactive coding agent for working in a local repository. It combines a planner, a coder, model fallbacks, workspace-aware file tools, and a Docker-backed command sandbox in one terminal application. The agent can inspect and edit files, search a codebase, run commands, maintain a task list, and ask for confirmation before executing potentially dangerous operations.
|
|
5
5
|
Author-email: Satyam Kumar <satkr2208@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -50,6 +50,7 @@ Requires-Dist: langgraph
|
|
|
50
50
|
Requires-Dist: langchain-litellm
|
|
51
51
|
Requires-Dist: langgraph-checkpoint-sqlite
|
|
52
52
|
Requires-Dist: aiosqlite
|
|
53
|
+
Requires-Dist: mcp
|
|
53
54
|
Dynamic: license-file
|
|
54
55
|
|
|
55
56
|
# VAMP-CLI
|
|
@@ -62,7 +63,7 @@ The agent can inspect and edit files, search a codebase, run commands, maintain
|
|
|
62
63
|
|
|
63
64
|
## Highlights
|
|
64
65
|
|
|
65
|
-
- Interactive terminal UI launched with the `vamp` command.
|
|
66
|
+
- Interactive terminal UI launched with the `vamp` command, powered by **[Rich](https://github.com/Textualize/rich)** for beautiful formatting, colors, and progress indicators.
|
|
66
67
|
- Two operating modes:
|
|
67
68
|
- **Normal mode**: work directly with the coding agent.
|
|
68
69
|
- **Plan mode**: have the planner produce a plan and approve it before implementation.
|
|
@@ -78,11 +79,23 @@ The agent can inspect and edit files, search a codebase, run commands, maintain
|
|
|
78
79
|
- **Branch switching**: view and switch between conversation branches within a session.
|
|
79
80
|
- **Conversation compaction**: automatically or manually summarize early turns to stay within model context limits.
|
|
80
81
|
|
|
82
|
+
## Demo
|
|
83
|
+
|
|
84
|
+
### Interactive Terminal Experience
|
|
85
|
+
|
|
86
|
+
Below is a demonstration of the VAMP-CLI interface in action. The UI utilizes the **Rich** library to provide syntax highlighting, styled tables, and clear visual feedback during agent operations.
|
|
87
|
+
|
|
88
|
+

|
|
89
|
+
|
|
90
|
+
### Interface Screenshot
|
|
91
|
+
|
|
92
|
+

|
|
93
|
+
|
|
81
94
|
## Requirements
|
|
82
95
|
|
|
83
96
|
- Python 3.11 or newer
|
|
84
97
|
- Docker Engine or Docker Desktop, running and accessible to the current user
|
|
85
|
-
- An API key for each model configured in
|
|
98
|
+
- An API key env var for each model configured in `~/.vamp/config.yaml` (it gets created in first run).
|
|
86
99
|
|
|
87
100
|
The first run automatically builds the `vamp-sandbox:latest` image from [`src/vamp_cli/sandbox/Dockerfile`](src/vamp_cli/sandbox/Dockerfile) when it is not already available locally. The image includes Python, Node.js, Git, `ripgrep`, `fd`, and common build tools.
|
|
88
101
|
|
|
@@ -90,13 +103,26 @@ The first run automatically builds the `vamp-sandbox:latest` image from [`src/va
|
|
|
90
103
|
|
|
91
104
|
Create and activate a virtual environment, then install the project (all dependencies will be installed itself):
|
|
92
105
|
|
|
106
|
+
Virtual Env:
|
|
107
|
+
|
|
93
108
|
```bash
|
|
94
109
|
python3.12 -m venv .venv
|
|
95
110
|
source .venv/bin/activate
|
|
96
111
|
python -m pip install --upgrade pip
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Package:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
97
117
|
python -m pip install vamp-cli
|
|
98
118
|
```
|
|
99
119
|
|
|
120
|
+
For development:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
python -m pip install -e .
|
|
124
|
+
```
|
|
125
|
+
|
|
100
126
|
Confirm that Docker is available before starting the agent:
|
|
101
127
|
|
|
102
128
|
```bash
|
|
@@ -105,7 +131,7 @@ docker info
|
|
|
105
131
|
|
|
106
132
|
## Configuration
|
|
107
133
|
|
|
108
|
-
Model and profile configuration lives in [
|
|
134
|
+
Model and profile configuration lives in [`/src/vamp_cli/config/default_config.yaml`](/src/vamp_cli/config/default_config.yaml)(this is used to create `config.yaml` for first run). After first run `~/.vamp/config.yaml` is created and vamp-cli reads from this always. API keys are read from environment variables named by each model's `api_key_env` field; keys are not read from YAML values directly.
|
|
109
135
|
|
|
110
136
|
The checked-in default configuration defines `qwen` and `openai`, so both variables must be present unless you edit the configuration to remove or replace one of those models:
|
|
111
137
|
|
|
@@ -135,6 +161,7 @@ You:
|
|
|
135
161
|
| Argument | Action |
|
|
136
162
|
| --- | --- |
|
|
137
163
|
| `--resume <id>` or `-r <id>` | Resume a previous session by its ID |
|
|
164
|
+
| `--previous` or `-p` | Resume last session |
|
|
138
165
|
| `--list` or `-l` | List all past sessions |
|
|
139
166
|
|
|
140
167
|
Examples:
|
|
@@ -160,6 +187,7 @@ vamp --resume 01a145b4-5103-7014-97da-d5ca9c871d68
|
|
|
160
187
|
| `/compact` | Summarize early conversation turns to reduce context usage |
|
|
161
188
|
| `/compact <N>` | Compact keeping the last N turns intact (default: 4) |
|
|
162
189
|
| `/config` | Change configurations of models, coder or planner profiles, and tool access. |
|
|
190
|
+
| `@<file-path>` | Use `@` to select a file and ask agent about that file. |
|
|
163
191
|
|
|
164
192
|
When the agent requests approval, answer `yes` to continue or `no` and provide a reason to deny the action. Approvals are used for plan implementation and security-sensitive tool calls such as destructive commands, package installation, or network access.
|
|
165
193
|
|
|
@@ -8,7 +8,7 @@ The agent can inspect and edit files, search a codebase, run commands, maintain
|
|
|
8
8
|
|
|
9
9
|
## Highlights
|
|
10
10
|
|
|
11
|
-
- Interactive terminal UI launched with the `vamp` command.
|
|
11
|
+
- Interactive terminal UI launched with the `vamp` command, powered by **[Rich](https://github.com/Textualize/rich)** for beautiful formatting, colors, and progress indicators.
|
|
12
12
|
- Two operating modes:
|
|
13
13
|
- **Normal mode**: work directly with the coding agent.
|
|
14
14
|
- **Plan mode**: have the planner produce a plan and approve it before implementation.
|
|
@@ -24,11 +24,23 @@ The agent can inspect and edit files, search a codebase, run commands, maintain
|
|
|
24
24
|
- **Branch switching**: view and switch between conversation branches within a session.
|
|
25
25
|
- **Conversation compaction**: automatically or manually summarize early turns to stay within model context limits.
|
|
26
26
|
|
|
27
|
+
## Demo
|
|
28
|
+
|
|
29
|
+
### Interactive Terminal Experience
|
|
30
|
+
|
|
31
|
+
Below is a demonstration of the VAMP-CLI interface in action. The UI utilizes the **Rich** library to provide syntax highlighting, styled tables, and clear visual feedback during agent operations.
|
|
32
|
+
|
|
33
|
+

|
|
34
|
+
|
|
35
|
+
### Interface Screenshot
|
|
36
|
+
|
|
37
|
+

|
|
38
|
+
|
|
27
39
|
## Requirements
|
|
28
40
|
|
|
29
41
|
- Python 3.11 or newer
|
|
30
42
|
- Docker Engine or Docker Desktop, running and accessible to the current user
|
|
31
|
-
- An API key for each model configured in
|
|
43
|
+
- An API key env var for each model configured in `~/.vamp/config.yaml` (it gets created in first run).
|
|
32
44
|
|
|
33
45
|
The first run automatically builds the `vamp-sandbox:latest` image from [`src/vamp_cli/sandbox/Dockerfile`](src/vamp_cli/sandbox/Dockerfile) when it is not already available locally. The image includes Python, Node.js, Git, `ripgrep`, `fd`, and common build tools.
|
|
34
46
|
|
|
@@ -36,13 +48,26 @@ The first run automatically builds the `vamp-sandbox:latest` image from [`src/va
|
|
|
36
48
|
|
|
37
49
|
Create and activate a virtual environment, then install the project (all dependencies will be installed itself):
|
|
38
50
|
|
|
51
|
+
Virtual Env:
|
|
52
|
+
|
|
39
53
|
```bash
|
|
40
54
|
python3.12 -m venv .venv
|
|
41
55
|
source .venv/bin/activate
|
|
42
56
|
python -m pip install --upgrade pip
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Package:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
43
62
|
python -m pip install vamp-cli
|
|
44
63
|
```
|
|
45
64
|
|
|
65
|
+
For development:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
python -m pip install -e .
|
|
69
|
+
```
|
|
70
|
+
|
|
46
71
|
Confirm that Docker is available before starting the agent:
|
|
47
72
|
|
|
48
73
|
```bash
|
|
@@ -51,7 +76,7 @@ docker info
|
|
|
51
76
|
|
|
52
77
|
## Configuration
|
|
53
78
|
|
|
54
|
-
Model and profile configuration lives in [
|
|
79
|
+
Model and profile configuration lives in [`/src/vamp_cli/config/default_config.yaml`](/src/vamp_cli/config/default_config.yaml)(this is used to create `config.yaml` for first run). After first run `~/.vamp/config.yaml` is created and vamp-cli reads from this always. API keys are read from environment variables named by each model's `api_key_env` field; keys are not read from YAML values directly.
|
|
55
80
|
|
|
56
81
|
The checked-in default configuration defines `qwen` and `openai`, so both variables must be present unless you edit the configuration to remove or replace one of those models:
|
|
57
82
|
|
|
@@ -81,6 +106,7 @@ You:
|
|
|
81
106
|
| Argument | Action |
|
|
82
107
|
| --- | --- |
|
|
83
108
|
| `--resume <id>` or `-r <id>` | Resume a previous session by its ID |
|
|
109
|
+
| `--previous` or `-p` | Resume last session |
|
|
84
110
|
| `--list` or `-l` | List all past sessions |
|
|
85
111
|
|
|
86
112
|
Examples:
|
|
@@ -106,6 +132,7 @@ vamp --resume 01a145b4-5103-7014-97da-d5ca9c871d68
|
|
|
106
132
|
| `/compact` | Summarize early conversation turns to reduce context usage |
|
|
107
133
|
| `/compact <N>` | Compact keeping the last N turns intact (default: 4) |
|
|
108
134
|
| `/config` | Change configurations of models, coder or planner profiles, and tool access. |
|
|
135
|
+
| `@<file-path>` | Use `@` to select a file and ask agent about that file. |
|
|
109
136
|
|
|
110
137
|
When the agent requests approval, answer `yes` to continue or `no` and provide a reason to deny the action. Approvals are used for plan implementation and security-sensitive tool calls such as destructive commands, package installation, or network access.
|
|
111
138
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "vamp-cli"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.5"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name = "Satyam Kumar", email = "satkr2208@gmail.com" }
|
|
10
10
|
]
|
|
@@ -36,6 +36,7 @@ dependencies = [
|
|
|
36
36
|
"langchain-litellm",
|
|
37
37
|
"langgraph-checkpoint-sqlite",
|
|
38
38
|
"aiosqlite",
|
|
39
|
+
"mcp",
|
|
39
40
|
]
|
|
40
41
|
|
|
41
42
|
|
|
@@ -4,11 +4,12 @@ import asyncio
|
|
|
4
4
|
from typing import Any
|
|
5
5
|
from prompt_toolkit import print_formatted_text
|
|
6
6
|
from prompt_toolkit.formatted_text import FormattedText, HTML
|
|
7
|
+
from prompt_toolkit.styles import Style
|
|
7
8
|
|
|
8
9
|
from langgraph.graph import END
|
|
9
10
|
from langgraph.types import interrupt, Command
|
|
10
11
|
from langchain_core.runnables import Runnable, RunnableConfig
|
|
11
|
-
from langchain_core.messages import ToolMessage, SystemMessage, AIMessage, BaseMessage
|
|
12
|
+
from langchain_core.messages import ToolMessage, SystemMessage, AIMessage, BaseMessage, HumanMessage
|
|
12
13
|
|
|
13
14
|
from vamp_cli.tools.registry import ToolRegistry
|
|
14
15
|
from vamp_cli.agent.state import AgentState, TodoItem
|
|
@@ -16,7 +17,9 @@ from vamp_cli.agent.state import AgentState
|
|
|
16
17
|
from vamp_cli.agent.status import FeedbackResponse
|
|
17
18
|
from vamp_cli.agent.instructions import TODO_INSTRUCTIONS, PLAN_INSTRUCTIONS
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
_dim_style = Style.from_dict({
|
|
21
|
+
'dimmed': '#767B7D',
|
|
22
|
+
})
|
|
20
23
|
|
|
21
24
|
def create_planner_node(model: Runnable):
|
|
22
25
|
|
|
@@ -33,22 +36,24 @@ def create_planner_node(model: Runnable):
|
|
|
33
36
|
None
|
|
34
37
|
)
|
|
35
38
|
|
|
36
|
-
if response.tool_calls:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
# if response.tool_calls:
|
|
40
|
+
# print_formatted_text(
|
|
41
|
+
# FormattedText([(
|
|
42
|
+
# "class:dimmed",
|
|
43
|
+
# "\n\n[planner] calling:"
|
|
44
|
+
# )]),
|
|
45
|
+
# style=_dim_style,
|
|
46
|
+
# end="\n"
|
|
47
|
+
# )
|
|
48
|
+
# for tc in response.tool_calls:
|
|
49
|
+
# print_formatted_text(
|
|
50
|
+
# FormattedText([(
|
|
51
|
+
# "class:dimmed",
|
|
52
|
+
# f">> {str(tc['name'])}({str(tc['args'])})"
|
|
53
|
+
# )]),
|
|
54
|
+
# style=_dim_style,
|
|
55
|
+
# end="\n"
|
|
56
|
+
# )
|
|
52
57
|
# print("Tool: ", tc['name'])
|
|
53
58
|
# print("Arguments: ", tc['args'])
|
|
54
59
|
|
|
@@ -98,37 +103,40 @@ def create_agent_node(model: Runnable):
|
|
|
98
103
|
message_to_send += [plan_message] + [plan_instruction]
|
|
99
104
|
|
|
100
105
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
if
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
# print(f"\n\n\n------ CONTEXT START------\n\n")
|
|
107
|
+
# for mess in message_to_send:
|
|
108
|
+
# if isinstance(mess, SystemMessage):
|
|
109
|
+
# print("SystemMessage: ", end="")
|
|
110
|
+
# if isinstance(mess, HumanMessage):
|
|
111
|
+
# print("HumanMessage: ", end="")
|
|
112
|
+
# if isinstance(mess, ToolMessage):
|
|
113
|
+
# print("ToolMessage: ", end="")
|
|
114
|
+
# print(mess)
|
|
115
|
+
# print()
|
|
116
|
+
# print("\n\n------ CONTEXT END ------\n\n\n")
|
|
111
117
|
|
|
112
118
|
response: AIMessage = await model.with_config(config).ainvoke(message_to_send)
|
|
113
119
|
|
|
114
120
|
# print("\n\nCODER------AI-RESPONSE:\n.\n.\n", response, "\n\n")
|
|
115
121
|
|
|
116
|
-
if response.tool_calls:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
122
|
+
# if response.tool_calls:
|
|
123
|
+
# print_formatted_text(
|
|
124
|
+
# FormattedText([(
|
|
125
|
+
# "class:dimmed",
|
|
126
|
+
# "\n\n[coder] calling:"
|
|
127
|
+
# )]),
|
|
128
|
+
# style=_dim_style,
|
|
129
|
+
# end="\n"
|
|
130
|
+
# )
|
|
131
|
+
# for tc in response.tool_calls:
|
|
132
|
+
# print_formatted_text(
|
|
133
|
+
# FormattedText([(
|
|
134
|
+
# "class:dimmed",
|
|
135
|
+
# f">> {str(tc['name'])}({str(tc['args'])})"
|
|
136
|
+
# )]),
|
|
137
|
+
# style=_dim_style,
|
|
138
|
+
# end="\n"
|
|
139
|
+
# )
|
|
132
140
|
|
|
133
141
|
return {
|
|
134
142
|
"coder_messages": [response],
|
|
@@ -334,11 +342,6 @@ def create_tool_execute_node(tool_registry: ToolRegistry):
|
|
|
334
342
|
}
|
|
335
343
|
if todo_update is not None:
|
|
336
344
|
update["todo"] = todo_update
|
|
337
|
-
|
|
338
|
-
# if interrupted:
|
|
339
|
-
# # Save the state update, then END the graph invocation.
|
|
340
|
-
# # Control returns to main(); the prompt shows again.
|
|
341
|
-
# return Command(update=update, goto=END)
|
|
342
345
|
|
|
343
346
|
return update
|
|
344
347
|
|