elan-cli 0.1.7__tar.gz → 0.1.8__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.
- {elan_cli-0.1.7 → elan_cli-0.1.8}/CHANGELOG.md +17 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/PKG-INFO +2 -2
- {elan_cli-0.1.7 → elan_cli-0.1.8}/pyproject.toml +2 -2
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/deploy.py +26 -10
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/manifests.py +103 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/project.py +10 -1
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/scaffold.py +27 -2
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/validate.py +11 -3
- {elan_cli-0.1.7 → elan_cli-0.1.8}/.gitignore +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/LICENSE +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/README.md +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/__init__.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/adk.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/auth.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/child.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/client.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/config.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/destroy.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/doctor.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/env.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/files.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/invoke.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/logs.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/main.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/projects.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/prompt.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/rollback.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/scan.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/secret.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/stream.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/tenant.py +0 -0
- {elan_cli-0.1.7 → elan_cli-0.1.8}/src/elan_cli/wallet.py +0 -0
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
Versions follow the tag that published them — `cli/v*`. A version with no date
|
|
4
4
|
has not been published yet.
|
|
5
5
|
|
|
6
|
+
## 0.1.8 — 2026-11-19
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- `elan new mcp <slug>` scaffolds an MCP server in `mcp_servers/<module>/server.py`, writes `mcp_servers/pyproject.toml` the first time, and declares the server in elan.yaml with `expose: project` and no database (ADR-0250).
|
|
11
|
+
- `elan init` creates `mcp_servers/` beside `agents/` and `workflows/`.
|
|
12
|
+
- `elan validate` checks MCP servers. Each `MANIFEST` is read from `mcp_servers/<module>/server.py` without running the server, because its dependencies cannot share the agents' environment, and joined with the agents' before the same cross-check the deploy runs. A `MANIFEST` must be written out — a dict, or `McpServerManifest(...)` with plain-value arguments — for this command to read it; one computed at import time is refused here, and still accepted by the build.
|
|
13
|
+
- `elan deploy` and `elan status` show the MCP servers' image beside the agents': an MCP server that moved onto its new image is marked `<- new`, and each image's scan is printed and named.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- `elan new mcp` prints what a server needs next — its dependency file, its own `egress:` — instead of the agent's hints.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- `elan validate` no longer refuses every MCP server as "no such agent or workflow".
|
|
22
|
+
|
|
6
23
|
## 0.1.7 — 2026-11-18
|
|
7
24
|
|
|
8
25
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: elan-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.8
|
|
4
4
|
Summary: The command line a developer deploys an agent with
|
|
5
5
|
Project-URL: Homepage, https://openelan.ai
|
|
6
6
|
Project-URL: Documentation, https://openelan.ai/app/docs
|
|
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
16
16
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
17
17
|
Requires-Python: >=3.12
|
|
18
18
|
Requires-Dist: certifi>=2024.2.2
|
|
19
|
-
Requires-Dist: elan-agentkit-contracts>=0.
|
|
19
|
+
Requires-Dist: elan-agentkit-contracts>=0.3.0
|
|
20
20
|
Requires-Dist: elan-sdk
|
|
21
21
|
Requires-Dist: httpx>=0.27
|
|
22
22
|
Requires-Dist: keyring>=25.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "elan-cli"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.8"
|
|
4
4
|
description = "The command line a developer deploys an agent with"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.12"
|
|
@@ -29,7 +29,7 @@ dependencies = [
|
|
|
29
29
|
# so `uv tool install elan-cli` no longer pulls a token verifier, a
|
|
30
30
|
# database layer and a Pub/Sub broker onto a developer's laptop to read one
|
|
31
31
|
# YAML file.
|
|
32
|
-
"elan-agentkit-contracts>=0.
|
|
32
|
+
"elan-agentkit-contracts>=0.3.0",
|
|
33
33
|
# THE SHARED CLIENT CODE, ONE WAY (ADR-0104). `text_of` and the certifi
|
|
34
34
|
# context live there now; this re-exports them. The dependency runs
|
|
35
35
|
# elan-cli -> elan-sdk and never back: the SDK must not import `elan_cli`,
|
|
@@ -219,7 +219,8 @@ def report(status: dict, *, after_deploy: bool = False) -> int:
|
|
|
219
219
|
print()
|
|
220
220
|
# A SCAN REFUSAL NAMES ITS FIXES ABOVE; the whole report is a link
|
|
221
221
|
# away, for whatever else the image carries.
|
|
222
|
-
if
|
|
222
|
+
if ((status.get("scan") or status.get("mcp_scan"))
|
|
223
|
+
and (link := (status.get("links") or {}).get("scan"))):
|
|
223
224
|
print(f" full scan report: {link}")
|
|
224
225
|
return 1
|
|
225
226
|
|
|
@@ -238,8 +239,16 @@ def report(status: dict, *, after_deploy: bool = False) -> int:
|
|
|
238
239
|
# they could use; the table below shows which targets moved to the new
|
|
239
240
|
# digest, which is the part that answers a question.
|
|
240
241
|
digest = status.get("digest") or ""
|
|
241
|
-
|
|
242
|
-
|
|
242
|
+
# TWO IMAGES WHEN THE REPO HAS MCP SERVERS (ADR-0250): the agents' and the
|
|
243
|
+
# servers'. Each target moved if it landed on EITHER, and each image has its
|
|
244
|
+
# own verdict — so both are shown, each named, with one link to the report.
|
|
245
|
+
mcp_digest = status.get("mcp_digest") or ""
|
|
246
|
+
_rollout(status.get("rollout") or {}, {d for d in (digest, mcp_digest) if d})
|
|
247
|
+
link = (status.get("links") or {}).get("scan", "")
|
|
248
|
+
mcp_scan = status.get("mcp_scan") or {}
|
|
249
|
+
_scan(status.get("scan") or {}, "" if mcp_scan else link,
|
|
250
|
+
image="agents' image" if mcp_scan else "")
|
|
251
|
+
_scan(mcp_scan, link, image="MCP servers' image")
|
|
243
252
|
if after_deploy and state == "succeeded":
|
|
244
253
|
_next_steps(status.get("links") or {})
|
|
245
254
|
return 0
|
|
@@ -274,19 +283,23 @@ def _next_steps(links: dict) -> None:
|
|
|
274
283
|
print(f" {label:<{width}} {link}")
|
|
275
284
|
|
|
276
285
|
|
|
277
|
-
def _rollout(rollout: dict,
|
|
286
|
+
def _rollout(rollout: dict, built: set[str]) -> None:
|
|
278
287
|
"""Which targets moved, and which kept what they were running.
|
|
279
288
|
|
|
280
289
|
THE SECOND COLUMN IS THE POINT. Every target in the project is listed,
|
|
281
290
|
including the ones that did not move — because "what is my agent running"
|
|
282
291
|
is the question, and a list of only the changed ones cannot answer it.
|
|
292
|
+
|
|
293
|
+
`built` IS EVERY IMAGE THIS DEPLOY BUILT, not only the agents'. Compared
|
|
294
|
+
against the agents' digest alone, an MCP server on its own new image read
|
|
295
|
+
as unchanged on every deploy that moved it.
|
|
283
296
|
"""
|
|
284
297
|
if not rollout:
|
|
285
298
|
return
|
|
286
299
|
print(" target digest")
|
|
287
300
|
for slug, target_digest in sorted(rollout.items()):
|
|
288
301
|
shown = str(target_digest).rsplit("@", 1)[-1][:19] or "-"
|
|
289
|
-
moved = " <- new" if
|
|
302
|
+
moved = " <- new" if target_digest in built else ""
|
|
290
303
|
print(f" {slug:<26} {shown}{moved}")
|
|
291
304
|
|
|
292
305
|
|
|
@@ -299,7 +312,7 @@ SEVERITIES = {"CRITICAL": "critical", "HIGH": "high", "MEDIUM": "medium",
|
|
|
299
312
|
SHOWN = 10
|
|
300
313
|
|
|
301
314
|
|
|
302
|
-
def _scan(scan: dict,
|
|
315
|
+
def _scan(scan: dict, link: str, *, image: str = "") -> None:
|
|
303
316
|
"""A SUMMARY, THE CRITICAL FINDINGS, AND A LINK — never the whole list.
|
|
304
317
|
|
|
305
318
|
A real image carries hundreds of findings, nearly all of them unfixable
|
|
@@ -313,13 +326,16 @@ def _scan(scan: dict, links: dict) -> None:
|
|
|
313
326
|
cannot tell a clean image from one nobody looked at. This read `skipped`
|
|
314
327
|
and `reason`, which the API never sent — it sends `completed: false` and
|
|
315
328
|
`incomplete_reason` — so an unscanned image printed nothing at all.
|
|
329
|
+
|
|
330
|
+
`image` NAMES WHICH ONE when a deploy built two; empty, the lines read as
|
|
331
|
+
they always have.
|
|
316
332
|
"""
|
|
317
333
|
if not scan:
|
|
318
334
|
return
|
|
319
|
-
|
|
335
|
+
of = f" ({image})" if image else ""
|
|
320
336
|
if not scan.get("completed"):
|
|
321
337
|
reason = scan.get("incomplete_reason") or "no reason recorded"
|
|
322
|
-
print(f"\n not scanned: {reason}")
|
|
338
|
+
print(f"\n not scanned{of}: {reason}")
|
|
323
339
|
print(" this image was deployed without a vulnerability check, "
|
|
324
340
|
"which is not the same as clean")
|
|
325
341
|
if link:
|
|
@@ -328,12 +344,12 @@ def _scan(scan: dict, links: dict) -> None:
|
|
|
328
344
|
|
|
329
345
|
findings = scan.get("findings") or []
|
|
330
346
|
if not findings:
|
|
331
|
-
print("\n scan: nothing found")
|
|
347
|
+
print(f"\n scan{of}: nothing found")
|
|
332
348
|
else:
|
|
333
349
|
counts = scan.get("counts") or {}
|
|
334
350
|
tally = ", ".join(f"{counts[name]} {label}"
|
|
335
351
|
for name, label in SEVERITIES.items() if counts.get(name))
|
|
336
|
-
print(f"\n scan: {len(findings)} findings — {tally}")
|
|
352
|
+
print(f"\n scan{of}: {len(findings)} findings — {tally}")
|
|
337
353
|
# FIXABLE FIRST: those are the ones somebody can act on today.
|
|
338
354
|
critical = sorted((f for f in findings if f.get("severity") == "CRITICAL"),
|
|
339
355
|
key=lambda f: not f.get("fixable"))
|
|
@@ -9,16 +9,32 @@ trust boundary there has to be a process rather than a parser.
|
|
|
9
9
|
The asymmetry is the design. Here there is no boundary to cross: a developer
|
|
10
10
|
running `elan validate` on their own repo is already running their own code
|
|
11
11
|
every time they run their own tests.
|
|
12
|
+
|
|
13
|
+
MCP SERVERS ARE READ AND NOT RUN, and that is a dependency fact rather than a
|
|
14
|
+
trust one (ADR-0250). A server's code needs `mcp_servers/pyproject.toml` — a
|
|
15
|
+
FastMCP that may need `mcp>=2.3` — and the agents' environment pins ADK, which
|
|
16
|
+
pins `mcp<2`, so no one interpreter holds both. `read_servers` parses each
|
|
17
|
+
`server.py` and takes its MANIFEST as written. Running it would mean a second
|
|
18
|
+
environment per repo and an eighth published package for its exporter; the
|
|
19
|
+
build's own export, which does run it, stays the authority.
|
|
12
20
|
"""
|
|
13
21
|
|
|
14
22
|
from __future__ import annotations
|
|
15
23
|
|
|
24
|
+
import ast
|
|
16
25
|
import json
|
|
17
26
|
import os
|
|
18
27
|
import subprocess
|
|
19
28
|
import sys
|
|
20
29
|
from pathlib import Path
|
|
21
30
|
|
|
31
|
+
from elan_agentkit_contracts.manifest import McpServerManifest
|
|
32
|
+
|
|
33
|
+
#: Where the build looks for MCP servers, and the file inside each one —
|
|
34
|
+
#: `agentkit_mcp.discovery`'s two names, which a test holds this to.
|
|
35
|
+
SERVERS_DIR = "mcp_servers"
|
|
36
|
+
SERVER_FILE = "server.py"
|
|
37
|
+
|
|
22
38
|
|
|
23
39
|
class ManifestError(Exception):
|
|
24
40
|
"""The repo's targets could not be read, with the reason the developer needs."""
|
|
@@ -122,3 +138,90 @@ def read(targets_root: Path, *, python: str | None = None) -> list[dict]:
|
|
|
122
138
|
f"the exporter did not produce JSON: {exc}. "
|
|
123
139
|
f"First 200 characters: {out.stdout[:200]!r}"
|
|
124
140
|
) from exc
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
def read_servers(targets_root: Path) -> list[dict]:
|
|
144
|
+
"""Every MCP server's MANIFEST, read from its source without running it.
|
|
145
|
+
|
|
146
|
+
THE BUILD'S RULES FOR WHAT COUNTS AS A SERVER, so validate and the build see
|
|
147
|
+
the same set: `mcp_servers/<module>/server.py`, sorted, skipping a directory
|
|
148
|
+
with no `server.py` or whose name starts with `_`, and refusing a slug two
|
|
149
|
+
servers declare.
|
|
150
|
+
|
|
151
|
+
A MANIFEST HAS TO BE WRITTEN OUT: a dict, which is what `elan new mcp`
|
|
152
|
+
scaffolds, or `McpServerManifest(...)` with literal arguments. One computed
|
|
153
|
+
at import time is refused here with the reason, and still accepted by the
|
|
154
|
+
build, which runs the code — the refusal is about this command's reach, not
|
|
155
|
+
about the server.
|
|
156
|
+
"""
|
|
157
|
+
base = targets_root / SERVERS_DIR
|
|
158
|
+
if not base.is_dir():
|
|
159
|
+
return []
|
|
160
|
+
found: dict[str, dict] = {}
|
|
161
|
+
for directory in sorted(p for p in base.iterdir() if p.is_dir()):
|
|
162
|
+
path = directory / SERVER_FILE
|
|
163
|
+
if not path.is_file() or directory.name.startswith("_"):
|
|
164
|
+
continue
|
|
165
|
+
where = path.relative_to(targets_root)
|
|
166
|
+
try:
|
|
167
|
+
manifest = McpServerManifest.model_validate(_written_manifest(path, where))
|
|
168
|
+
# pydantic's ValidationError IS a ValueError, and this package declares
|
|
169
|
+
# contracts rather than pydantic — so it is caught by its base.
|
|
170
|
+
except ValueError as exc:
|
|
171
|
+
raise ManifestError(f"{where}: MANIFEST is invalid.\n\n{exc}") from exc
|
|
172
|
+
if manifest.slug in found:
|
|
173
|
+
raise ManifestError(
|
|
174
|
+
f"slug {manifest.slug!r} is declared by both "
|
|
175
|
+
f"{found[manifest.slug]['module']} and {where}. Each MCP server "
|
|
176
|
+
"needs its own.")
|
|
177
|
+
found[manifest.slug] = {"module": str(where),
|
|
178
|
+
**manifest.model_dump(mode="json")}
|
|
179
|
+
return [found[slug] for slug in sorted(found)]
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def _written_manifest(path: Path, where: Path) -> dict:
|
|
183
|
+
"""The value of the module-level `MANIFEST = ...`, as plain data."""
|
|
184
|
+
try:
|
|
185
|
+
tree = ast.parse(path.read_text(), filename=str(where))
|
|
186
|
+
except SyntaxError as exc:
|
|
187
|
+
raise ManifestError(f"{where} does not parse: {exc}") from exc
|
|
188
|
+
|
|
189
|
+
# THE LAST ASSIGNMENT WINS, as it would when the module runs.
|
|
190
|
+
value: ast.expr | None = None
|
|
191
|
+
for node in tree.body:
|
|
192
|
+
if isinstance(node, ast.Assign) and any(
|
|
193
|
+
isinstance(t, ast.Name) and t.id == "MANIFEST" for t in node.targets):
|
|
194
|
+
value = node.value
|
|
195
|
+
elif (isinstance(node, ast.AnnAssign) and node.value is not None
|
|
196
|
+
and isinstance(node.target, ast.Name) and node.target.id == "MANIFEST"):
|
|
197
|
+
value = node.value
|
|
198
|
+
if value is None:
|
|
199
|
+
raise ManifestError(
|
|
200
|
+
f"{where} has no MANIFEST. An MCP server's module exports MANIFEST "
|
|
201
|
+
"and a callable build(); `elan new mcp` writes both.")
|
|
202
|
+
|
|
203
|
+
try:
|
|
204
|
+
if isinstance(value, ast.Call) and _names_the_model(value.func):
|
|
205
|
+
if value.args or any(kw.arg is None for kw in value.keywords):
|
|
206
|
+
raise ValueError("positional or ** arguments")
|
|
207
|
+
return {kw.arg: ast.literal_eval(kw.value) for kw in value.keywords}
|
|
208
|
+
written = ast.literal_eval(value)
|
|
209
|
+
except ValueError:
|
|
210
|
+
written = None
|
|
211
|
+
if not isinstance(written, dict):
|
|
212
|
+
raise ManifestError(
|
|
213
|
+
f"{where}: MANIFEST is computed rather than written out, so "
|
|
214
|
+
"`elan validate` cannot read it without running the server — and "
|
|
215
|
+
"running it needs mcp_servers/pyproject.toml's dependencies, which "
|
|
216
|
+
"the agents' environment cannot hold beside ADK.\n\n"
|
|
217
|
+
"Write it as a dict of plain values (what `elan new mcp` scaffolds) "
|
|
218
|
+
"or as McpServerManifest(...) with plain-value arguments. The build "
|
|
219
|
+
"runs the server and accepts either way; this is only about what "
|
|
220
|
+
"can be checked here.")
|
|
221
|
+
return written
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
def _names_the_model(func: ast.expr) -> bool:
|
|
225
|
+
"""`McpServerManifest(...)` or `<module>.McpServerManifest(...)`."""
|
|
226
|
+
return ((isinstance(func, ast.Name) and func.id == "McpServerManifest")
|
|
227
|
+
or (isinstance(func, ast.Attribute) and func.attr == "McpServerManifest"))
|
|
@@ -83,7 +83,7 @@ def load(spec_path: Path) -> Project:
|
|
|
83
83
|
return Project(root=spec_path.parent.resolve(), spec_path=spec_path, spec=spec)
|
|
84
84
|
|
|
85
85
|
|
|
86
|
-
def add_target(spec_path: Path, slug: str) -> None:
|
|
86
|
+
def add_target(spec_path: Path, slug: str, *, kind: str = "agent") -> None:
|
|
87
87
|
"""Append a `targets:` entry, preserving everything already in the file.
|
|
88
88
|
|
|
89
89
|
A TEXT EDIT, NOT A PARSE-AND-DUMP, and the reason is the file itself. This
|
|
@@ -119,6 +119,15 @@ def add_target(spec_path: Path, slug: str) -> None:
|
|
|
119
119
|
f" # merging field by field, so state all of it or none of it.\n"
|
|
120
120
|
f" database: {{enabled: true}}\n"
|
|
121
121
|
)
|
|
122
|
+
if kind == "mcp":
|
|
123
|
+
# AN MCP SERVER (ADR-0250): no database unless it asks, and reachable
|
|
124
|
+
# by this project's own agents until it says `expose: public`.
|
|
125
|
+
entry = (
|
|
126
|
+
f"\n {slug}:\n"
|
|
127
|
+
f" # An MCP server. `public` also lets callers outside this\n"
|
|
128
|
+
f" # project reach it at /mcp/<tenant>/<project>/{slug}.\n"
|
|
129
|
+
f" expose: project\n"
|
|
130
|
+
)
|
|
122
131
|
|
|
123
132
|
# AFTER THE LAST TARGET, NOT IMMEDIATELY AFTER THE KEY. Inserting at the top
|
|
124
133
|
# would put the new entry above targets that were there first, so every
|
|
@@ -29,7 +29,9 @@ from elan_cli.project import SPEC_FILENAME, ProjectError, add_target, find
|
|
|
29
29
|
|
|
30
30
|
#: `agent` and `workflow` differ by the file the registry scans for, and by
|
|
31
31
|
#: nothing else the scaffolder needs to know.
|
|
32
|
-
KINDS = {"agent": ("agents", "agent.py"), "workflow": ("workflows", "workflow.py")
|
|
32
|
+
KINDS = {"agent": ("agents", "agent.py"), "workflow": ("workflows", "workflow.py"),
|
|
33
|
+
# An MCP server (ADR-0250), served from an image of its own.
|
|
34
|
+
"mcp": ("mcp_servers", "server.py")}
|
|
33
35
|
|
|
34
36
|
#: A SHA THAT IS OBVIOUSLY A PLACEHOLDER. `source.ref` must match a 40-character
|
|
35
37
|
#: hex pattern, so it cannot be left blank — and a plausible-looking sha would
|
|
@@ -436,6 +438,7 @@ def init(directory: Path, *, tenant: str, project: str, repo: str,
|
|
|
436
438
|
directory.mkdir(parents=True, exist_ok=True)
|
|
437
439
|
(directory / "agents").mkdir(exist_ok=True)
|
|
438
440
|
(directory / "workflows").mkdir(exist_ok=True)
|
|
441
|
+
(directory / "mcp_servers").mkdir(exist_ok=True)
|
|
439
442
|
# WRITTEN HERE RATHER THAN LEFT TO THE DEVELOPER because `elan env` puts a
|
|
440
443
|
# virtualenv in this directory, and a committed one is both enormous and
|
|
441
444
|
# full of absolute paths from somebody else's machine. NOT OVERWRITTEN: a
|
|
@@ -557,6 +560,13 @@ def _write_target(kind: str, slug: str, root: Path) -> Path:
|
|
|
557
560
|
path = directory / filename
|
|
558
561
|
path.write_text(templates.read(kind).format(
|
|
559
562
|
slug=slug, module=module, display_name=slug.replace("-", " ").title()))
|
|
563
|
+
# THE SERVERS' OWN DEPENDENCY FILE (ADR-0250), written once and never
|
|
564
|
+
# overwritten. The MCP image installs from it, never from the root
|
|
565
|
+
# pyproject, which is the agents'.
|
|
566
|
+
if kind == "mcp":
|
|
567
|
+
dependencies = root / package / "pyproject.toml"
|
|
568
|
+
if not dependencies.exists():
|
|
569
|
+
dependencies.write_text(templates.mcp_pyproject())
|
|
560
570
|
return path
|
|
561
571
|
|
|
562
572
|
|
|
@@ -578,12 +588,27 @@ def new(kind: str, slug: str, *, start: Path | None = None) -> int:
|
|
|
578
588
|
# THE YAML SECOND, so a failure to write the module leaves the deploy file
|
|
579
589
|
# untouched rather than declaring a target that does not exist.
|
|
580
590
|
path = _write_target(kind, slug, project.targets_root)
|
|
581
|
-
add_target(project.spec_path, slug)
|
|
591
|
+
add_target(project.spec_path, slug, kind=kind)
|
|
582
592
|
|
|
583
593
|
print(f"created {path}")
|
|
584
594
|
print(f"updated {project.spec_path}")
|
|
585
595
|
print()
|
|
586
596
|
print("Next:")
|
|
597
|
+
if kind == "mcp":
|
|
598
|
+
# A SERVER HAS NO INSTRUCTION AND NO LIMITS, so the agent's hints sent
|
|
599
|
+
# its reader to edit things the file does not contain — and said
|
|
600
|
+
# nothing of the two places an MCP server differs: its own dependency
|
|
601
|
+
# file, and an egress list that is its alone (ADR-0250).
|
|
602
|
+
print(f" 1. Edit {path} — its tools, and MANIFEST.version whenever "
|
|
603
|
+
"you change it.")
|
|
604
|
+
print(f" 2. Put its dependencies in {path.parent.parent.name}/"
|
|
605
|
+
"pyproject.toml, not the root one.")
|
|
606
|
+
print(f" 3. Declare every host it calls under egress: for {slug} in "
|
|
607
|
+
f"{project.spec_path.name}. Only this server can reach them.")
|
|
608
|
+
print(f" 4. Set owner.team and owner.contacts for {slug} in "
|
|
609
|
+
f"{project.spec_path.name}.")
|
|
610
|
+
print(" 5. elan validate")
|
|
611
|
+
return 0
|
|
587
612
|
print(f" 1. Edit {path} — instruction, description, limits.")
|
|
588
613
|
print(f" 2. Set owner.team and owner.contacts for {slug} in "
|
|
589
614
|
f"{project.spec_path.name}.")
|
|
@@ -20,7 +20,7 @@ from pathlib import Path
|
|
|
20
20
|
|
|
21
21
|
from elan_agentkit_contracts.deploy_spec import Problem, cross_check
|
|
22
22
|
|
|
23
|
-
from elan_cli.manifests import ManifestError, read
|
|
23
|
+
from elan_cli.manifests import ManifestError, read, read_servers
|
|
24
24
|
from elan_cli.project import Project, ProjectError, find
|
|
25
25
|
|
|
26
26
|
|
|
@@ -38,13 +38,21 @@ def run(start: Path | None = None, *, python: str | None = None) -> int:
|
|
|
38
38
|
|
|
39
39
|
try:
|
|
40
40
|
manifests = read(project.targets_root, python=python)
|
|
41
|
+
# THE MCP SERVERS, READ AND NOT RUN (ADR-0250): their dependencies
|
|
42
|
+
# cannot share the agents' environment, so `read_servers` takes each
|
|
43
|
+
# MANIFEST as written. Joined into one list exactly as the build joins
|
|
44
|
+
# its two exports, so `cross_check` sees what the deploy will.
|
|
45
|
+
servers = read_servers(project.targets_root)
|
|
41
46
|
except ManifestError as exc:
|
|
42
47
|
print(f"\nerror: {exc}")
|
|
43
48
|
return 2
|
|
44
49
|
|
|
45
|
-
|
|
50
|
+
found = f" found {len(manifests) + len(servers)} in {project.targets_root}"
|
|
51
|
+
if servers:
|
|
52
|
+
found += f" ({len(servers)} MCP server{'' if len(servers) == 1 else 's'})"
|
|
53
|
+
print(found)
|
|
46
54
|
|
|
47
|
-
problems = cross_check(project.spec, manifests)
|
|
55
|
+
problems = cross_check(project.spec, [*manifests, *servers])
|
|
48
56
|
if not problems:
|
|
49
57
|
print("\nok — this would be accepted.")
|
|
50
58
|
_warn_unenforced(project)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|