ai-agent-gateway-cli 0.1.0__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.
- ai_agent_gateway_cli-0.1.0/PKG-INFO +43 -0
- ai_agent_gateway_cli-0.1.0/README.md +30 -0
- ai_agent_gateway_cli-0.1.0/agent_gateway_cli/__init__.py +18 -0
- ai_agent_gateway_cli-0.1.0/agent_gateway_cli/__main__.py +7 -0
- ai_agent_gateway_cli-0.1.0/agent_gateway_cli/cli.py +812 -0
- ai_agent_gateway_cli-0.1.0/agent_gateway_cli/config.py +201 -0
- ai_agent_gateway_cli-0.1.0/agent_gateway_cli/session.py +240 -0
- ai_agent_gateway_cli-0.1.0/agent_gateway_cli/sse.py +254 -0
- ai_agent_gateway_cli-0.1.0/agent_gateway_cli/transport.py +193 -0
- ai_agent_gateway_cli-0.1.0/ai_agent_gateway_cli.egg-info/PKG-INFO +43 -0
- ai_agent_gateway_cli-0.1.0/ai_agent_gateway_cli.egg-info/SOURCES.txt +21 -0
- ai_agent_gateway_cli-0.1.0/ai_agent_gateway_cli.egg-info/dependency_links.txt +1 -0
- ai_agent_gateway_cli-0.1.0/ai_agent_gateway_cli.egg-info/entry_points.txt +2 -0
- ai_agent_gateway_cli-0.1.0/ai_agent_gateway_cli.egg-info/requires.txt +6 -0
- ai_agent_gateway_cli-0.1.0/ai_agent_gateway_cli.egg-info/top_level.txt +1 -0
- ai_agent_gateway_cli-0.1.0/pyproject.toml +24 -0
- ai_agent_gateway_cli-0.1.0/setup.cfg +4 -0
- ai_agent_gateway_cli-0.1.0/tests/test_cli.py +268 -0
- ai_agent_gateway_cli-0.1.0/tests/test_config.py +112 -0
- ai_agent_gateway_cli-0.1.0/tests/test_contract.py +293 -0
- ai_agent_gateway_cli-0.1.0/tests/test_session.py +172 -0
- ai_agent_gateway_cli-0.1.0/tests/test_sse.py +255 -0
- ai_agent_gateway_cli-0.1.0/tests/test_transport.py +105 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ai-agent-gateway-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Canonical dev CLI client for ai-agent-gateway
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: httpx>=0.27.0
|
|
9
|
+
Provides-Extra: dev
|
|
10
|
+
Requires-Dist: pytest; extra == "dev"
|
|
11
|
+
Requires-Dist: pytest-asyncio; extra == "dev"
|
|
12
|
+
Requires-Dist: httpx>=0.27.0; extra == "dev"
|
|
13
|
+
|
|
14
|
+
# ai-agent-gateway-cli
|
|
15
|
+
|
|
16
|
+
Canonical Python dev CLI for the `ai-agent-gateway` HTTP/SSE protocol.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
python -m agent_gateway_cli login
|
|
22
|
+
python -m agent_gateway_cli chat "hello"
|
|
23
|
+
python -m agent_gateway_cli --config-namespace cashnerd login
|
|
24
|
+
python -m agent_gateway_cli --config-namespace cashnerd chat --session default "hello"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The default config namespace is `agent-gateway`, which writes:
|
|
28
|
+
|
|
29
|
+
- `~/.cache/agent-gateway/cli_config.json`
|
|
30
|
+
- `~/.cache/agent-gateway/sessions/<name>.json`
|
|
31
|
+
|
|
32
|
+
`--config-namespace cashnerd` writes under `~/.cache/cashnerd/` instead.
|
|
33
|
+
|
|
34
|
+
## Contract
|
|
35
|
+
|
|
36
|
+
The CLI sends `context.channel = "cli"` on every chat request. When `user_id`
|
|
37
|
+
is configured, it is sent as a top-level field on both `/api/chat/init` and
|
|
38
|
+
`/api/chat`. Tool approvals post `tool_call_id`, `nonce`, `approved`, and
|
|
39
|
+
`allow_tool_type`.
|
|
40
|
+
|
|
41
|
+
The default `BaseUrlPolicy` is intentionally strict: `http://127.0.0.1` only,
|
|
42
|
+
with no path, query, or fragment. Products that need a wider local policy can
|
|
43
|
+
inject `BaseUrlPolicy(allowed_schemes=..., allowed_hostnames=...)`.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# ai-agent-gateway-cli
|
|
2
|
+
|
|
3
|
+
Canonical Python dev CLI for the `ai-agent-gateway` HTTP/SSE protocol.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
python -m agent_gateway_cli login
|
|
9
|
+
python -m agent_gateway_cli chat "hello"
|
|
10
|
+
python -m agent_gateway_cli --config-namespace cashnerd login
|
|
11
|
+
python -m agent_gateway_cli --config-namespace cashnerd chat --session default "hello"
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The default config namespace is `agent-gateway`, which writes:
|
|
15
|
+
|
|
16
|
+
- `~/.cache/agent-gateway/cli_config.json`
|
|
17
|
+
- `~/.cache/agent-gateway/sessions/<name>.json`
|
|
18
|
+
|
|
19
|
+
`--config-namespace cashnerd` writes under `~/.cache/cashnerd/` instead.
|
|
20
|
+
|
|
21
|
+
## Contract
|
|
22
|
+
|
|
23
|
+
The CLI sends `context.channel = "cli"` on every chat request. When `user_id`
|
|
24
|
+
is configured, it is sent as a top-level field on both `/api/chat/init` and
|
|
25
|
+
`/api/chat`. Tool approvals post `tool_call_id`, `nonce`, `approved`, and
|
|
26
|
+
`allow_tool_type`.
|
|
27
|
+
|
|
28
|
+
The default `BaseUrlPolicy` is intentionally strict: `http://127.0.0.1` only,
|
|
29
|
+
with no path, query, or fragment. Products that need a wider local policy can
|
|
30
|
+
inject `BaseUrlPolicy(allowed_schemes=..., allowed_hostnames=...)`.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from .cli import DevChatCLI, main
|
|
4
|
+
from .config import BaseUrlPolicy, CLIConfig, CLIError
|
|
5
|
+
from .session import SessionState
|
|
6
|
+
from .transport import GatewaySession, GatewayTransport
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"BaseUrlPolicy",
|
|
11
|
+
"CLIConfig",
|
|
12
|
+
"CLIError",
|
|
13
|
+
"DevChatCLI",
|
|
14
|
+
"GatewaySession",
|
|
15
|
+
"GatewayTransport",
|
|
16
|
+
"SessionState",
|
|
17
|
+
"main",
|
|
18
|
+
]
|