a2a-handler 0.1.22__tar.gz → 0.1.24__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 (61) hide show
  1. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/PKG-INFO +40 -37
  2. a2a_handler-0.1.24/README.md +81 -0
  3. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/pyproject.toml +1 -1
  4. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/auth.py +4 -0
  5. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/cli/session.py +8 -5
  6. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/server/app.py +12 -6
  7. a2a_handler-0.1.22/README.md +0 -78
  8. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/LICENSE +0 -0
  9. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/__init__.py +0 -0
  10. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/cli/__init__.py +0 -0
  11. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/cli/_helpers.py +0 -0
  12. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/cli/card.py +0 -0
  13. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/cli/mcp.py +0 -0
  14. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/cli/message.py +0 -0
  15. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/cli/schema.py +0 -0
  16. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/cli/server.py +0 -0
  17. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/cli/task.py +0 -0
  18. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/common/__init__.py +0 -0
  19. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/common/config.py +0 -0
  20. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/common/dotenv.py +0 -0
  21. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/common/input_validation.py +0 -0
  22. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/common/logging.py +0 -0
  23. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/common/output.py +0 -0
  24. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/mcp/__init__.py +0 -0
  25. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/mcp/server.py +0 -0
  26. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/server/__init__.py +0 -0
  27. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/server/agent.py +0 -0
  28. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/server/card.py +0 -0
  29. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/server/ollama.py +0 -0
  30. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/server/tools/__init__.py +0 -0
  31. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/server/tools/a2a_docs.py +0 -0
  32. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/server/tools/handler_docs.py +0 -0
  33. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/server/tools/source.py +0 -0
  34. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/servers.py +0 -0
  35. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/service.py +0 -0
  36. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/session.py +0 -0
  37. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/__init__.py +0 -0
  38. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/app.py +0 -0
  39. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/app.tcss +0 -0
  40. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/commands/__init__.py +0 -0
  41. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/commands/palette.py +0 -0
  42. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/commands/screens.py +0 -0
  43. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/components/__init__.py +0 -0
  44. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/components/artifacts.py +0 -0
  45. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/components/auth.py +0 -0
  46. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/components/card.py +0 -0
  47. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/components/headers.py +0 -0
  48. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/components/input.py +0 -0
  49. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/components/logs.py +0 -0
  50. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/components/messages.py +0 -0
  51. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/components/tasks.py +0 -0
  52. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/server/__init__.py +0 -0
  53. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/server/save.py +0 -0
  54. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/server/session.py +0 -0
  55. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/server/tab.py +0 -0
  56. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/server/tabs.py +0 -0
  57. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/server/types.py +0 -0
  58. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/server/views.py +0 -0
  59. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/tui/server/workspace.py +0 -0
  60. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/validation.py +0 -0
  61. {a2a_handler-0.1.22 → a2a_handler-0.1.24}/src/a2a_handler/webhook.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: a2a-handler
3
- Version: 0.1.22
3
+ Version: 0.1.24
4
4
  Summary: An A2A Protocol client TUI and CLI.
5
5
  Keywords: a2a,a2a-protocol,agent,agent-to-agent,ai,cli,tui
6
6
  Author: Al Duncanson
