macp-sdk-python 0.4.0__tar.gz → 0.4.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.
Files changed (39) hide show
  1. {macp_sdk_python-0.4.0/src/macp_sdk_python.egg-info → macp_sdk_python-0.4.1}/PKG-INFO +7 -2
  2. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/pyproject.toml +9 -2
  3. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/policy.py +36 -3
  4. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1/src/macp_sdk_python.egg-info}/PKG-INFO +7 -2
  5. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/LICENSE +0 -0
  6. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/README.md +0 -0
  7. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/setup.cfg +0 -0
  8. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/__init__.py +0 -0
  9. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/_logging.py +0 -0
  10. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/agent/__init__.py +0 -0
  11. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/agent/cancel_callback.py +0 -0
  12. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/agent/dispatcher.py +0 -0
  13. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/agent/participant.py +0 -0
  14. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/agent/runner.py +0 -0
  15. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/agent/strategies.py +0 -0
  16. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/agent/transports.py +0 -0
  17. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/agent/types.py +0 -0
  18. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/auth.py +0 -0
  19. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/base_projection.py +0 -0
  20. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/base_session.py +0 -0
  21. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/client.py +0 -0
  22. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/constants.py +0 -0
  23. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/decision.py +0 -0
  24. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/envelope.py +0 -0
  25. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/errors.py +0 -0
  26. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/handoff.py +0 -0
  27. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/projections.py +0 -0
  28. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/proposal.py +0 -0
  29. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/proto_registry.py +0 -0
  30. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/py.typed +0 -0
  31. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/quorum.py +0 -0
  32. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/retry.py +0 -0
  33. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/task.py +0 -0
  34. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/validation.py +0 -0
  35. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk/watchers.py +0 -0
  36. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk_python.egg-info/SOURCES.txt +0 -0
  37. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk_python.egg-info/dependency_links.txt +0 -0
  38. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk_python.egg-info/requires.txt +0 -0
  39. {macp_sdk_python-0.4.0 → macp_sdk_python-0.4.1}/src/macp_sdk_python.egg-info/top_level.txt +0 -0
@@ -1,9 +1,14 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: macp-sdk-python
3
- Version: 0.4.0
3
+ Version: 0.4.1
4
4
  Summary: Python SDK for the MACP Rust runtime
5
- Author-email: OpenAI <support@openai.com>
5
+ Author-email: Multi-Agent Coordination Protocol <macp@multiagentcoordinationprotocol.org>
6
6
  License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/multiagentcoordinationprotocol/macp-sdk-python
8
+ Project-URL: Repository, https://github.com/multiagentcoordinationprotocol/macp-sdk-python
9
+ Project-URL: Documentation, https://github.com/multiagentcoordinationprotocol/macp-sdk-python/tree/main/docs
10
+ Project-URL: Changelog, https://github.com/multiagentcoordinationprotocol/macp-sdk-python/blob/main/CHANGELOG.md
11
+ Project-URL: Bug Tracker, https://github.com/multiagentcoordinationprotocol/macp-sdk-python/issues
7
12
  Classifier: Development Status :: 3 - Alpha
8
13
  Classifier: Intended Audience :: Developers
9
14
  Classifier: License :: OSI Approved :: Apache Software License
@@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "macp-sdk-python"
7
- version = "0.4.0"
7
+ version = "0.4.1"
8
8
  description = "Python SDK for the MACP Rust runtime"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
11
11
  license = {text = "Apache-2.0"}
12
12
  authors = [
13
- {name = "OpenAI", email = "support@openai.com"}
13
+ {name = "Multi-Agent Coordination Protocol", email = "macp@multiagentcoordinationprotocol.org"}
14
14
  ]
