plan-manager-client 0.2.182__tar.gz → 0.2.241__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.
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/PKG-INFO +3 -3
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/_version.py +8 -4
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/authoring_diagnostics.py +1 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/client.py +16 -2
- plan_manager_client-0.2.241/plan_manager_client/config.py +138 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/facade_bug_project_mixin.py +17 -1
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/facade_context_gate_mixin.py +3 -27
- plan_manager_client-0.2.241/plan_manager_client/facade_name_tree_mixin.py +115 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/facade_plan_hrs_mixin.py +8 -4
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/facade_runtime_mixin/authoring_part.py +117 -13
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/facade_runtime_mixin/facade.py +47 -4
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/facade_runtime_mixin/overlay_part.py +4 -4
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/facade_step_graph_mixin.py +4 -12
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/scenario_runtime.py +2 -9
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/server_api.py +38 -9
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/server_api_mutating.py +18 -4
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client.egg-info/PKG-INFO +3 -3
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client.egg-info/SOURCES.txt +3 -2
- plan_manager_client-0.2.241/plan_manager_client.egg-info/requires.txt +7 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/pyproject.toml +2 -2
- plan_manager_client-0.2.241/tests/test_matrix_check_facade_passthrough.py +46 -0
- plan_manager_client-0.2.182/plan_manager_client/config.py +0 -320
- plan_manager_client-0.2.182/plan_manager_client.egg-info/requires.txt +0 -7
- plan_manager_client-0.2.182/tests/test_contract_facade_passthrough.py +0 -62
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/__init__.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/delivery/__init__.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/delivery/archive.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/delivery/atomicity.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/delivery/commit.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/delivery/destination.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/delivery/provenance.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/delivery/upload.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/dispatch.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/export_fetch_chunks.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/export_fetch_request.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/export_fetch_unpack.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/export_fetch_verify.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/facade_agent_config_mixin.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/facade_entity_common_mixin.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/facade_hrs_file_mixin.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/facade_runtime_mixin/__init__.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/id_rule.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client/info_walker.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client.egg-info/dependency_links.txt +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/plan_manager_client.egg-info/top_level.txt +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/setup.cfg +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/tests/test_client_server_api_sync.py +0 -0
- {plan_manager_client-0.2.182 → plan_manager_client-0.2.241}/tests/test_dispatch_validation_error_classification.py +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plan-manager-client
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.241
|
|
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
|
-
Requires-Dist: mcp-proxy-adapter
|
|
6
|
+
Requires-Dist: mcp-proxy-adapter>=8.14.10
|
|
7
7
|
Provides-Extra: ca
|
|
8
|
-
Requires-Dist: code-analysis-client>=1.6.
|
|
8
|
+
Requires-Dist: code-analysis-client>=1.6.439; extra == "ca"
|
|
9
9
|
Provides-Extra: dev
|
|
10
10
|
Requires-Dist: pytest>=9; extra == "dev"
|
|
@@ -9,6 +9,8 @@ import tomllib
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
_DIST_NAME = "plan-manager-client"
|
|
12
|
+
# The DEV build (build.sh --dev yes) publishes the same import package under the distribution name plan-manager-client-dev.
|
|
13
|
+
_DIST_NAMES = (_DIST_NAME, "plan-manager-client-dev")
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
def version_from_source_tree(module_file: Path | None = None) -> str:
|
|
@@ -42,10 +44,12 @@ def resolve_version() -> str:
|
|
|
42
44
|
"""Prefer source metadata for an editable checkout, otherwise use the installed version."""
|
|
43
45
|
if (Path(__file__).resolve().parents[2] / "pyproject.toml").is_file():
|
|
44
46
|
return version_from_source_tree()
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
for name in _DIST_NAMES:
|
|
48
|
+
try:
|
|
49
|
+
return installed_version(name)
|
|
50
|
+
except PackageNotFoundError:
|
|
51
|
+
continue
|
|
52
|
+
return version_from_source_tree()
|
|
49
53
|
|
|
50
54
|
|
|
51
55
|
__version__ = resolve_version()
|
|
@@ -6,16 +6,19 @@ email: vasilyvz@gmail.com
|
|
|
6
6
|
|
|
7
7
|
from __future__ import annotations
|
|
8
8
|
|
|
9
|
+
from pathlib import Path
|
|
9
10
|
from typing import Any
|
|
10
11
|
|
|
11
12
|
from mcp_proxy_adapter.client.jsonrpc_client.client import JsonRpcClient
|
|
12
13
|
|
|
14
|
+
from plan_manager_client.config import SECTION_NAME, ClientConnectionConfig
|
|
13
15
|
from plan_manager_client.dispatch import _CommandDispatchMixin
|
|
14
16
|
from plan_manager_client.facade_agent_config_mixin import AgentConfigCommandsMixin
|
|
15
17
|
from plan_manager_client.facade_bug_project_mixin import BugProjectCommandsMixin
|
|
16
18
|
from plan_manager_client.facade_context_gate_mixin import ContextGateCommandsMixin
|
|
17
19
|
from plan_manager_client.facade_entity_common_mixin import EntityCommonCommandsMixin
|
|
18
20
|
from plan_manager_client.facade_hrs_file_mixin import HrsFileCommandsMixin
|
|
21
|
+
from plan_manager_client.facade_name_tree_mixin import NameTreeCommandsMixin
|
|
19
22
|
from plan_manager_client.facade_plan_hrs_mixin import PlanHrsCommandsMixin
|
|
20
23
|
from plan_manager_client.facade_runtime_mixin import RuntimeCommandsMixin
|
|
21
24
|
from plan_manager_client.facade_step_graph_mixin import StepGraphCommandsMixin
|
|
@@ -27,6 +30,7 @@ class PlanManagerClient(
|
|
|
27
30
|
HrsFileCommandsMixin,
|
|
28
31
|
StepGraphCommandsMixin,
|
|
29
32
|
ContextGateCommandsMixin,
|
|
33
|
+
NameTreeCommandsMixin,
|
|
30
34
|
EntityCommonCommandsMixin,
|
|
31
35
|
RuntimeCommandsMixin,
|
|
32
36
|
BugProjectCommandsMixin,
|
|
@@ -36,7 +40,7 @@ class PlanManagerClient(
|
|
|
36
40
|
|
|
37
41
|
Composes (HOLDS, never inherits) a
|
|
38
42
|
mcp_proxy_adapter.client.jsonrpc_client.client.JsonRpcClient on the private
|
|
39
|
-
attribute ``self._rpc``, which supplies transport (
|
|
43
|
+
attribute ``self._rpc``, which supplies the transport (decided by the adapter alone), token
|
|
40
44
|
authentication, queued-job polling, and chunked file transfer with sha256
|
|
41
45
|
verification and resume. Because the transport client is held rather than
|
|
42
46
|
inherited, the network interaction is fully hidden: the public surface of
|
|
@@ -47,11 +51,21 @@ class PlanManagerClient(
|
|
|
47
51
|
plan_manager_client.server_api.COMMAND_NAMES. Construct directly with the
|
|
48
52
|
JsonRpcClient constructor arguments, or via
|
|
49
53
|
PlanManagerClient(**config.to_jsonrpc_kwargs()) using a
|
|
50
|
-
plan_manager_client.config.ClientConnectionConfig instance
|
|
54
|
+
plan_manager_client.config.ClientConnectionConfig instance, or
|
|
55
|
+
PlanManagerClient.from_document_path(path) from a client configuration document. Connections are
|
|
51
56
|
direct to the plan_manager server; this class performs no proxy call_server
|
|
52
57
|
routing.
|
|
53
58
|
"""
|
|
54
59
|
|
|
60
|
+
@classmethod
|
|
61
|
+
def from_document_path(cls, path: str | Path, section_name: str = SECTION_NAME) -> "PlanManagerClient":
|
|
62
|
+
"""Build the client from the named section of a JSON client configuration document.
|
|
63
|
+
|
|
64
|
+
The section follows ``plan_manager_client.config`` (the sectioned fleet shape); its transport values reach
|
|
65
|
+
the adapter ``JsonRpcClient`` unchanged.
|
|
66
|
+
"""
|
|
67
|
+
return cls(**ClientConnectionConfig.from_document_path(path, section_name).to_jsonrpc_kwargs())
|
|
68
|
+
|
|
55
69
|
def __init__(self, **jsonrpc_kwargs: Any) -> None:
|
|
56
70
|
"""Compose the underlying JsonRpcClient from JsonRpcClient constructor kwargs.
|
|
57
71
|
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"""Client configuration document of plan_manager_client.
|
|
2
|
+
|
|
3
|
+
The client is a thin layer on the mcp-proxy-adapter ``JsonRpcClient``. It takes no transport decision of its
|
|
4
|
+
own: protocol, host, port, certificate, key, CA and ``check_hostname`` are read from ONE configuration section in
|
|
5
|
+
the sectioned fleet shape (the shape the other fleet clients use, e.g. ``ai_devlease_client`` and
|
|
6
|
+
``ailogger_client``) and handed to the adapter client unchanged. The adapter alone decides what a protocol means,
|
|
7
|
+
how a certificate pair is attached, which port applies and whether the host name is verified.
|
|
8
|
+
|
|
9
|
+
Section shape (JSON object, section name ``plan_manager_client`` by default)::
|
|
10
|
+
|
|
11
|
+
{"protocol": "...", "server": {"host": "...", "port": 0},
|
|
12
|
+
"client": {"cert": "...", "key": "...", "ca": "...", "check_hostname": true, "timeout": 60},
|
|
13
|
+
"auth": {"token": "...", "token_header": "..."}}
|
|
14
|
+
|
|
15
|
+
``ssl`` is accepted as an alternative home of ``cert``/``key``/``ca``/``check_hostname``. Relative file paths are
|
|
16
|
+
resolved against the directory of the document.
|
|
17
|
+
|
|
18
|
+
Author: Vasiliy Zdanovskiy
|
|
19
|
+
email: vasilyvz@gmail.com
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
from __future__ import annotations
|
|
23
|
+
|
|
24
|
+
import json
|
|
25
|
+
from collections.abc import Mapping
|
|
26
|
+
from dataclasses import dataclass
|
|
27
|
+
from pathlib import Path
|
|
28
|
+
from typing import Any, Optional
|
|
29
|
+
|
|
30
|
+
SECTION_NAME = "plan_manager_client"
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class ClientConfigError(ValueError):
|
|
34
|
+
"""The configuration document or its section is missing or not an object of the documented shape."""
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
MissingClientEndpointError = ClientConfigError # earlier name of the same refusal, kept for existing importers
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _mapping(node: Any, name: str) -> Mapping[str, Any]:
|
|
41
|
+
if node is None:
|
|
42
|
+
return {}
|
|
43
|
+
if not isinstance(node, Mapping):
|
|
44
|
+
raise ClientConfigError(f"'{name}' must be an object")
|
|
45
|
+
return node
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def _path(value: Any, base_dir: Path | None) -> str | None:
|
|
49
|
+
if value in (None, ""):
|
|
50
|
+
return None
|
|
51
|
+
path = Path(str(value))
|
|
52
|
+
if not path.is_absolute() and base_dir is not None:
|
|
53
|
+
path = base_dir / path
|
|
54
|
+
return str(path)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
@dataclass(frozen=True)
|
|
58
|
+
class ClientConnectionConfig:
|
|
59
|
+
"""The keyword arguments of ``JsonRpcClient``, read from the client configuration section and nothing else.
|
|
60
|
+
|
|
61
|
+
No field has a default: an absent protocol, host or port is refused, never invented. ``check_hostname`` stays
|
|
62
|
+
``None`` unless the document sets it, which leaves the adapter's own (verifying) default in force.
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
protocol: str
|
|
66
|
+
host: str
|
|
67
|
+
port: int
|
|
68
|
+
token_header: Optional[str] = None
|
|
69
|
+
token: Optional[str] = None
|
|
70
|
+
cert: Optional[str] = None
|
|
71
|
+
key: Optional[str] = None
|
|
72
|
+
ca: Optional[str] = None
|
|
73
|
+
check_hostname: Optional[bool] = None
|
|
74
|
+
timeout: Optional[float] = None
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_section(cls, section: Mapping[str, Any], base_dir: str | Path | None = None) -> "ClientConnectionConfig":
|
|
78
|
+
"""Translate one configuration section into the adapter client's keyword arguments."""
|
|
79
|
+
if not isinstance(section, Mapping):
|
|
80
|
+
raise ClientConfigError("client section must be an object")
|
|
81
|
+
server = _mapping(section.get("server"), "server")
|
|
82
|
+
client = _mapping(section.get("client"), "client")
|
|
83
|
+
ssl = _mapping(section.get("ssl"), "ssl")
|
|
84
|
+
auth = _mapping(section.get("auth"), "auth")
|
|
85
|
+
base = Path(base_dir) if base_dir is not None else None
|
|
86
|
+
|
|
87
|
+
def pick(name: str) -> Any:
|
|
88
|
+
return client.get(name, ssl.get(name))
|
|
89
|
+
|
|
90
|
+
missing = [
|
|
91
|
+
name
|
|
92
|
+
for name, value in (("protocol", section.get("protocol")), ("server.host", server.get("host")), ("server.port", server.get("port")))
|
|
93
|
+
if value in (None, "")
|
|
94
|
+
]
|
|
95
|
+
if missing:
|
|
96
|
+
raise ClientConfigError("missing required client section value(s): " + ", ".join(missing))
|
|
97
|
+
timeout = client.get("timeout")
|
|
98
|
+
return cls(
|
|
99
|
+
protocol=section["protocol"],
|
|
100
|
+
host=server["host"],
|
|
101
|
+
port=int(server["port"]),
|
|
102
|
+
token_header=auth.get("token_header"),
|
|
103
|
+
token=auth.get("token"),
|
|
104
|
+
cert=_path(pick("cert"), base),
|
|
105
|
+
key=_path(pick("key"), base),
|
|
106
|
+
ca=_path(pick("ca"), base),
|
|
107
|
+
check_hostname=pick("check_hostname"),
|
|
108
|
+
timeout=float(timeout) if timeout is not None else None,
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
@classmethod
|
|
112
|
+
def from_document_path(cls, path: str | Path, section_name: str = SECTION_NAME) -> "ClientConnectionConfig":
|
|
113
|
+
"""Read the named section of a JSON configuration document."""
|
|
114
|
+
document_path = Path(path).resolve()
|
|
115
|
+
with open(document_path, encoding="utf-8") as handle:
|
|
116
|
+
document = json.load(handle)
|
|
117
|
+
section = document.get(section_name) if isinstance(document, Mapping) else None
|
|
118
|
+
if not isinstance(section, Mapping):
|
|
119
|
+
raise ClientConfigError(f"configuration document carries no '{section_name}' section")
|
|
120
|
+
return cls.from_section(section, document_path.parent)
|
|
121
|
+
|
|
122
|
+
def to_jsonrpc_kwargs(self) -> dict[str, Any]:
|
|
123
|
+
"""Return constructor kwargs for ``JsonRpcClient(**kwargs)``."""
|
|
124
|
+
return {
|
|
125
|
+
"protocol": self.protocol,
|
|
126
|
+
"host": self.host,
|
|
127
|
+
"port": self.port,
|
|
128
|
+
"token_header": self.token_header,
|
|
129
|
+
"token": self.token,
|
|
130
|
+
"cert": self.cert,
|
|
131
|
+
"key": self.key,
|
|
132
|
+
"ca": self.ca,
|
|
133
|
+
"check_hostname": self.check_hostname,
|
|
134
|
+
"timeout": self.timeout,
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
__all__ = ["SECTION_NAME", "ClientConfigError", "ClientConnectionConfig", "MissingClientEndpointError"]
|
|
@@ -179,7 +179,7 @@ class BugProjectCommandsMixin:
|
|
|
179
179
|
return await self._call("project_import", params)
|
|
180
180
|
|
|
181
181
|
async def project_list(self, **params: Any) -> Any:
|
|
182
|
-
"""List the imported projects, filtered by imported_by or imported_by_prefix, with
|
|
182
|
+
"""List the imported projects, filtered by imported_by or imported_by_prefix, with owned_count, comment and deleted; include_deleted=true also lists the marked projects (deleted true)."""
|
|
183
183
|
return await self._call("project_list", params)
|
|
184
184
|
|
|
185
185
|
async def project_remove(self, **params: Any) -> Any:
|
|
@@ -198,5 +198,21 @@ class BugProjectCommandsMixin:
|
|
|
198
198
|
"""Project-centric aggregate view: paginated todos/bugs (plus a comments count) scoped to one project, direct or transitive via bound plans."""
|
|
199
199
|
return await self._call("project_view", params)
|
|
200
200
|
|
|
201
|
+
async def project_checkpoint_save(self, **params: Any) -> Any:
|
|
202
|
+
"""Save the one checkpoint of a project: create it or replace the whole record (project_uuid, changed_by, done, stages, plans, dry_run); no history, an overwrite cannot be undone."""
|
|
203
|
+
return await self._call("project_checkpoint_save", params)
|
|
204
|
+
|
|
205
|
+
async def project_checkpoint_get(self, **params: Any) -> Any:
|
|
206
|
+
"""Read the checkpoint of a project (project_uuid); checkpoint is null when the project has none."""
|
|
207
|
+
return await self._call("project_checkpoint_get", params)
|
|
208
|
+
|
|
209
|
+
async def project_checkpoint_items(self, **params: Any) -> Any:
|
|
210
|
+
"""Read only the checkpoint items at one stage, in_progress by default (project_uuid, stage)."""
|
|
211
|
+
return await self._call("project_checkpoint_items", params)
|
|
212
|
+
|
|
213
|
+
async def project_checkpoint_delete(self, **params: Any) -> Any:
|
|
214
|
+
"""Mark the checkpoint of a project deleted (default) or fully delete a marked one (hard); dry_run previews (project_uuid, changed_by)."""
|
|
215
|
+
return await self._call("project_checkpoint_delete", params)
|
|
216
|
+
|
|
201
217
|
|
|
202
218
|
__all__ = ["BugProjectCommandsMixin"]
|
|
@@ -86,30 +86,6 @@ class ContextGateCommandsMixin:
|
|
|
86
86
|
"""Delete a Report: soft (mark) by default, hard=true removes an already marked one (passed through: report_id, changed_by, hard, recursive, dry_run)."""
|
|
87
87
|
return await self._call("report_delete", params)
|
|
88
88
|
|
|
89
|
-
async def plan_contract_create(self, **params: Any) -> Any:
|
|
90
|
-
"""Declare the external-API contract of a plan: exactly three documents (matrix, relations, results).
|
|
91
|
-
|
|
92
|
-
Parameters are passed through unchanged (plan, documents, changed_by, idempotency_key) so that a missing or
|
|
93
|
-
invalid argument is refused by the server with the adapter's -32602 violation, not by a Python TypeError.
|
|
94
|
-
"""
|
|
95
|
-
return await self._call("plan_contract_create", params)
|
|
96
|
-
|
|
97
|
-
async def plan_contract_get(self, **params: Any) -> Any:
|
|
98
|
-
"""Read a contract declaration: exactly one of contract_id and plan (passed through; a marked one carries deleted_at)."""
|
|
99
|
-
return await self._call("plan_contract_get", params)
|
|
100
|
-
|
|
101
|
-
async def plan_contract_list(self, **params: Any) -> Any:
|
|
102
|
-
"""List contract declarations (plan, project, include_deleted, limit, offset; passed through)."""
|
|
103
|
-
return await self._call("plan_contract_list", params)
|
|
104
|
-
|
|
105
|
-
async def plan_contract_update(self, **params: Any) -> Any:
|
|
106
|
-
"""Replace the three documents of a declaration under expected_contract_revision (parameters passed through)."""
|
|
107
|
-
return await self._call("plan_contract_update", params)
|
|
108
|
-
|
|
109
|
-
async def plan_contract_delete(self, **params: Any) -> Any:
|
|
110
|
-
"""Delete a declaration: soft (mark) by default, hard=true removes an already marked one (parameters passed through)."""
|
|
111
|
-
return await self._call("plan_contract_delete", params)
|
|
112
|
-
|
|
113
89
|
async def matrix_case_get(self, **params: Any) -> Any:
|
|
114
90
|
"""Read one matrix case of a plan by namespace and case_id; a case marked deleted is read with its mark (parameters passed through)."""
|
|
115
91
|
return await self._call("matrix_case_get", params)
|
|
@@ -159,9 +135,9 @@ class ContextGateCommandsMixin:
|
|
|
159
135
|
"""Read the matrix of a plan: summary, parts, or a page of calls or cases (parameters passed through)."""
|
|
160
136
|
return await self._call("matrix_get", params)
|
|
161
137
|
|
|
162
|
-
async def
|
|
163
|
-
"""Queue a read-only check of the plan's step texts against its
|
|
164
|
-
return await self._call("
|
|
138
|
+
async def plan_matrix_check(self, **params: Any) -> Any:
|
|
139
|
+
"""Queue a read-only check of the plan's step texts against the plan matrix and its attachments (passed through)."""
|
|
140
|
+
return await self._call("plan_matrix_check", params)
|
|
165
141
|
|
|
166
142
|
async def context_compile(self, **params: Any) -> Any:
|
|
167
143
|
"""Compile a typed context block directly from concept ids."""
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"""Name tree command-family facade mixin (plan b742ad73: declarations, relations and the reads of the name tree).
|
|
2
|
+
|
|
3
|
+
Author: Vasiliy Zdanovskiy
|
|
4
|
+
email: vasilyvz@gmail.com
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from typing import Any
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class NameTreeCommandsMixin:
|
|
13
|
+
"""One method per name tree command; every parameter is passed through and validated by the server.
|
|
14
|
+
|
|
15
|
+
Assumes it is mixed into a class that also inherits plan_manager_client.dispatch._CommandDispatchMixin (``_call``).
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
async def name_create(self, **params: Any) -> Any:
|
|
19
|
+
"""Create one declaration (plan, kind, short_name, owner, value_type, mark, visibility, mode, is_optional, description, realizes, step, position, changed_by)."""
|
|
20
|
+
return await self._call("name_create", params)
|
|
21
|
+
|
|
22
|
+
async def name_get(self, **params: Any) -> Any:
|
|
23
|
+
"""Read one declaration (plan, name, view summary|full)."""
|
|
24
|
+
return await self._call("name_get", params)
|
|
25
|
+
|
|
26
|
+
async def name_list(self, **params: Any) -> Any:
|
|
27
|
+
"""List declarations (plan, owner, kind, mark, public, unused, query, include_deleted, limit, offset)."""
|
|
28
|
+
return await self._call("name_list", params)
|
|
29
|
+
|
|
30
|
+
async def name_update(self, **params: Any) -> Any:
|
|
31
|
+
"""Change value_type, visibility, mark, mode, is_optional, description or realizes of one declaration (expected_revision, changed_by)."""
|
|
32
|
+
return await self._call("name_update", params)
|
|
33
|
+
|
|
34
|
+
async def name_rename(self, **params: Any) -> Any:
|
|
35
|
+
"""Rename or re-sign one declaration (new_short_name, new_params, new_returns); dry_run (default true) returns the proposal."""
|
|
36
|
+
return await self._call("name_rename", params)
|
|
37
|
+
|
|
38
|
+
async def name_delete(self, **params: Any) -> Any:
|
|
39
|
+
"""Mark (default, recursive for the subtree) or fully delete (hard) one declaration; dry_run previews."""
|
|
40
|
+
return await self._call("name_delete", params)
|
|
41
|
+
|
|
42
|
+
async def name_relation_add(self, **params: Any) -> Any:
|
|
43
|
+
"""Add one relation (plan, source, target, kind, origin, probability, state, changed_by)."""
|
|
44
|
+
return await self._call("name_relation_add", params)
|
|
45
|
+
|
|
46
|
+
async def name_relation_list(self, **params: Any) -> Any:
|
|
47
|
+
"""List relations (plan, source, target, under, kind, state, origin, level, min_probability, include_deleted, limit, offset)."""
|
|
48
|
+
return await self._call("name_relation_list", params)
|
|
49
|
+
|
|
50
|
+
async def name_relation_update(self, **params: Any) -> Any:
|
|
51
|
+
"""Set the state of one relation (plan, relation, state, changed_by); the origin becomes author."""
|
|
52
|
+
return await self._call("name_relation_update", params)
|
|
53
|
+
|
|
54
|
+
async def name_relation_remove(self, **params: Any) -> Any:
|
|
55
|
+
"""Mark (default) or fully delete (hard) one relation; dry_run previews."""
|
|
56
|
+
return await self._call("name_relation_remove", params)
|
|
57
|
+
|
|
58
|
+
async def name_relation_decide(self, **params: Any) -> Any:
|
|
59
|
+
"""Run pass two of the name tree through the MACSC decider (queued job: plan, scope, level, dry_run, changed_by)."""
|
|
60
|
+
return await self._call("name_relation_decide", params)
|
|
61
|
+
|
|
62
|
+
async def name_relation_recount(self, **params: Any) -> Any:
|
|
63
|
+
"""Recompute the acceptance of the decider relations with no decider call (plan, scope, changed_by)."""
|
|
64
|
+
return await self._call("name_relation_recount", params)
|
|
65
|
+
|
|
66
|
+
async def name_namespace_list(self, **params: Any) -> Any:
|
|
67
|
+
"""List the namespaces (packages) of the tree (plan, parent, recursive, limit, offset)."""
|
|
68
|
+
return await self._call("name_namespace_list", params)
|
|
69
|
+
|
|
70
|
+
async def name_tree_get(self, **params: Any) -> Any:
|
|
71
|
+
"""Read the name tree of one revision (plan, root, revision, with_relations, with_steps, limit, offset)."""
|
|
72
|
+
return await self._call("name_tree_get", params)
|
|
73
|
+
|
|
74
|
+
async def names_by_target_file(self, **params: Any) -> Any:
|
|
75
|
+
"""Read the steps and declarations of one target file (plan, target_file, revision)."""
|
|
76
|
+
return await self._call("names_by_target_file", params)
|
|
77
|
+
|
|
78
|
+
async def name_visible_names(self, **params: Any) -> Any:
|
|
79
|
+
"""Compute the names visible to one step (plan, step, include_probe, limit, offset)."""
|
|
80
|
+
return await self._call("name_visible_names", params)
|
|
81
|
+
|
|
82
|
+
async def plan_name_table_policy_set(self, **params: Any) -> Any:
|
|
83
|
+
"""Set the plan attribute name table required (plan, required, changed_by)."""
|
|
84
|
+
return await self._call("plan_name_table_policy_set", params)
|
|
85
|
+
|
|
86
|
+
async def plan_name_table_policy_get(self, **params: Any) -> Any:
|
|
87
|
+
"""Read the plan attribute name table required and the not-ready count (plan)."""
|
|
88
|
+
return await self._call("plan_name_table_policy_get", params)
|
|
89
|
+
|
|
90
|
+
async def step_name_table_check(self, **params: Any) -> Any:
|
|
91
|
+
"""Check the readiness of the closed name table of one step (plan, step)."""
|
|
92
|
+
return await self._call("step_name_table_check", params)
|
|
93
|
+
|
|
94
|
+
async def step_name_table_set(self, **params: Any) -> Any:
|
|
95
|
+
"""Replace the closed name table of one step (plan, step, entries, expected_revision, changed_by)."""
|
|
96
|
+
return await self._call("step_name_table_set", params)
|
|
97
|
+
|
|
98
|
+
async def step_name_table_get(self, **params: Any) -> Any:
|
|
99
|
+
"""Read the closed name table of one step (plan, step)."""
|
|
100
|
+
return await self._call("step_name_table_get", params)
|
|
101
|
+
|
|
102
|
+
async def name_move(self, **params: Any) -> Any:
|
|
103
|
+
"""Move a declaration with its subtree to another owner of the plan, dry run by default (plan, name, new_owner, dry_run, changed_by)."""
|
|
104
|
+
return await self._call("name_move", params)
|
|
105
|
+
|
|
106
|
+
async def name_namespace_view(self, **params: Any) -> Any:
|
|
107
|
+
"""View one namespace or subtree of the name tree compactly (plan, namespace, depth, with_relations, with_signatures, limit, cursor)."""
|
|
108
|
+
return await self._call("name_namespace_view", params)
|
|
109
|
+
|
|
110
|
+
async def step_tree_from_names(self, **params: Any) -> Any:
|
|
111
|
+
"""Make the step subtree of name tree nodes, dry run by default (plan, nodes, level, parent_step, merge, slug, dry_run, changed_by)."""
|
|
112
|
+
return await self._call("step_tree_from_names", params)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
__all__ = ["NameTreeCommandsMixin"]
|
|
@@ -19,15 +19,15 @@ class PlanHrsCommandsMixin:
|
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
21
|
async def plan_create(self, **params: Any) -> Any:
|
|
22
|
-
"""Create a new plan aggregate with a unique name."""
|
|
22
|
+
"""Create a new plan aggregate with a unique name; the answer carries mrs_id, the id of the empty MRS container created with the plan."""
|
|
23
23
|
return await self._call("plan_create", params)
|
|
24
24
|
|
|
25
25
|
async def plan_list(self, **params: Any) -> Any:
|
|
26
|
-
"""List a paginated page of plans in the catalog with their bound projects; soft-deleted plans are hidden unless show_deleted is true."""
|
|
26
|
+
"""List a paginated page of plans in the catalog with their bound projects; soft-deleted plans are hidden unless show_deleted is true; every row carries mrs_id."""
|
|
27
27
|
return await self._call("plan_list", params)
|
|
28
28
|
|
|
29
29
|
async def plan_status(self, **params: Any) -> Any:
|
|
30
|
-
"""Return the dashboard for one plan: counts, gate, and scoring."""
|
|
30
|
+
"""Return the dashboard for one plan: counts, gate, and scoring (plan.mrs_id is the id of its MRS container, never null)."""
|
|
31
31
|
return await self._call("plan_status", params)
|
|
32
32
|
|
|
33
33
|
async def plan_delete(self, **params: Any) -> Any:
|
|
@@ -62,6 +62,10 @@ class PlanHrsCommandsMixin:
|
|
|
62
62
|
},
|
|
63
63
|
)
|
|
64
64
|
|
|
65
|
+
async def plan_model_autofill_set(self, plan: str, enabled: bool, changed_by: str) -> Any:
|
|
66
|
+
"""Set the plan flag model auto-fill; with the flag on, the model decider fills the steps that have no configuration of their own."""
|
|
67
|
+
return await self._call("plan_model_autofill_set", {"plan": plan, "enabled": enabled, "changed_by": changed_by})
|
|
68
|
+
|
|
65
69
|
async def plan_model_mapping_get(self, plan: str) -> Any:
|
|
66
70
|
"""Read the plan-owned G/T/A model mapping and header revision."""
|
|
67
71
|
return await self._call("plan_model_mapping_get", {"plan": plan})
|
|
@@ -79,7 +83,7 @@ class PlanHrsCommandsMixin:
|
|
|
79
83
|
return await self._call("plan_snapshot", params)
|
|
80
84
|
|
|
81
85
|
async def plan_import(self, **params: Any) -> Any:
|
|
82
|
-
"""Import a plan from a standard file layout under the configured export root."""
|
|
86
|
+
"""Import a plan from a standard file layout under the configured export root; a real import answers mrs_id of the new plan."""
|
|
83
87
|
return await self._call("plan_import", params)
|
|
84
88
|
|
|
85
89
|
async def export_upload_save(self, **params: Any) -> Any:
|