@@ -45,75 +45,78 @@ Description-Content-Type: text/markdown
45
45
  [![A2A Protocol](https://img.shields.io/badge/A2A_Protocol-v0.3.0-blue)](https://a2a-protocol.org/latest/)
46
46
  [![PyPI version](https://img.shields.io/pypi/v/a2a-handler)](https://pypi.org/project/a2a-handler/)
47
47
  [![PyPI - Status](https://img.shields.io/pypi/status/a2a-handler)](https://pypi.org/project/a2a-handler/)
48
- [![PyPI monthly downloads](https://img.shields.io/pypi/dm/a2a-handler)](https://pypi.org/project/a2a-handler/)
49
48
  [![Pepy total downloads](https://img.shields.io/pepy/dt/a2a-handler?label=total%20downloads)](https://pepy.tech/projects/a2a-handler)
50
49
  [![GitHub stars](https://img.shields.io/github/stars/alDuncanson/handler)](https://github.com/alDuncanson/handler/stargazers)
51
50
 
52
- ![Handler TUI](https://github.com/alDuncanson/Handler/blob/main/assets/handler-tui.png?raw=true)
51
+ Handler is an open-source [A2A protocol](https://github.com/a2aproject/A2A)
52
+ client for software engineers building, testing, and operating agentic systems.
53
+ It provides an interactive TUI, a scriptable CLI with structured output, and an
54
+ MCP server that lets other agents integrate with A2A services directly. Handler
55
+ also supports global and repo-scoped A2A server configuration with bearer,
56
+ API key, mTLS, and OAuth2 client credentials auth.
53
57
 
54
- Handler is an open-source [A2A protocol](https://github.com/a2aproject/A2A) client for your terminal.
55
-
56
- Use the TUI or CLI to send messages, manage tasks, and inspect agent cards.
57
- An included MCP server lets your AI assistant talk to A2A agents too.
58
+ ![Handler TUI connected to the built-in Handler Agent, showing the agent card and a completed assistant response](https://raw.githubusercontent.com/alDuncanson/Handler/73915875903b60dad6e4e404aa7ed91b6d94559f/assets/tui.png)
58
59
 
59
60
  ## Install
60
61
 
62
+ Install Handler from the [PyPI package](https://pypi.org/project/a2a-handler/) as a `uv` tool:
63
+
61
64
  ```bash
62
65
  uv tool install a2a-handler
63
66
  ```
64
67
 
65
- Or with [pipx](https://pipx.pypa.io/) / pip:
68
+ Or with [pipx](https://pipx.pypa.io/):
66
69
 
67
70
  ```bash
68
- pipx install a2a-handler # or: pip install a2a-handler
71
+ pipx install a2a-handler
69
72
  ```
70
73
 
71
- ## Quick Start
74
+ Or with pip:
72
75
 
73
76
  ```bash
74
- handler tui # launch the interactive TUI
75
- handler message send URL "hello" # send a message from the CLI
76
- handler card get URL # fetch an agent card
77
- handler mcp # start the MCP server
78
- handler server run agent # run the bundled embedded agent
79
- handler docs # open the hosted documentation
80
- handler update # upgrade Handler to the latest release
77
+ pip install a2a-handler
81
78
  ```
82
79
 
83
- ## Run Without Installing
80
+ ## Quick Start
81
+
82
+ Open the interactive terminal UI:
84
83
 
85
84
  ```bash
86
- uvx --from a2a-handler handler # or: pipx run a2a-handler
85
+ handler tui
87
86
  ```
88
87
 
89
- ## Servers
88
+ Inspect an A2A server's agent card:
89
+
90
+ ```bash
91
+ handler card get --url http://localhost:8000
92
+ ```
90
93
 
91
- Handler supports named servers in `$XDG_CONFIG_HOME/handler/servers.toml`
92
- (global) and `.handler/servers.toml` (repo-local).
94
+ Send a message from the CLI:
93
95
 
94
- ```toml
95
- version = 1
96
+ ```bash
97
+ handler message send --url URL --text "hello"
98
+ ```
96
99
 
97
- [servers.local]
98
- url = "http://localhost:8000"
100
+ Open the full documentation:
99
101
 
100
- [servers.local.auth]
101
- type = "bearer"
102
- env = "HANDLER_LOCAL_TOKEN"
102
+ ```bash
103
+ handler docs
103
104
  ```
104
105
 
105
- See [docs/](docs) for the full auth reference covering bearer, API key, mTLS,
106
- and OAuth2.
106
+ ## Run Without Installing
107
+
108
+ Run Handler with `uvx`:
107
109
 
108
- ## Development
110
+ ```bash
111
+ uvx --from a2a-handler handler
112
+ ```
109
113
 
110
- A [hermetic](https://zero-to-nix.com/concepts/hermeticity/) dev environment
111
- is available via [Nix](https://zero-to-nix.com/concepts/nix/):
114
+ Run Handler with `pipx`:
112
115
 
113
116
  ```bash
114
- nix develop
117
+ pipx run a2a-handler
115
118
  ```
116
119
 
117
- The Mintlify docs source lives in `docs/`.
120
+ ## Documentation
118
121
 
119
- See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
122
+ Read the documentation at <https://handler.alduncanson.com>.
@@ -0,0 +1,81 @@
1
+ # Handler
2
+
3
+ [![CI](https://github.com/alDuncanson/handler/actions/workflows/ci.yml/badge.svg)](https://github.com/alDuncanson/handler/actions/workflows/ci.yml)
4
+ [![A2A Protocol](https://img.shields.io/badge/A2A_Protocol-v0.3.0-blue)](https://a2a-protocol.org/latest/)
5
+ [![PyPI version](https://img.shields.io/pypi/v/a2a-handler)](https://pypi.org/project/a2a-handler/)
6
+ [![PyPI - Status](https://img.shields.io/pypi/status/a2a-handler)](https://pypi.org/project/a2a-handler/)
7
+ [![Pepy total downloads](https://img.shields.io/pepy/dt/a2a-handler?label=total%20downloads)](https://pepy.tech/projects/a2a-handler)
8
+ [![GitHub stars](https://img.shields.io/github/stars/alDuncanson/handler)](https://github.com/alDuncanson/handler/stargazers)
9
+
10
+ Handler is an open-source [A2A protocol](https://github.com/a2aproject/A2A)
11
+ client for software engineers building, testing, and operating agentic systems.
12
+ It provides an interactive TUI, a scriptable CLI with structured output, and an
13
+ MCP server that lets other agents integrate with A2A services directly. Handler
14
+ also supports global and repo-scoped A2A server configuration with bearer,
15
+ API key, mTLS, and OAuth2 client credentials auth.
16
+
17
+ ![Handler TUI connected to the built-in Handler Agent, showing the agent card and a completed assistant response](https://raw.githubusercontent.com/alDuncanson/Handler/73915875903b60dad6e4e404aa7ed91b6d94559f/assets/tui.png)
18
+
19
+ ## Install
20
+
21
+ Install Handler from the [PyPI package](https://pypi.org/project/a2a-handler/) as a `uv` tool:
22
+
23
+ ```bash
24
+ uv tool install a2a-handler
25
+ ```
26
+
27
+ Or with [pipx](https://pipx.pypa.io/):
28
+
29
+ ```bash
30
+ pipx install a2a-handler
31
+ ```
32
+
33
+ Or with pip:
34
+
35
+ ```bash
36
+ pip install a2a-handler
37
+ ```
38
+
39
+ ## Quick Start
40
+
41
+ Open the interactive terminal UI:
42
+
43
+ ```bash
44
+ handler tui
45
+ ```
46
+
47
+ Inspect an A2A server's agent card:
48
+
49
+ ```bash
50
+ handler card get --url http://localhost:8000
51
+ ```
52
+
53
+ Send a message from the CLI:
54
+
55
+ ```bash
56
+ handler message send --url URL --text "hello"
57
+ ```
58
+
59
+ Open the full documentation:
60
+
61
+ ```bash
62
+ handler docs
63
+ ```
64
+
65
+ ## Run Without Installing
66
+
67
+ Run Handler with `uvx`:
68
+
69
+ ```bash
70
+ uvx --from a2a-handler handler
71
+ ```
72
+
73
+ Run Handler with `pipx`:
74
+
75
+ ```bash
76
+ pipx run a2a-handler
77
+ ```
78
+
79
+ ## Documentation
80
+
81
+ Read the documentation at <https://handler.alduncanson.com>.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "a2a-handler"
3
- version = "0.1.22"
3
+ version = "0.1.24"
4
4
  description = "An A2A Protocol client TUI and CLI."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -250,6 +250,10 @@ def create_mtls_auth(
250
250
  ca_cert_path: str | None = None,
251
251
  ) -> AuthCredentials:
252
252
  """Create mTLS (mutual TLS) client certificate authentication."""
253
+ cert_path = str(Path(cert_path).expanduser())
254
+ key_path = str(Path(key_path).expanduser())
255
+ ca_cert_path = str(Path(ca_cert_path).expanduser()) if ca_cert_path else None
256
+
253
257
  if not Path(cert_path).is_file():
254
258
  raise FileNotFoundError(f"Client certificate not found: {cert_path}")
255
259
  if not Path(key_path).is_file():
@@ -32,15 +32,18 @@ def session_list() -> None:
32
32
  if not sessions:
33
33
  return
34
34
 
35
+ data: list[dict[str, object]] = []
35
36
  for session_entry in sessions:
36
- data: dict[str, object] = {"agent_url": session_entry.agent_url}
37
+ session_data: dict[str, object] = {"agent_url": session_entry.agent_url}
37
38
  if session_entry.context_id:
38
- data["context_id"] = session_entry.context_id
39
+ session_data["context_id"] = session_entry.context_id
39
40
  if session_entry.task_id:
40
- data["task_id"] = session_entry.task_id
41
+ session_data["task_id"] = session_entry.task_id
41
42
  if session_entry.last_used_at:
42
- data["last_used_at"] = session_entry.last_used_at
43
- output.json(data)
43
+ session_data["last_used_at"] = session_entry.last_used_at
44
+ data.append(session_data)
45
+
46
+ output.json(data)
44
47
 
45
48
 
46
49
  @session.command("show")
@@ -1,7 +1,8 @@
1
1
  """A2A application setup and middleware."""
2
2
 
3
3
  import secrets
4
- from collections.abc import Awaitable, Callable
4
+ from collections.abc import AsyncIterator, Awaitable, Callable
5
+ from contextlib import asynccontextmanager
5
6
 
6
7
  import httpx
7
8
  from a2a.server.apps import A2AStarletteApplication
@@ -195,9 +196,7 @@ def create_a2a_application(
195
196
  Middleware(APIKeyAuthMiddleware, api_key=api_key) # type: ignore[arg-type]
196
197
  )
197
198
 
198
- application = Starlette(middleware=middleware)
199
-
200
- async def setup_a2a_routes() -> None:
199
+ async def setup_a2a_routes(application: Starlette) -> None:
201
200
  a2a_starlette_app = A2AStarletteApplication(
202
201
  agent_card=agent_card,
203
202
  http_handler=request_handler,
@@ -209,7 +208,14 @@ def create_a2a_application(
209
208
  await http_client.aclose()
210
209
  logger.info("HTTP client closed")
211
210
 
212
- application.add_event_handler("startup", setup_a2a_routes)
213
- application.add_event_handler("shutdown", cleanup_http_client)
211
+ @asynccontextmanager
212
+ async def lifespan(application: Starlette) -> AsyncIterator[None]:
213
+ await setup_a2a_routes(application)
214
+ try:
215
+ yield
216
+ finally:
217
+ await cleanup_http_client()
218
+
219
+ application = Starlette(middleware=middleware, lifespan=lifespan)
214
220
 
215
221
  return application
@@ -1,78 +0,0 @@
1
- # Handler
2
-
3
- [![CI](https://github.com/alDuncanson/handler/actions/workflows/ci.yml/badge.svg)](https://github.com/alDuncanson/handler/actions/workflows/ci.yml)
4
- [![A2A Protocol](https://img.shields.io/badge/A2A_Protocol-v0.3.0-blue)](https://a2a-protocol.org/latest/)
5
- [![PyPI version](https://img.shields.io/pypi/v/a2a-handler)](https://pypi.org/project/a2a-handler/)
6
- [![PyPI - Status](https://img.shields.io/pypi/status/a2a-handler)](https://pypi.org/project/a2a-handler/)
7
- [![PyPI monthly downloads](https://img.shields.io/pypi/dm/a2a-handler)](https://pypi.org/project/a2a-handler/)
8
- [![Pepy total downloads](https://img.shields.io/pepy/dt/a2a-handler?label=total%20downloads)](https://pepy.tech/projects/a2a-handler)
9
- [![GitHub stars](https://img.shields.io/github/stars/alDuncanson/handler)](https://github.com/alDuncanson/handler/stargazers)
10
-
11
- ![Handler TUI](https://github.com/alDuncanson/Handler/blob/main/assets/handler-tui.png?raw=true)
12
-
13
- Handler is an open-source [A2A protocol](https://github.com/a2aproject/A2A) client for your terminal.
14
-
15
- Use the TUI or CLI to send messages, manage tasks, and inspect agent cards.
16
- An included MCP server lets your AI assistant talk to A2A agents too.
17
-
18
- ## Install
19
-
20
- ```bash
21
- uv tool install a2a-handler
22
- ```
23
-
24
- Or with [pipx](https://pipx.pypa.io/) / pip:
25
-
26
- ```bash
27
- pipx install a2a-handler # or: pip install a2a-handler
28
- ```
29
-
30
- ## Quick Start
31
-
32
- ```bash
33
- handler tui # launch the interactive TUI
34
- handler message send URL "hello" # send a message from the CLI
35
- handler card get URL # fetch an agent card
36
- handler mcp # start the MCP server
37
- handler server run agent # run the bundled embedded agent
38
- handler docs # open the hosted documentation
39
- handler update # upgrade Handler to the latest release
40
- ```
41
-
42
- ## Run Without Installing
43
-
44
- ```bash
45
- uvx --from a2a-handler handler # or: pipx run a2a-handler
46
- ```
47
-
48
- ## Servers
49
-
50
- Handler supports named servers in `$XDG_CONFIG_HOME/handler/servers.toml`
51
- (global) and `.handler/servers.toml` (repo-local).
52
-
53
- ```toml
54
- version = 1
55
-
56
- [servers.local]
57
- url = "http://localhost:8000"
58
-
59
- [servers.local.auth]
60
- type = "bearer"
61
- env = "HANDLER_LOCAL_TOKEN"
62
- ```
63
-
64
- See [docs/](docs) for the full auth reference covering bearer, API key, mTLS,
65
- and OAuth2.
66
-
67
- ## Development
68
-
69
- A [hermetic](https://zero-to-nix.com/concepts/hermeticity/) dev environment
70
- is available via [Nix](https://zero-to-nix.com/concepts/nix/):
71
-
72
- ```bash
73
- nix develop
74
- ```
75
-
76
- The Mintlify docs source lives in `docs/`.
77
-
78
- See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
File without changes