agentconnect-cli 0.1.0a1__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 (64) hide show
  1. agentconnect_cli-0.1.0a1/PKG-INFO +103 -0
  2. agentconnect_cli-0.1.0a1/README.md +85 -0
  3. agentconnect_cli-0.1.0a1/pyproject.toml +32 -0
  4. agentconnect_cli-0.1.0a1/pyproject.toml.orig +33 -0
  5. agentconnect_cli-0.1.0a1/src/agentconnect/__init__.py +3 -0
  6. agentconnect_cli-0.1.0a1/src/agentconnect/a2a_adapter/__init__.py +6 -0
  7. agentconnect_cli-0.1.0a1/src/agentconnect/a2a_adapter/adapter.py +565 -0
  8. agentconnect_cli-0.1.0a1/src/agentconnect/a2a_adapter/cards.py +149 -0
  9. agentconnect_cli-0.1.0a1/src/agentconnect/a2a_adapter/convert.py +157 -0
  10. agentconnect_cli-0.1.0a1/src/agentconnect/a2a_adapter/facade.py +560 -0
  11. agentconnect_cli-0.1.0a1/src/agentconnect/a2a_adapter/seen.py +49 -0
  12. agentconnect_cli-0.1.0a1/src/agentconnect/a2a_adapter/serve.py +67 -0
  13. agentconnect_cli-0.1.0a1/src/agentconnect/adapter.py +319 -0
  14. agentconnect_cli-0.1.0a1/src/agentconnect/adapters.py +52 -0
  15. agentconnect_cli-0.1.0a1/src/agentconnect/apiclient.py +51 -0
  16. agentconnect_cli-0.1.0a1/src/agentconnect/backoff.py +42 -0
  17. agentconnect_cli-0.1.0a1/src/agentconnect/callback.py +314 -0
  18. agentconnect_cli-0.1.0a1/src/agentconnect/cli.py +2324 -0
  19. agentconnect_cli-0.1.0a1/src/agentconnect/cli_json.py +470 -0
  20. agentconnect_cli-0.1.0a1/src/agentconnect/cli_support.py +444 -0
  21. agentconnect_cli-0.1.0a1/src/agentconnect/clock.py +161 -0
  22. agentconnect_cli-0.1.0a1/src/agentconnect/config.py +1213 -0
  23. agentconnect_cli-0.1.0a1/src/agentconnect/daemon/__init__.py +41 -0
  24. agentconnect_cli-0.1.0a1/src/agentconnect/deliveries.py +295 -0
  25. agentconnect_cli-0.1.0a1/src/agentconnect/directory_client.py +255 -0
  26. agentconnect_cli-0.1.0a1/src/agentconnect/failpoints.py +99 -0
  27. agentconnect_cli-0.1.0a1/src/agentconnect/identity.py +111 -0
  28. agentconnect_cli-0.1.0a1/src/agentconnect/isolation.py +345 -0
  29. agentconnect_cli-0.1.0a1/src/agentconnect/keystore.py +279 -0
  30. agentconnect_cli-0.1.0a1/src/agentconnect/limits.py +457 -0
  31. agentconnect_cli-0.1.0a1/src/agentconnect/log.py +143 -0
  32. agentconnect_cli-0.1.0a1/src/agentconnect/mcp/__init__.py +30 -0
  33. agentconnect_cli-0.1.0a1/src/agentconnect/mcp/backend.py +405 -0
  34. agentconnect_cli-0.1.0a1/src/agentconnect/mcp/server.py +382 -0
  35. agentconnect_cli-0.1.0a1/src/agentconnect/mcp/session.py +373 -0
  36. agentconnect_cli-0.1.0a1/src/agentconnect/mcp/tools.py +583 -0
  37. agentconnect_cli-0.1.0a1/src/agentconnect/ownerfile.py +238 -0
  38. agentconnect_cli-0.1.0a1/src/agentconnect/payloads.py +109 -0
  39. agentconnect_cli-0.1.0a1/src/agentconnect/policy.py +1066 -0
  40. agentconnect_cli-0.1.0a1/src/agentconnect/provision.py +239 -0
  41. agentconnect_cli-0.1.0a1/src/agentconnect/py.typed +0 -0
  42. agentconnect_cli-0.1.0a1/src/agentconnect/relay.py +405 -0
  43. agentconnect_cli-0.1.0a1/src/agentconnect/runtime/__init__.py +46 -0
  44. agentconnect_cli-0.1.0a1/src/agentconnect/runtime/agent.py +225 -0
  45. agentconnect_cli-0.1.0a1/src/agentconnect/runtime/api.py +2043 -0
  46. agentconnect_cli-0.1.0a1/src/agentconnect/runtime/engine.py +5359 -0
  47. agentconnect_cli-0.1.0a1/src/agentconnect/runtime/errors.py +47 -0
  48. agentconnect_cli-0.1.0a1/src/agentconnect/runtime/floor.py +649 -0
  49. agentconnect_cli-0.1.0a1/src/agentconnect/runtime/groups.py +1351 -0
  50. agentconnect_cli-0.1.0a1/src/agentconnect/runtime/knocks.py +1422 -0
  51. agentconnect_cli-0.1.0a1/src/agentconnect/runtime/ledger.py +94 -0
  52. agentconnect_cli-0.1.0a1/src/agentconnect/runtime/listing.py +1307 -0
  53. agentconnect_cli-0.1.0a1/src/agentconnect/runtime/registry.py +53 -0
  54. agentconnect_cli-0.1.0a1/src/agentconnect/runtime/runtime.py +158 -0
  55. agentconnect_cli-0.1.0a1/src/agentconnect/runtime/sas.py +1002 -0
  56. agentconnect_cli-0.1.0a1/src/agentconnect/sas_emoji.py +83 -0
  57. agentconnect_cli-0.1.0a1/src/agentconnect/schemas.py +381 -0
  58. agentconnect_cli-0.1.0a1/src/agentconnect/shapes.py +56 -0
  59. agentconnect_cli-0.1.0a1/src/agentconnect/sockets.py +86 -0
  60. agentconnect_cli-0.1.0a1/src/agentconnect/sse.py +234 -0
  61. agentconnect_cli-0.1.0a1/src/agentconnect/store.py +3282 -0
  62. agentconnect_cli-0.1.0a1/src/agentconnect/tasks.py +35 -0
  63. agentconnect_cli-0.1.0a1/src/agentconnect/tokens.py +63 -0
  64. agentconnect_cli-0.1.0a1/src/agentconnect/webhook.py +199 -0
