plan-manager-client 0.2.154__tar.gz → 0.2.156__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 (44) hide show
  1. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/PKG-INFO +1 -1
  2. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/authoring_diagnostics.py +6 -1
  3. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/facade_context_gate_mixin.py +42 -32
  4. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/facade_runtime_mixin/authoring_part.py +48 -3
  5. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/facade_runtime_mixin/facade.py +9 -3
  6. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/server_api.py +10 -2
  7. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/server_api_mutating.py +7 -1
  8. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client.egg-info/PKG-INFO +1 -1
  9. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/tests/test_contract_facade_passthrough.py +20 -4
  10. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/__init__.py +0 -0
  11. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/_version.py +0 -0
  12. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/client.py +0 -0
  13. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/config.py +0 -0
  14. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/delivery/__init__.py +0 -0
  15. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/delivery/archive.py +0 -0
  16. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/delivery/atomicity.py +0 -0
  17. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/delivery/commit.py +0 -0
  18. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/delivery/destination.py +0 -0
  19. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/delivery/provenance.py +0 -0
  20. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/delivery/upload.py +0 -0
  21. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/dispatch.py +0 -0
  22. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/export_fetch_chunks.py +0 -0
  23. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/export_fetch_request.py +0 -0
  24. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/export_fetch_unpack.py +0 -0
  25. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/export_fetch_verify.py +0 -0
  26. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/facade_agent_config_mixin.py +0 -0
  27. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/facade_bug_project_mixin.py +0 -0
  28. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/facade_entity_common_mixin.py +0 -0
  29. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/facade_hrs_file_mixin.py +0 -0
  30. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/facade_plan_hrs_mixin.py +0 -0
  31. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/facade_runtime_mixin/__init__.py +0 -0
  32. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/facade_runtime_mixin/overlay_part.py +0 -0
  33. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/facade_step_graph_mixin.py +0 -0
  34. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/id_rule.py +0 -0
  35. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/info_walker.py +0 -0
  36. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client/scenario_runtime.py +0 -0
  37. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client.egg-info/SOURCES.txt +0 -0
  38. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client.egg-info/dependency_links.txt +0 -0
  39. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client.egg-info/requires.txt +0 -0
  40. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/plan_manager_client.egg-info/top_level.txt +0 -0
  41. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/pyproject.toml +0 -0
  42. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/setup.cfg +0 -0
  43. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/tests/test_client_server_api_sync.py +0 -0
  44. {plan_manager_client-0.2.154 → plan_manager_client-0.2.156}/tests/test_dispatch_validation_error_classification.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plan-manager-client
