macp-sdk-python 0.2.2__tar.gz → 0.2.3__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 (38) hide show
  1. {macp_sdk_python-0.2.2/src/macp_sdk_python.egg-info → macp_sdk_python-0.2.3}/PKG-INFO +3 -3
  2. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/README.md +1 -1
  3. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/pyproject.toml +7 -4
  4. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/agent/transports.py +6 -0
  5. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/client.py +20 -3
  6. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3/src/macp_sdk_python.egg-info}/PKG-INFO +3 -3
  7. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk_python.egg-info/requires.txt +1 -1
  8. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/LICENSE +0 -0
  9. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/setup.cfg +0 -0
  10. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/__init__.py +0 -0
  11. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/_logging.py +0 -0
  12. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/agent/__init__.py +0 -0
  13. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/agent/dispatcher.py +0 -0
  14. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/agent/participant.py +0 -0
  15. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/agent/runner.py +0 -0
  16. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/agent/strategies.py +0 -0
  17. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/agent/types.py +0 -0
  18. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/auth.py +0 -0
  19. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/base_projection.py +0 -0
  20. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/base_session.py +0 -0
  21. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/constants.py +0 -0
  22. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/decision.py +0 -0
  23. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/envelope.py +0 -0
  24. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/errors.py +0 -0
  25. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/handoff.py +0 -0
  26. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/policy.py +0 -0
  27. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/projections.py +0 -0
  28. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/proposal.py +0 -0
  29. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/proto_registry.py +0 -0
  30. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/py.typed +0 -0
  31. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/quorum.py +0 -0
  32. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/retry.py +0 -0
  33. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/task.py +0 -0
  34. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/validation.py +0 -0
  35. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk/watchers.py +0 -0
  36. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk_python.egg-info/SOURCES.txt +0 -0
  37. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk_python.egg-info/dependency_links.txt +0 -0
  38. {macp_sdk_python-0.2.2 → macp_sdk_python-0.2.3}/src/macp_sdk_python.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: macp-sdk-python
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Python SDK for the MACP Rust runtime
5
5
  Author-email: OpenAI <support@openai.com>
6
6
  License: Apache-2.0
@@ -17,7 +17,7 @@ Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
18
  Requires-Dist: grpcio>=1.74.0
19
19
  Requires-Dist: protobuf>=5.27.0
20
- Requires-Dist: macp-proto<0.2.0,>=0.1.1
20
+ Requires-Dist: macp-proto<0.2.0,>=0.1.2
21
21
  Provides-Extra: dev
22
22
  Requires-Dist: grpcio-tools>=1.74.0; extra == "dev"
23
23
  Requires-Dist: pytest>=8.0; extra == "dev"
@@ -161,5 +161,5 @@ Business logic — voting rules, AI decision heuristics, policy enforcement —
161
161
  ## Known runtime limitations
162
162
 
163
163
  - `GetSession` returns metadata only (not mode state/transcript) — hence the local projection pattern
164
- - `StreamSession` has no late-attach handshake for already-running sessions
164
+ - `StreamSession` is scoped to one session per stream; use `MacpStream.send_subscribe(session_id)` (RFC-MACP-0006-A1, since SDK 0.2.3 / `macp-proto 0.1.2`) to replay accepted history before live broadcast
165
165
  - Business policy (majority, quorum, veto) belongs in your orchestrator/policy layer
@@ -127,5 +127,5 @@ Business logic — voting rules, AI decision heuristics, policy enforcement —
127
127
  ## Known runtime limitations
128
128
 
129
129
  - `GetSession` returns metadata only (not mode state/transcript) — hence the local projection pattern