@@ -0,0 +1,103 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentconnect-cli
3
+ Version: 0.1.0a1
4
+ Summary: AgentConnect daemon (agentconnectd) and CLI
5
+ License-Expression: Apache-2.0
6
+ Requires-Dist: a2a-sdk[http-server,signing]>=1.2.2
7
+ Requires-Dist: agentconnect-core==0.1.0a1
8
+ Requires-Dist: httpx>=0.28.1
9
+ Requires-Dist: keyring>=25.7.0
10
+ Requires-Dist: mcp>=2.3.0
11
+ Requires-Dist: pyjwt[crypto]>=2.15.1
12
+ Requires-Dist: structlog>=26.1.0
13
+ Requires-Dist: typer>=0.27.3
14
+ Requires-Dist: uvicorn>=0.54.0
15
+ Requires-Dist: websockets>=17.2
16
+ Requires-Python: >=3.12
17
+ Description-Content-Type: text/markdown
18
+
19
+ # agentconnect-cli
20
+
21
+ The AgentConnect daemon (`agentconnectd`) and CLI (`agentconnect`). The
22
+ distribution is `agentconnect-cli`; the command and the import package are
23
+ `agentconnect`. See the repository [README](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/README.md) and
24
+ [SPEC.md](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/SPEC.md).
25
+
26
+ ```sh
27
+ agentconnect daemon run [--config PATH] [--tcp-port N] # foreground, JSON logs on stderr
28
+ agentconnect status [--json] # reads the local API
29
+ ```
30
+
31
+ Everything protocol-related is in the runtime, `agentconnect.runtime`
32
+ (`Runtime`, with its engine, local API, adapters and agent-scope
33
+ `AgentApi`). `agentconnectd` (`agentconnect.daemon`) is one host of it; the
34
+ Python SDK's embedded mode (`AgentConnect.embedded`, [docs/sdk.md](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/docs/sdk.md))
35
+ is the other. Both run the same checks, and both serve the local API below.
36
+
37
+ The invite lifecycle (`group`, `invite`, `accept`, `groups`, `approvals`,
38
+ `verify`, `leave`, `send`, `events`) is documented in
39
+ [docs/cli.md](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/docs/cli.md), with the `--json` schemas and exit codes.
40
+ `approvals approve`, `approvals reject` and `verify` use the human token:
41
+ **never give an agent the human token or let it run those commands for the
42
+ human.**
43
+
44
+ Don't give agents shell or file access to the data directory either: an
45
+ agent that can read it can approve joins and mark codes verified as you,
46
+ because the human token is a file there. Agents that need a shell can run
47
+ as another OS user, with the daemon under a user of its own
48
+ ([docs/isolation.md](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/docs/isolation.md)).
49
+
50
+ ## What the daemon holds
51
+
52
+ - One identity and one instance, created on first start, in the OS keyring
53
+ when one is usable and otherwise in 0600 key files (`keystore = "auto" |
54
+ "keyring" | "file"`).
55
+ - The core's MLS state in `mls.sqlite3`, a SQLCipher database encrypted
56
+ under a `db_key` from the same keystore.
57
+ - Its own `daemon.sqlite3`: groups, members (with the local *verified*
58
+ flag), Agent Cards, out-of-sync flags, and the durable outbox and inbox.
59
+ It is a SQLCipher database too, under a key the core derives from
60
+ `db_key` (ADR-003). Plaintext stays only while it is needed: an outbox
61
+ row keeps only its ids once the relay has answered it, and an inbox row
62
+ drops its message once the adapter has accepted it.
63
+
64
+ The data directory (`~/.local/share/agentconnect`) is 0700 and every file in
65
+ it 0600. Configuration is `~/.config/agentconnect/config.toml`; see
66
+ [docs/config.md](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/docs/config.md) for the keys and the `AC_*` overrides.
67
+
68
+ ## Local control API
69
+
70
+ JSON over HTTP/1.1 on a Unix socket in the data directory, or on
71
+ `127.0.0.1:<port>`. Every request needs `Authorization: Bearer <token>`.
72
+ [docs/api.md](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/docs/api.md) describes the transport, tokens, errors and
73
+ every route with its request and response shapes.
74
+
75
+ Two tokens live in the data directory: `api-token` (agent scope) and
76
+ `human-token` (human scope, also accepted for everything else). Approving a
77
+ join and marking a member verified are human decisions (SPEC §6.2, §11): an
78
+ agent that could approve its own joins, or mark the short code as compared,
79
+ would remove exactly the checks that catch a leaked link or a relay in the
80
+ middle. Give agent tooling only `api-token`. Both files belong to the same OS
81
+ user, so the split keeps the human capability out of agent integrations by
82
+ default; it is not a sandbox.
83
+
84
+ Invite secrets never leave the daemon: the URL is returned to the caller and
85
+ the relay only receives the public invite metadata.
86
+
87
+ ## Adapters
88
+
89
+ `agentconnect.adapter.Adapter` is the interface for agent integrations:
90
+ `deliver(group, sender, to, inner) -> ack | retry`, `on_event(group, event)`,
91
+ `on_outbound(send)` and `capabilities()`. Every delivery carries the SPEC
92
+ §10.1 untrusted framing. A relay frame is acknowledged only after the core
93
+ processed it and the adapter accepted the resulting delivery.
94
+
95
+ Delivery is **at least once**: after a crash, `deliver` and `on_event` may
96
+ repeat a message or an event. Every delivery has a stable `msg_id` and every
97
+ event a stable `event_id`; deduplicate by them. Nothing is lost: an event is
98
+ recorded before the adapter hears of it and sent again on restart until
99
+ `on_event` returns (ADR-004).
100
+ The webhook adapter ([docs/adapters/webhook.md](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/docs/adapters/webhook.md)) and the SSE adapter (`GET /v0/events`, [docs/api.md](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/docs/api.md#event-stream)) serve headless agents.
101
+ `CallbackAdapter` (`agentconnect.callback`) is the embedded SDK's in-process adapter, with the webhook's retry rules. `RecordingAdapter` is the in-memory adapter used by tests. Every message in
102
+ and out goes through the safety policy (`agentconnect.policy`) before any
103
+ adapter sees it ([docs/safety.md](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/docs/safety.md)).
@@ -0,0 +1,85 @@
1
+ # agentconnect-cli
2
+
3
+ The AgentConnect daemon (`agentconnectd`) and CLI (`agentconnect`). The
4
+ distribution is `agentconnect-cli`; the command and the import package are
5
+ `agentconnect`. See the repository [README](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/README.md) and
6
+ [SPEC.md](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/SPEC.md).
7
+
8
+ ```sh
9
+ agentconnect daemon run [--config PATH] [--tcp-port N] # foreground, JSON logs on stderr
10
+ agentconnect status [--json] # reads the local API
11
+ ```
12
+
13
+ Everything protocol-related is in the runtime, `agentconnect.runtime`
14
+ (`Runtime`, with its engine, local API, adapters and agent-scope
15
+ `AgentApi`). `agentconnectd` (`agentconnect.daemon`) is one host of it; the
16
+ Python SDK's embedded mode (`AgentConnect.embedded`, [docs/sdk.md](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/docs/sdk.md))
17
+ is the other. Both run the same checks, and both serve the local API below.
18
+
19
+ The invite lifecycle (`group`, `invite`, `accept`, `groups`, `approvals`,
20
+ `verify`, `leave`, `send`, `events`) is documented in
21
+ [docs/cli.md](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/docs/cli.md), with the `--json` schemas and exit codes.
22
+ `approvals approve`, `approvals reject` and `verify` use the human token:
23
+ **never give an agent the human token or let it run those commands for the
24
+ human.**
25
+
26
+ Don't give agents shell or file access to the data directory either: an
27
+ agent that can read it can approve joins and mark codes verified as you,
28
+ because the human token is a file there. Agents that need a shell can run
29
+ as another OS user, with the daemon under a user of its own
30
+ ([docs/isolation.md](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/docs/isolation.md)).
31
+
32
+ ## What the daemon holds
33
+
34
+ - One identity and one instance, created on first start, in the OS keyring
35
+ when one is usable and otherwise in 0600 key files (`keystore = "auto" |
36
+ "keyring" | "file"`).
37
+ - The core's MLS state in `mls.sqlite3`, a SQLCipher database encrypted
38
+ under a `db_key` from the same keystore.
39
+ - Its own `daemon.sqlite3`: groups, members (with the local *verified*
40
+ flag), Agent Cards, out-of-sync flags, and the durable outbox and inbox.
41
+ It is a SQLCipher database too, under a key the core derives from
42
+ `db_key` (ADR-003). Plaintext stays only while it is needed: an outbox
43
+ row keeps only its ids once the relay has answered it, and an inbox row
44
+ drops its message once the adapter has accepted it.
45
+
46
+ The data directory (`~/.local/share/agentconnect`) is 0700 and every file in
47
+ it 0600. Configuration is `~/.config/agentconnect/config.toml`; see
48
+ [docs/config.md](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/docs/config.md) for the keys and the `AC_*` overrides.
49
+
50
+ ## Local control API
51
+
52
+ JSON over HTTP/1.1 on a Unix socket in the data directory, or on
53
+ `127.0.0.1:<port>`. Every request needs `Authorization: Bearer <token>`.
54
+ [docs/api.md](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/docs/api.md) describes the transport, tokens, errors and
55
+ every route with its request and response shapes.
56
+
57
+ Two tokens live in the data directory: `api-token` (agent scope) and
58
+ `human-token` (human scope, also accepted for everything else). Approving a
59
+ join and marking a member verified are human decisions (SPEC §6.2, §11): an
60
+ agent that could approve its own joins, or mark the short code as compared,
61
+ would remove exactly the checks that catch a leaked link or a relay in the
62
+ middle. Give agent tooling only `api-token`. Both files belong to the same OS
63
+ user, so the split keeps the human capability out of agent integrations by
64
+ default; it is not a sandbox.
65
+
66
+ Invite secrets never leave the daemon: the URL is returned to the caller and
67
+ the relay only receives the public invite metadata.
68
+
69
+ ## Adapters
70
+
71
+ `agentconnect.adapter.Adapter` is the interface for agent integrations:
72
+ `deliver(group, sender, to, inner) -> ack | retry`, `on_event(group, event)`,
73
+ `on_outbound(send)` and `capabilities()`. Every delivery carries the SPEC
74
+ §10.1 untrusted framing. A relay frame is acknowledged only after the core
75
+ processed it and the adapter accepted the resulting delivery.
76
+
77
+ Delivery is **at least once**: after a crash, `deliver` and `on_event` may
78
+ repeat a message or an event. Every delivery has a stable `msg_id` and every
79
+ event a stable `event_id`; deduplicate by them. Nothing is lost: an event is
80
+ recorded before the adapter hears of it and sent again on restart until
81
+ `on_event` returns (ADR-004).
82
+ The webhook adapter ([docs/adapters/webhook.md](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/docs/adapters/webhook.md)) and the SSE adapter (`GET /v0/events`, [docs/api.md](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/docs/api.md#event-stream)) serve headless agents.
83
+ `CallbackAdapter` (`agentconnect.callback`) is the embedded SDK's in-process adapter, with the webhook's retry rules. `RecordingAdapter` is the in-memory adapter used by tests. Every message in
84
+ and out goes through the safety policy (`agentconnect.policy`) before any
85
+ adapter sees it ([docs/safety.md](https://github.com/mbocevski/agent-connect/blob/v0.1.0a1/docs/safety.md)).
@@ -0,0 +1,32 @@
1
+ [project]
2
+ name = "agentconnect-cli"
3
+ version = "0.1.0a1"
4
+ description = "AgentConnect daemon (agentconnectd) and CLI"
5
+ readme = "README.md"
6
+ license = "Apache-2.0"
7
+ requires-python = ">=3.12"
8
+ dependencies = [
9
+ "a2a-sdk[http-server,signing]>=1.2.2",
10
+ "agentconnect-core==0.1.0a1",
11
+ "httpx>=0.28.1",
12
+ "keyring>=25.7.0",
13
+ "mcp>=2.3.0",
14
+ "pyjwt[crypto]>=2.15.1",
15
+ "structlog>=26.1.0",
16
+ "typer>=0.27.3",
17
+ "uvicorn>=0.54.0",
18
+ "websockets>=17.2",
19
+ ]
20
+
21
+ [project.scripts]
22
+ agentconnect = "agentconnect.cli:app"
23
+
24
+ [tool.uv.sources.agentconnect-core]
25
+ workspace = true
26
+
27
+ [tool.uv.build-backend]
28
+ module-name = "agentconnect"
29
+
30
+ [build-system]
31
+ requires = ["uv_build>=0.13.1,<0.14"]
32
+ build-backend = "uv_build"
@@ -0,0 +1,33 @@
1
+ [project]
2
+ name = "agentconnect-cli"
3
+ version = "0.1.0a1"
4
+ description = "AgentConnect daemon (agentconnectd) and CLI"
5
+ readme = "README.md"
6
+ license = "Apache-2.0"
7
+ requires-python = ">=3.12"
8
+ dependencies = [
9
+ "a2a-sdk[http-server,signing]>=1.2.2",
10
+ "agentconnect-core==0.1.0a1",
11
+ "httpx>=0.28.1",
12
+ "keyring>=25.7.0",
13
+ "mcp>=2.3.0",
14
+ "pyjwt[crypto]>=2.15.1",
15
+ "structlog>=26.1.0",
16
+ "typer>=0.27.3",
17
+ "uvicorn>=0.54.0",
18
+ "websockets>=17.2",
19
+ ]
20
+
21
+ [project.scripts]
22
+ agentconnect = "agentconnect.cli:app"
23
+
24
+ [tool.uv.sources]
25
+ agentconnect-core = { workspace = true }
26
+
27
+ # The distribution is agentconnect-cli; the import package stays agentconnect.
28
+ [tool.uv.build-backend]
29
+ module-name = "agentconnect"
30
+
31
+ [build-system]
32
+ requires = ["uv_build>=0.13.1,<0.14"]
33
+ build-backend = "uv_build"
@@ -0,0 +1,3 @@
1
+ """AgentConnect daemon and CLI."""
2
+
3
+ __version__ = "0.1.0a1"
@@ -0,0 +1,6 @@
1
+ """The A2A adapter (docs/adapters/a2a.md): A2A v1.0 server agents in groups,
2
+ and an A2A server facade on loopback for local A2A clients."""
3
+
4
+ from agentconnect.a2a_adapter.adapter import A2AAdapter, A2AOptions
5
+
6
+ __all__ = ["A2AAdapter", "A2AOptions"]