bub-acp-server 0.0.1__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.
@@ -0,0 +1,121 @@
1
+ Metadata-Version: 2.3
2
+ Name: bub-acp-server
3
+ Version: 0.0.1
4
+ Summary: Expose Bub as an ACP agent
5
+ Author: Frost Ming
6
+ Author-email: Frost Ming <me@frostming.com>
7
+ Requires-Dist: agent-client-protocol==0.10.1
8
+ Requires-Python: >=3.12
9
+ Description-Content-Type: text/markdown
10
+
11
+ # bub-acp-server
12
+
13
+ Expose Bub as an Agent Client Protocol agent.
14
+
15
+ ## What It Provides
16
+
17
+ - Bub plugin entry point: `acp-server`
18
+ - CLI command registered on Bub: `bub acp`
19
+ - Standalone console script: `bub-acp-server`
20
+ - ACP agent methods for `initialize`, `session/new`, `session/load`, `session/resume`, `session/list`, `session/close`, and `session/prompt`
21
+ - Streaming ACP `session/update` events from Bub stream events
22
+ - ACP client-backed replacements for Bub's `bash`, `fs.read`, `fs.write`, and `fs.edit` tools while the ACP server is running
23
+
24
+ ## Installation
25
+
26
+ ```bash
27
+ uv pip install "git+https://github.com/bubbuild/bub-contrib.git#subdirectory=packages/bub-acp-server"
28
+ ```
29
+
30
+ Or from a Bub project:
31
+
32
+ ```bash
33
+ bub install bub-acp-server@main
34
+ ```
35
+
36
+ ## Usage
37
+
38
+ Configure an ACP-compatible client to launch one of:
39
+
40
+ ```bash
41
+ bub acp
42
+ ```
43
+
44
+ The previous `bub acp serve` form remains accepted temporarily and prints a deprecation warning. Other positional arguments are rejected.
45
+
46
+ or:
47
+
48
+ ```bash
49
+ bub-acp-server
50
+ ```
51
+
52
+ The process speaks ACP over stdio. Prompts are sent through Bub's hook pipeline with stream output enabled, so model chunks and tool events can be displayed by the ACP client as they arrive.
53
+
54
+ At the end of every turn, the agent sends an ACP `usage_update`. Missing token usage is reported as `0`. If the model provider does not report its context-window size, set `BUB_ACP_SERVER_CONTEXT_WINDOW_SIZE`; the default is `128000` tokens.
55
+
56
+ Bub keeps using its own configuration, tools, skills, and tapes. The ACP client starts the process and displays the session; it does not replace Bub's model setup.
57
+
58
+ ACP session metadata is stored under Bub home as `acp-sessions.json` so compatible clients can list sessions again after restarting. Keep `BUB_HOME` stable if you want the same ACP thread list across editor launches.
59
+
60
+ `bub-acp-server` supports both ACP session load and resume. `session/load` restores the matching Bub history through the same ACP streaming path used by live turns. `session/resume` attaches the editor back to the Bub session without replaying history, so later turns keep streaming through Bub's normal hook pipeline.
61
+
62
+ ## Use In Zed
63
+
64
+ Zed supports external terminal agents through ACP. Custom agents are configured in Zed's `settings.json` under `agent_servers`.
65
+
66
+ Prerequisites:
67
+
68
+ - `bub` is installed and available to Zed.
69
+ - `bub-acp-server` is installed in the Bub environment:
70
+
71
+ ```bash
72
+ bub install bub-acp-server@main
73
+ ```
74
+
75
+ Open Zed's settings with the `zed: open settings` command and add a custom agent server:
76
+
77
+ ```json
78
+ {
79
+ "agent_servers": {
80
+ "Bub": {
81
+ "type": "custom",
82
+ "command": "bub",
83
+ "args": ["acp"],
84
+ "env": {}
85
+ }
86
+ }
87
+ }
88
+ ```
89
+
90
+ If Zed cannot find `bub`, use the absolute path printed by `command -v bub`:
91
+
92
+ ```json
93
+ {
94
+ "agent_servers": {
95
+ "Bub": {
96
+ "type": "custom",
97
+ "command": "/absolute/path/to/bub",
98
+ "args": ["acp"],
99
+ "env": {}
100
+ }
101
+ }
102
+ }
103
+ ```
104
+
105
+ After saving the settings, open Zed's agent panel with `cmd-?` on macOS or `ctrl-?` on Linux/Windows, then start a new thread and select `Bub`.
106
+
107
+ Useful Zed commands while testing:
108
+
109
+ - `dev: open acp logs` shows the JSON-RPC traffic between Zed and Bub.
110
+ - `zed: open settings` opens `settings.json`.
111
+
112
+ Notes:
113
+
114
+ - Zed launches Bub as a separate ACP process. Bub reads its own local configuration and credentials directly.
115
+ - Use `env` only for settings your Bub installation actually needs.
116
+ - If your Bub configuration is loaded from a project `.env`, use a wrapper command that loads that file before running `bub acp`.
117
+
118
+ References:
119
+
120
+ - Zed external agents documentation: https://zed.dev/docs/ai/external-agents
121
+ - Zed ACP client page: https://zed.dev/acp/editor/zed
@@ -0,0 +1,111 @@
1
+ # bub-acp-server
2
+
3
+ Expose Bub as an Agent Client Protocol agent.
4
+
5
+ ## What It Provides
6
+
7
+ - Bub plugin entry point: `acp-server`
8
+ - CLI command registered on Bub: `bub acp`
9
+ - Standalone console script: `bub-acp-server`
10
+ - ACP agent methods for `initialize`, `session/new`, `session/load`, `session/resume`, `session/list`, `session/close`, and `session/prompt`
11
+ - Streaming ACP `session/update` events from Bub stream events
12
+ - ACP client-backed replacements for Bub's `bash`, `fs.read`, `fs.write`, and `fs.edit` tools while the ACP server is running
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ uv pip install "git+https://github.com/bubbuild/bub-contrib.git#subdirectory=packages/bub-acp-server"
18
+ ```
19
+
20
+ Or from a Bub project:
21
+
22
+ ```bash
23
+ bub install bub-acp-server@main
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ Configure an ACP-compatible client to launch one of:
29
+
30
+ ```bash
31
+ bub acp
32
+ ```
33
+
34
+ The previous `bub acp serve` form remains accepted temporarily and prints a deprecation warning. Other positional arguments are rejected.
35
+
36
+ or:
37
+
38
+ ```bash
39
+ bub-acp-server
40
+ ```
41
+
42
+ The process speaks ACP over stdio. Prompts are sent through Bub's hook pipeline with stream output enabled, so model chunks and tool events can be displayed by the ACP client as they arrive.
43
+
44
+ At the end of every turn, the agent sends an ACP `usage_update`. Missing token usage is reported as `0`. If the model provider does not report its context-window size, set `BUB_ACP_SERVER_CONTEXT_WINDOW_SIZE`; the default is `128000` tokens.
45
+
46
+ Bub keeps using its own configuration, tools, skills, and tapes. The ACP client starts the process and displays the session; it does not replace Bub's model setup.
47
+
48
+ ACP session metadata is stored under Bub home as `acp-sessions.json` so compatible clients can list sessions again after restarting. Keep `BUB_HOME` stable if you want the same ACP thread list across editor launches.
49
+
50
+ `bub-acp-server` supports both ACP session load and resume. `session/load` restores the matching Bub history through the same ACP streaming path used by live turns. `session/resume` attaches the editor back to the Bub session without replaying history, so later turns keep streaming through Bub's normal hook pipeline.
51
+
52
+ ## Use In Zed
53
+
54
+ Zed supports external terminal agents through ACP. Custom agents are configured in Zed's `settings.json` under `agent_servers`.
55
+
56
+ Prerequisites:
57
+
58
+ - `bub` is installed and available to Zed.
59
+ - `bub-acp-server` is installed in the Bub environment:
60
+
61
+ ```bash
62
+ bub install bub-acp-server@main
63
+ ```
64
+
65
+ Open Zed's settings with the `zed: open settings` command and add a custom agent server:
66
+
67
+ ```json
68
+ {
69
+ "agent_servers": {
70
+ "Bub": {
71
+ "type": "custom",
72
+ "command": "bub",
73
+ "args": ["acp"],
74
+ "env": {}
75
+ }
76
+ }
77
+ }
78
+ ```
79
+
80
+ If Zed cannot find `bub`, use the absolute path printed by `command -v bub`:
81
+
82
+ ```json
83
+ {
84
+ "agent_servers": {
85
+ "Bub": {
86
+ "type": "custom",
87
+ "command": "/absolute/path/to/bub",
88
+ "args": ["acp"],
89
+ "env": {}
90
+ }
91
+ }
92
+ }
93
+ ```
94
+
95
+ After saving the settings, open Zed's agent panel with `cmd-?` on macOS or `ctrl-?` on Linux/Windows, then start a new thread and select `Bub`.
96
+
97
+ Useful Zed commands while testing:
98
+
99
+ - `dev: open acp logs` shows the JSON-RPC traffic between Zed and Bub.
100
+ - `zed: open settings` opens `settings.json`.
101
+
102
+ Notes:
103
+
104
+ - Zed launches Bub as a separate ACP process. Bub reads its own local configuration and credentials directly.
105
+ - Use `env` only for settings your Bub installation actually needs.
106
+ - If your Bub configuration is loaded from a project `.env`, use a wrapper command that loads that file before running `bub acp`.
107
+
108
+ References:
109
+
110
+ - Zed external agents documentation: https://zed.dev/docs/ai/external-agents
111
+ - Zed ACP client page: https://zed.dev/acp/editor/zed
@@ -0,0 +1,27 @@
1
+ [project]
2
+ name = "bub-acp-server"
3
+ version = "0.0.1"
4
+ description = "Expose Bub as an ACP agent"
5
+ readme = "README.md"
6
+ requires-python = ">=3.12"
7
+ dependencies = ["agent-client-protocol==0.10.1"]
8
+
9
+ [[project.authors]]
10
+ name = "Frost Ming"
11
+ email = "me@frostming.com"
12
+
13
+ [project.entry-points.bub]
14
+ acp-server = "bub_acp_server.plugin:ACPServerPlugin"
15
+
16
+ [project.scripts]
17
+ bub-acp-server = "bub_acp_server.cli:main"
18
+
19
+ [build-system]
20
+ requires = ["uv_build>=0.10.4,<0.11.0"]
21
+ build-backend = "uv_build"
22
+
23
+ [dependency-groups]
24
+ dev = [
25
+ "pytest>=9.0.3",
26
+ "pytest-asyncio>=0.21.0",
27
+ ]
@@ -0,0 +1,28 @@
1
+ [project]
2
+ name = "bub-acp-server"
3
+ version = "0.0.1"
4
+ description = "Expose Bub as an ACP agent"
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "Frost Ming", email = "me@frostming.com" }
8
+ ]
9
+ requires-python = ">=3.12"
10
+ dependencies = [
11
+ "agent-client-protocol==0.10.1",
12
+ ]
13
+
14
+ [project.entry-points.bub]
15
+ acp-server = "bub_acp_server.plugin:ACPServerPlugin"
16
+
17
+ [project.scripts]
18
+ bub-acp-server = "bub_acp_server.cli:main"
19
+
20
+ [build-system]
21
+ requires = ["uv_build>=0.10.4,<0.11.0"]
22
+ build-backend = "uv_build"
23
+
24
+ [dependency-groups]
25
+ dev = [
26
+ "pytest>=9.0.3",
27
+ "pytest-asyncio>=0.21.0",
28
+ ]
@@ -0,0 +1,8 @@
1
+ """Expose Bub as an ACP agent."""
2
+
3
+ from __future__ import annotations
4
+
5
+ __all__ = ["ACPServerPlugin", "BubACPAgent", "run_acp_agent"]
6
+
7
+ from bub_acp_server.agent import BubACPAgent, run_acp_agent
8
+ from bub_acp_server.plugin import ACPServerPlugin