130
- - `StreamSession` has no late-attach handshake for already-running sessions
130
+ - `StreamSession` is scoped to one session per stream; use `MacpStream.send_subscribe(session_id)` (RFC-MACP-0006-A1, since SDK 0.2.3 / `macp-proto 0.1.2`) to replay accepted history before live broadcast
131
131
  - Business policy (majority, quorum, veto) belongs in your orchestrator/policy layer
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "macp-sdk-python"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  description = "Python SDK for the MACP Rust runtime"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -25,9 +25,12 @@ classifiers = [
25
25
  dependencies = [
26
26
  "grpcio>=1.74.0",
27
27
  "protobuf>=5.27.0",
28
- # Requires 0.1.1+ for context_id / extensions fields on SessionStartPayload.
29
- # See docs/contributing.md "Bumping macp-proto".
30
- "macp-proto>=0.1.1,<0.2.0",
28
+ # Requires 0.1.2+ for the RFC-MACP-0006-A1 subscribe_session_id /
29
+ # after_sequence fields on StreamSessionRequest (used by MacpStream
30
+ # .send_subscribe and the gRPC agent transport adapter). 0.1.1 is
31
+ # the earlier baseline for the context_id / extensions fields on
32
+ # SessionStartPayload. See docs/contributing.md "Bumping macp-proto".
33
+ "macp-proto>=0.1.2,<0.2.0",
31
34
  ]
32
35
 
33
36
  [project.optional-dependencies]
@@ -53,6 +53,12 @@ class GrpcTransportAdapter:
53
53
  """Open a stream and yield messages for the target session."""
54
54
  self._stream = self._client.open_stream(auth=self._auth, timeout=self._timeout)
55
55
  try:
56
+ # RFC-MACP-0006-A1: Subscribe to the session with history replay.
57
+ # The runtime replays accepted envelopes then switches to live
58
+ # broadcast, ensuring non-initiator agents receive SessionStart +
59
+ # Proposal regardless of spawn order or connection timing.
60
+ self._stream.send_subscribe(self._session_id)
61
+
56
62
  for envelope in self._stream.responses():
57
63
  if self._stopped:
58
64
  break
@@ -101,8 +101,12 @@ class MacpStream:
101
101
  item = self._requests.get()
102
102
  if item is self._END:
103
103
  return
104
- assert isinstance(item, envelope_pb2.Envelope)
105
- yield core_pb2.StreamSessionRequest(envelope=item)
104
+ # RFC-MACP-0006-A1: support both envelope sends and subscribe frames
105
+ if isinstance(item, core_pb2.StreamSessionRequest):
106
+ yield item
107
+ else:
108
+ assert isinstance(item, envelope_pb2.Envelope)
109
+ yield core_pb2.StreamSessionRequest(envelope=item)
106
110
 
107
111
  def _pump_responses(self) -> None:
108
112
  try:
@@ -147,6 +151,19 @@ class MacpStream:
147
151
  raise MacpSdkError("stream is already closed")
148
152
  self._requests.put(envelope)
149
153
 
154
+ def send_subscribe(self, session_id: str, after_sequence: int = 0) -> None:
155
+ """RFC-MACP-0006-A1: Send a subscribe-only frame to receive session
156
+ history + live broadcast. The runtime replays accepted envelopes from
157
+ ``after_sequence`` onwards, then continues with live broadcast.
158
+ """
159
+ if self._closed:
160
+ raise MacpSdkError("stream is already closed")
161
+ req = core_pb2.StreamSessionRequest(
162
+ subscribe_session_id=session_id,
163
+ after_sequence=after_sequence,
164
+ )
165
+ self._requests.put(req)
166
+
150
167
  def read(self, timeout: float | None = None) -> envelope_pb2.Envelope | None:
151
168
  item = self._responses.get(timeout=timeout)
152
169
  if item is self._END:
@@ -190,7 +207,7 @@ class MacpClient:
190
207
  root_certificates: bytes | None = None,
191
208
  default_timeout: float | None = None,
192
209
  client_name: str = "macp-sdk-python",
193
- client_version: str = "0.2.2",
210
+ client_version: str = "0.2.3",
194
211
  ) -> None:
195
212
  if secure is None:
196
213
  secure = not allow_insecure
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: macp-sdk-python
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Python SDK for the MACP Rust runtime
5
5
  Author-email: OpenAI <support@openai.com>
6
6
  License: Apache-2.0
@@ -17,7 +17,7 @@ Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
18
  Requires-Dist: grpcio>=1.74.0
19
19
  Requires-Dist: protobuf>=5.27.0
20
- Requires-Dist: macp-proto<0.2.0,>=0.1.1
20
+ Requires-Dist: macp-proto<0.2.0,>=0.1.2
21
21
  Provides-Extra: dev
22
22
  Requires-Dist: grpcio-tools>=1.74.0; extra == "dev"
23
23
  Requires-Dist: pytest>=8.0; extra == "dev"
@@ -161,5 +161,5 @@ Business logic — voting rules, AI decision heuristics, policy enforcement —
161
161
  ## Known runtime limitations
162
162
 
163
163
  - `GetSession` returns metadata only (not mode state/transcript) — hence the local projection pattern
164
- - `StreamSession` has no late-attach handshake for already-running sessions
164
+ - `StreamSession` is scoped to one session per stream; use `MacpStream.send_subscribe(session_id)` (RFC-MACP-0006-A1, since SDK 0.2.3 / `macp-proto 0.1.2`) to replay accepted history before live broadcast
165
165
  - Business policy (majority, quorum, veto) belongs in your orchestrator/policy layer
@@ -1,6 +1,6 @@
1
1
  grpcio>=1.74.0
2
2
  protobuf>=5.27.0
3
- macp-proto<0.2.0,>=0.1.1
3
+ macp-proto<0.2.0,>=0.1.2
4
4
 
5
5
  [dev]
6
6
  grpcio-tools>=1.74.0
File without changes