3
- Version: 0.2.154
3
+ Version: 0.2.156
4
4
  Summary: First-class client library for the plan_manager JSON-RPC API: full command-surface facade plus export delivery module boundary.
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: mcp-proxy-adapter==8.11.9
@@ -17,11 +17,16 @@ AUTHORING_DIAGNOSTIC_COMMANDS = frozenset(
17
17
  "authoring_job_resume",
18
18
  "authoring_job_stop",
19
19
  "authoring_job_delete",
20
+ "authoring_job_get",
21
+ "authoring_job_update",
20
22
  "authoring_child_list",
21
23
  "authoring_step_submit",
22
24
  "authoring_escalate",
23
- "plan_prompt_set",
25
+ "plan_prompt_create",
24
26
  "plan_prompt_get",
27
+ "plan_prompt_list",
28
+ "plan_prompt_update",
29
+ "plan_prompt_delete",
25
30
  "plan_model_mapping_set",
26
31
  "plan_model_mapping_get",
27
32
  "authoring_usage_get",
@@ -23,43 +23,53 @@ class ContextGateCommandsMixin:
23
23
  """Assemble a paginated page of the deterministic, deduplicated prompt-chain artifact for a gate-green plan scope."""
24
24
  return await self._call("plan_prompt_chain", params)
25
25
 
26
- async def plan_prompt_set(
27
- self,
28
- plan: str,
29
- role: str,
30
- prompt_text: str,
31
- expected_plan_revision: str,
32
- idempotency_key: str,
33
- ) -> Any:
34
- """Persist a role-scoped prompt and bind it to a plan header."""
35
- return await self._call(
36
- "plan_prompt_set",
37
- {
38
- "plan": plan,
39
- "role": role,
40
- "prompt_text": prompt_text,
41
- "expected_plan_revision": expected_plan_revision,
42
- "idempotency_key": idempotency_key,
43
- },
44
- )
45
-
46
- async def plan_prompt_get(self, plan: str, role: str) -> Any:
47
- """Retrieve current text for a role-scoped plan prompt."""
48
- return await self._call("plan_prompt_get", {"plan": plan, "role": role})
49
-
50
- async def plan_contract_set(self, **params: Any) -> Any:
51
- """Declare or clear (empty documents) the external-API contract documents of a mutable plan.
52
-
53
- Parameters are passed through unchanged (plan, documents, expected_contract_revision,
54
- changed_by, idempotency_key) so that a missing or invalid argument is refused by the server
55
- with the adapter's -32602 violation, not by a Python TypeError.
26
+ async def plan_prompt_create(self, **params: Any) -> Any:
27
+ """Create the role prompt of a plan (plan, role, prompt_text, changed_by, idempotency_key; passed through).
28
+
29
+ The server answers a missing or invalid argument with the adapter's -32602 violation, not a Python TypeError.
56
30
  """
57
- return await self._call("plan_contract_set", params)
31
+ return await self._call("plan_prompt_create", params)
32
+
33
+ async def plan_prompt_get(self, **params: Any) -> Any:
34
+ """Read a role prompt: exactly one of prompt_id, or plan together with role (passed through; a marked one carries deleted_at)."""
35
+ return await self._call("plan_prompt_get", params)
36
+
37
+ async def plan_prompt_list(self, **params: Any) -> Any:
38
+ """List role prompts without their text (plan, role, include_deleted, limit, offset; passed through)."""
39
+ return await self._call("plan_prompt_list", params)
40
+
41
+ async def plan_prompt_update(self, **params: Any) -> Any:
42
+ """Change the text of a prompt under expected_revision (prompt_id, prompt_text, changed_by, expected_revision, idempotency_key)."""
43
+ return await self._call("plan_prompt_update", params)
44
+
45
+ async def plan_prompt_delete(self, **params: Any) -> Any:
46
+ """Delete a prompt: soft (mark) by default, hard=true removes an already marked one that nothing refers to (passed through)."""
47
+ return await self._call("plan_prompt_delete", params)
48
+
49
+ async def plan_contract_create(self, **params: Any) -> Any:
50
+ """Declare the external-API contract of a plan: exactly three documents (matrix, relations, results).
51
+
52
+ Parameters are passed through unchanged (plan, documents, changed_by, idempotency_key) so that a missing or
53
+ invalid argument is refused by the server with the adapter's -32602 violation, not by a Python TypeError.
54
+ """
55
+ return await self._call("plan_contract_create", params)
58
56
 
59
57
  async def plan_contract_get(self, **params: Any) -> Any:
60
- """Read the current contract declaration of a plan (parameter plan, passed through)."""
58
+ """Read a contract declaration: exactly one of contract_id and plan (passed through; a marked one carries deleted_at)."""
61
59
  return await self._call("plan_contract_get", params)
62
60
 
61
+ async def plan_contract_list(self, **params: Any) -> Any:
62
+ """List contract declarations (plan, project, include_deleted, limit, offset; passed through)."""
63
+ return await self._call("plan_contract_list", params)
64
+
65
+ async def plan_contract_update(self, **params: Any) -> Any:
66
+ """Replace the three documents of a declaration under expected_contract_revision (parameters passed through)."""
67
+ return await self._call("plan_contract_update", params)
68
+
69
+ async def plan_contract_delete(self, **params: Any) -> Any:
70
+ """Delete a declaration: soft (mark) by default, hard=true removes an already marked one (parameters passed through)."""
71
+ return await self._call("plan_contract_delete", params)
72
+
63
73
  async def matrix_namespace_declare(self, **params: Any) -> Any:
64
74
  """Declare a matrix namespace of a plan (parameters passed through; the server validates them)."""
65
75
  return await self._call("matrix_namespace_declare", params)
@@ -3,6 +3,16 @@
3
3
  from __future__ import annotations
4
4
  from typing import Any
5
5
 
6
+ ABSENT: Any = object()
7
+ """Marks an argument the caller did not pass (block 0156, bug 614b5032): it is left out of the wire params, so the
8
+ server answers the missing or unknown field with its own -32602 violation instead of a Python TypeError."""
9
+
10
+
11
+ def supplied(**given: Any) -> dict[str, Any]:
12
+ """The wire params of the given arguments, leaving out every ABSENT one."""
13
+ return {name: value for name, value in given.items() if value is not ABSENT}
14
+
15
+
6
16
  class RuntimeAuthoringPart:
7
17
  """One method per plan_manager command in the runtime work-item family.
8
18
 
@@ -117,13 +127,48 @@ class RuntimeAuthoringPart:
117
127
  {"plan": plan, "step": step, "session_id": session_id},
118
128
  )