15
15
  classifiers = [
16
16
  "Development Status :: 3 - Alpha",
@@ -37,6 +37,13 @@ dependencies = [
37
37
  "macp-proto>=0.1.3,<0.2.0",
38
38
  ]
39
39
 
40
+ [project.urls]
41
+ Homepage = "https://github.com/multiagentcoordinationprotocol/macp-sdk-python"
42
+ Repository = "https://github.com/multiagentcoordinationprotocol/macp-sdk-python"
43
+ Documentation = "https://github.com/multiagentcoordinationprotocol/macp-sdk-python/tree/main/docs"
44
+ Changelog = "https://github.com/multiagentcoordinationprotocol/macp-sdk-python/blob/main/CHANGELOG.md"
45
+ "Bug Tracker" = "https://github.com/multiagentcoordinationprotocol/macp-sdk-python/issues"
46
+
40
47
  [project.optional-dependencies]
41
48
  dev = [
42
49
  "grpcio-tools>=1.74.0", # only needed for proto-python package publishing
@@ -22,9 +22,20 @@ class CommitmentRules:
22
22
  authority: str = "initiator_only"
23
23
  designated_roles: list[str] = field(default_factory=list)
24
24
  require_vote_quorum: bool = False
25
+ # RFC-MACP-0012 schema_version 2, Decision mode only: when True, a
26
+ # reject-majority resolves the session with a committed *negative* outcome
27
+ # (``outcome_positive = false``) instead of denying commitment. Emitted only
28
+ # by ``build_decision_policy`` (see ``_commitment_dict`` note) so version-1
29
+ # quorum/proposal/task/handoff schemas are unaffected. Default False keeps
30
+ # version-1 behaviour for existing callers.
31
+ allow_decline_over_approval: bool = False
25
32
 
26
33
 
27
34
  def _commitment_dict(c: CommitmentRules) -> dict[str, object]:
35
+ # Shared by all five mode builders — intentionally excludes the Decision-only
36
+ # ``allow_decline_over_approval`` field so it does not leak into the still
37
+ # version-1 quorum/proposal/task/handoff commitment schemas. Decision emits
38
+ # that field itself in ``build_decision_policy``.
28
39
  return {
29
40
  "authority": c.authority,
30
41
  "designated_roles": c.designated_roles,
@@ -52,6 +63,12 @@ class ObjectionHandlingRules:
52
63
 
53
64
  critical_severity_vetoes: bool = False
54
65
  veto_threshold: int = 1
66
+ # RFC-MACP-0012 schema_version 2: action taken when a critical objection
67
+ # would block commitment. One of ``"deny"`` (reject the commitment; legacy
68
+ # default), ``"finalize_decline"`` (resolve the session as a negative
69
+ # outcome), or ``"hold"`` (leave the session open). Default ``"deny"``
70
+ # preserves version-1 behaviour.
71
+ critical_objection_action: str = "deny"
55
72
 
56
73
 
57
74
  @dataclass(frozen=True, slots=True)
@@ -80,22 +97,38 @@ def build_decision_policy(
80
97
  voting_section: dict[str, object] = {
81
98
  "algorithm": v.algorithm,
82
99
  "threshold": v.threshold,
83
- "quorum": {"type": v.quorum_type or "count", "value": v.quorum_value or 0},
84
100
  }
101
+ # Emit ``quorum`` only when the caller sets it, mirroring the conditional
102
+ # ``weights`` emission below. This keeps the Decision ``rules`` JSON
103
+ # byte-identical to the typescript-sdk builder (which omits an unset quorum)
104
+ # and to the canonical example descriptors, which drop optional voting fields
105
+ # they do not set. ``quorum`` is optional with defaults ``type="count"``,
106
+ # ``value=0`` in decision-rules.schema.json, so omission is schema-equivalent.
107
+ if v.quorum_type is not None or v.quorum_value is not None:
108
+ voting_section["quorum"] = {
109
+ "type": v.quorum_type or "count",
110
+ "value": v.quorum_value or 0,
111
+ }
85
112
  if v.weights is not None:
86
113
  voting_section["weights"] = v.weights
87
114
 
115
+ # Decision-only: extend the shared commitment rules with the schema_version 2
116
+ # decline-over-approval switch without polluting the other four builders.
117
+ commitment_section = _commitment_dict(c)
118
+ commitment_section["allow_decline_over_approval"] = c.allow_decline_over_approval
119
+
88
120
  rules: dict[str, object] = {
89
121
  "voting": voting_section,
90
122
  "objection_handling": {
91
123
  "critical_severity_vetoes": o.critical_severity_vetoes,
92
124
  "veto_threshold": o.veto_threshold,
125
+ "critical_objection_action": o.critical_objection_action,
93
126
  },
94
127
  "evaluation": {
95
128
  "minimum_confidence": e.minimum_confidence,
96
129
  "required_before_voting": e.required_before_voting,
97
130
  },
98
- "commitment": _commitment_dict(c),
131
+ "commitment": commitment_section,
99
132
  }
100
133
 
101
134
  return policy_pb2.PolicyDescriptor(
@@ -103,7 +136,7 @@ def build_decision_policy(
103
136
  mode="macp.mode.decision.v1",
104
137
  description=description,
105
138
  rules=json.dumps(rules).encode(),
106
- schema_version=1,
139
+ schema_version=2,
107
140
  )
108
141
 
109
142
 
@@ -1,9 +1,14 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: macp-sdk-python
3
- Version: 0.4.0
3
+ Version: 0.4.1
4
4
  Summary: Python SDK for the MACP Rust runtime
5
- Author-email: OpenAI <support@openai.com>
5
+ Author-email: Multi-Agent Coordination Protocol <macp@multiagentcoordinationprotocol.org>
6
6
  License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/multiagentcoordinationprotocol/macp-sdk-python
8
+ Project-URL: Repository, https://github.com/multiagentcoordinationprotocol/macp-sdk-python
9
+ Project-URL: Documentation, https://github.com/multiagentcoordinationprotocol/macp-sdk-python/tree/main/docs
10
+ Project-URL: Changelog, https://github.com/multiagentcoordinationprotocol/macp-sdk-python/blob/main/CHANGELOG.md
11
+ Project-URL: Bug Tracker, https://github.com/multiagentcoordinationprotocol/macp-sdk-python/issues
7
12
  Classifier: Development Status :: 3 - Alpha
8
13
  Classifier: Intended Audience :: Developers
9
14
  Classifier: License :: OSI Approved :: Apache Software License
File without changes