119
129
 
120
- async def authoring_job_delete(self, job_id: str, hard: bool = False, recursive: bool = False) -> Any:
121
- """Soft-delete (mark) one terminal authoring job; hard=True removes an already marked job (server default: false)."""
122
- params: dict[str, Any] = {"job_id": job_id}
130
+ async def authoring_job_get(self, job_id: Any = ABSENT, **unknown: Any) -> Any:
131
+ """Read one authoring job by its uuid4; a soft-marked job carries deleted_at (AUTHORING_JOB_NOT_FOUND when absent).
132
+
133
+ A missing job_id or an unknown field is passed to the server unchanged and refused there with -32602 (missing / unknown).
134
+ """
135
+ params = supplied(job_id=job_id)
136
+ params.update(unknown)
137
+ return await self._call("authoring_job_get", params)
138
+
139
+ async def authoring_job_update(
140
+ self,
141
+ job_id: Any = ABSENT,
142
+ changed_by: Any = ABSENT,
143
+ state: str | None = None,
144
+ result: dict[str, Any] | None = None,
145
+ question: str | None = None,
146
+ answer: str | None = None,
147
+ error_reason: str | None = None,
148
+ **unknown: Any,
149
+ ) -> Any:
150
+ """Always refused (AUTHORING_JOB_UPDATE_REFUSED): the state moves only through start, stop and resume.
151
+
152
+ A missing job_id / changed_by or an unknown field is passed to the server unchanged and refused there with -32602.
153
+ """
154
+ params = supplied(job_id=job_id, changed_by=changed_by)
155
+ for name, value in (("state", state), ("result", result), ("question", question), ("answer", answer), ("error_reason", error_reason)):
156
+ if value is not None:
157
+ params[name] = value
158
+ params.update(unknown)
159
+ return await self._call("authoring_job_update", params)
160
+
161
+ async def authoring_job_delete(self, job_id: Any = ABSENT, hard: bool = False, recursive: bool = False, **unknown: Any) -> Any:
162
+ """Soft-delete (mark) one terminal authoring job; hard=True removes an already marked job (server default: false).
163
+
164
+ A missing job_id or an unknown field is passed to the server unchanged and refused there with -32602.
165
+ """
166
+ params = supplied(job_id=job_id)
123
167
  if hard:
124
168
  params["hard"] = True
125
169
  if recursive:
126
170
  params["recursive"] = True
171
+ params.update(unknown)
127
172
  return await self._call("authoring_job_delete", params)
128
173
 
129
174
  async def authoring_child_list(self, step: str, plan: str | None = None) -> Any:
@@ -3,7 +3,7 @@
3
3
  from __future__ import annotations
4
4
  from typing import Any
5
5
  from .overlay_part import RuntimeOverlayPart
6
- from .authoring_part import RuntimeAuthoringPart
6
+ from .authoring_part import ABSENT, RuntimeAuthoringPart
7
7
 
8
8
  class RuntimeCommandsMixin:
9
9
  """One method per plan_manager command in the runtime work-item family.
@@ -212,8 +212,14 @@ class RuntimeCommandsMixin:
212
212
  plan, step, session_id
213
213
  )
214
214
 
215
- async def authoring_job_delete(self, job_id: str, hard: bool = False, recursive: bool = False) -> Any:
216
- return await self.runtimeAuthoringPart.authoring_job_delete(job_id, hard=hard, recursive=recursive)
215
+ async def authoring_job_delete(self, job_id: Any = ABSENT, hard: bool = False, recursive: bool = False, **unknown: Any) -> Any:
216
+ return await self.runtimeAuthoringPart.authoring_job_delete(job_id, hard=hard, recursive=recursive, **unknown)
217
+
218
+ async def authoring_job_get(self, job_id: Any = ABSENT, **unknown: Any) -> Any:
219
+ return await self.runtimeAuthoringPart.authoring_job_get(job_id, **unknown)
220
+
221
+ async def authoring_job_update(self, job_id: Any = ABSENT, changed_by: Any = ABSENT, state: str | None = None, result: dict[str, Any] | None = None, question: str | None = None, answer: str | None = None, error_reason: str | None = None, **unknown: Any) -> Any:
222
+ return await self.runtimeAuthoringPart.authoring_job_update(job_id, changed_by, state=state, result=result, question=question, answer=answer, error_reason=error_reason, **unknown)
217
223
 
218
224
  async def authoring_child_list(self, step: str, plan: str | None = None) -> Any:
219
225
  return await self.runtimeAuthoringPart.authoring_child_list(step, plan=plan)
@@ -19,10 +19,16 @@ COMMAND_NAMES: frozenset[str] = frozenset(
19
19
  "plan_completed_set",
20
20
  "plan_comment_set",
21
21
  "plan_context_budget_set",
22
- "plan_prompt_set",
22
+ "plan_prompt_create",
23
23
  "plan_prompt_get",
24
- "plan_contract_set",
24
+ "plan_prompt_list",
25
+ "plan_prompt_update",
26
+ "plan_prompt_delete",
27
+ "plan_contract_create",
25
28
  "plan_contract_get",
29
+ "plan_contract_list",
30
+ "plan_contract_update",
31
+ "plan_contract_delete",
26
32
  "matrix_namespace_declare",
27
33
  "matrix_namespace_delete",
28
34
  "matrix_namespace_rename",
@@ -181,6 +187,8 @@ COMMAND_NAMES: frozenset[str] = frozenset(
181
187
  "authoring_job_resume",
182
188
  "authoring_job_stop",
183
189
  "authoring_job_delete",
190
+ "authoring_job_get",
191
+ "authoring_job_update",
184
192
  "authoring_child_list",
185
193
  "authoring_step_create",
186
194
  "authoring_step_update",
@@ -17,7 +17,9 @@ MUTATING_COMMAND_NAMES: frozenset[str] = frozenset(
17
17
  "plan_completed_set",
18
18
  "plan_comment_set",
19
19
  "plan_context_budget_set",
20
- "plan_prompt_set",
20
+ "plan_prompt_create",
21
+ "plan_prompt_update",
22
+ "plan_prompt_delete",
21
23
  "plan_model_mapping_set",
22
24
  "plan_project_attach",
23
25
  "project_import",
@@ -85,6 +87,10 @@ MUTATING_COMMAND_NAMES: frozenset[str] = frozenset(
85
87
  "authoring_job_resume",
86
88
  "authoring_job_stop",
87
89
  "authoring_job_delete",
90
+ "authoring_job_update",
91
+ "plan_contract_create",
92
+ "plan_contract_update",
93
+ "plan_contract_delete",
88
94
  "authoring_step_submit",
89
95
  "authoring_step_create",
90
96
  "authoring_step_update",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plan-manager-client
3
- Version: 0.2.154
3
+ Version: 0.2.156
4
4
  Summary: First-class client library for the plan_manager JSON-RPC API: full command-surface facade plus export delivery module boundary.
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: mcp-proxy-adapter==8.11.9
@@ -34,13 +34,29 @@ def test_contract_check_without_plan_is_forwarded() -> None:
34
34
  assert client.calls == [("plan_contract_check", {"scope": "plan"})]
35
35
 
36
36
 
37
- def test_contract_set_forwards_every_argument_verbatim() -> None:
37
+ def test_contract_create_forwards_every_argument_verbatim() -> None:
38
38
  client = _Recorder()
39
39
  args = {
40
40
  "documents": [],
41
- "expected_contract_revision": "0",
42
41
  "changed_by": "tester",
43
42
  "idempotency_key": "k",
44
43
  }
45
- asyncio.run(client.plan_contract_set(plan="p", **args))
46
- assert client.calls == [("plan_contract_set", {"plan": "p", **args})]
44
+ asyncio.run(client.plan_contract_create(plan="p", **args))
45
+ assert client.calls == [("plan_contract_create", {"plan": "p", **args})]
46
+
47
+
48
+ def test_contract_update_list_delete_forward_every_argument_verbatim() -> None:
49
+ client = _Recorder()
50
+ update = {"contract_id": "c", "documents": [], "expected_contract_revision": "1", "changed_by": "t", "idempotency_key": "k"}
51
+ asyncio.run(client.plan_contract_update(**update))
52
+ asyncio.run(client.plan_contract_list(plan="p", limit=5))
53
+ asyncio.run(client.plan_contract_delete(contract_id="c", changed_by="t", hard=True))
54
+ assert client.calls == [
55
+ ("plan_contract_update", update),
56
+ ("plan_contract_list", {"plan": "p", "limit": 5}),
57
+ ("plan_contract_delete", {"contract_id": "c", "changed_by": "t", "hard": True}),
58
+ ]
59
+
60
+
61
+ def test_contract_set_is_removed_from_the_facade() -> None:
62
+ assert not hasattr(ContextGateCommandsMixin, "plan_contract_set")