pruning
This commit is contained in:
@@ -328,55 +328,5 @@ def get_prompt_by_id(prompt_id: str) -> dict[str, Any]:
|
|||||||
return get_prompt_by_id_payload(REGISTRY, prompt_id)
|
return get_prompt_by_id_payload(REGISTRY, prompt_id)
|
||||||
|
|
||||||
|
|
||||||
@mcp.tool
|
|
||||||
def catalog_search_patterns(
|
|
||||||
query: str = "",
|
|
||||||
tags: list[str] | None = None,
|
|
||||||
skip: int = 0,
|
|
||||||
limit: int = 20,
|
|
||||||
) -> dict[str, Any]:
|
|
||||||
"""Compatibility alias for clients expecting catalog_* tool naming."""
|
|
||||||
return search_patterns(
|
|
||||||
query=query,
|
|
||||||
tags=tags,
|
|
||||||
skip=skip,
|
|
||||||
limit=limit,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@mcp.tool
|
|
||||||
def catalog_get_pattern_by_id(id: str) -> dict[str, Any]:
|
|
||||||
"""Compatibility alias for clients expecting catalog_* tool naming."""
|
|
||||||
return get_pattern_by_id(id)
|
|
||||||
|
|
||||||
|
|
||||||
@mcp.tool
|
|
||||||
def catalog_get_skill_document_by_id(skill_id: str) -> dict[str, Any]:
|
|
||||||
"""Compatibility alias for clients expecting catalog_* tool naming."""
|
|
||||||
return get_skill_document_by_id(skill_id)
|
|
||||||
|
|
||||||
|
|
||||||
@mcp.tool
|
|
||||||
def catalog_search_prompts(
|
|
||||||
query: str = "",
|
|
||||||
tags: list[str] | None = None,
|
|
||||||
skip: int = 0,
|
|
||||||
limit: int = 20,
|
|
||||||
) -> dict[str, Any]:
|
|
||||||
"""Compatibility alias for clients expecting catalog_* tool naming."""
|
|
||||||
return search_prompts(
|
|
||||||
query=query,
|
|
||||||
tags=tags,
|
|
||||||
skip=skip,
|
|
||||||
limit=limit,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@mcp.tool
|
|
||||||
def catalog_get_prompt_by_id(prompt_id: str) -> dict[str, Any]:
|
|
||||||
"""Compatibility alias for clients expecting catalog_* tool naming."""
|
|
||||||
return get_prompt_by_id(prompt_id)
|
|
||||||
|
|
||||||
|
|
||||||
_install_tool_fallback_transforms()
|
_install_tool_fallback_transforms()
|
||||||
_register_prompt_objects()
|
_register_prompt_objects()
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from pydantic import ValidationError
|
|||||||
|
|
||||||
from ..skills.document_loader import _discover_top_level_references
|
from ..skills.document_loader import _discover_top_level_references
|
||||||
from ..skills.document_loader import _parse_frontmatter
|
from ..skills.document_loader import _parse_frontmatter
|
||||||
from ..skills.document_loader import _reference_id_from_filename
|
|
||||||
from ..skills.document_loader import _validate_prompt_frontmatter
|
from ..skills.document_loader import _validate_prompt_frontmatter
|
||||||
from ..skills.document_loader import _validate_skill_frontmatter
|
from ..skills.document_loader import _validate_skill_frontmatter
|
||||||
from ..skills.document_loader import _walk_markdown
|
from ..skills.document_loader import _walk_markdown
|
||||||
@@ -269,65 +268,6 @@ def _load_prompts(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
for relpath, prompt_file in _walk_markdown(
|
|
||||||
prompts_root,
|
|
||||||
prefix=PurePosixPath("prompts"),
|
|
||||||
):
|
|
||||||
if relpath in discovered_prompt_docs or relpath.endswith("/PROMPT.md"):
|
|
||||||
continue
|
|
||||||
|
|
||||||
prompt_markdown = prompt_file.read_text(encoding="utf-8")
|
|
||||||
prompt_id = _reference_id_from_filename(PurePosixPath(relpath).name)
|
|
||||||
if prompt_id is None:
|
|
||||||
continue
|
|
||||||
if prompt_id in prompts_by_id:
|
|
||||||
issues.append(
|
|
||||||
RegistryIssue(
|
|
||||||
code="duplicate_prompt_id",
|
|
||||||
message="duplicate prompt id discovered",
|
|
||||||
skill_id=prompt_id,
|
|
||||||
path=relpath,
|
|
||||||
hint="ensure each prompt id is unique",
|
|
||||||
)
|
|
||||||
)
|
|
||||||
continue
|
|
||||||
if prompt_id in skills_by_id:
|
|
||||||
issues.append(
|
|
||||||
RegistryIssue(
|
|
||||||
code="prompt_skill_id_collision",
|
|
||||||
message="prompt id collides with an existing skill id",
|
|
||||||
skill_id=prompt_id,
|
|
||||||
path=relpath,
|
|
||||||
hint="use a unique prompt id that does not match a skill id",
|
|
||||||
)
|
|
||||||
)
|
|
||||||
continue
|
|
||||||
|
|
||||||
prompt_record = PromptRecord(
|
|
||||||
prompt_id=prompt_id,
|
|
||||||
name=prompt_id,
|
|
||||||
description=f"Legacy prompt loaded from docs/{relpath}",
|
|
||||||
version="1.0.0",
|
|
||||||
tags=("prompt", "legacy"),
|
|
||||||
capabilities=(f"resource://prompts/{prompt_id}/document",),
|
|
||||||
arguments={},
|
|
||||||
document_uri=f"resource://prompts/{prompt_id}/document",
|
|
||||||
document_relpath=relpath,
|
|
||||||
document_content=prompt_markdown,
|
|
||||||
)
|
|
||||||
prompts_by_id[prompt_id] = prompt_record
|
|
||||||
prompt_summaries.append(
|
|
||||||
PromptSummaryRecord(
|
|
||||||
prompt_id=prompt_record.prompt_id,
|
|
||||||
name=prompt_record.name,
|
|
||||||
description=prompt_record.description,
|
|
||||||
tags=prompt_record.tags,
|
|
||||||
capabilities=prompt_record.capabilities,
|
|
||||||
document_uri=prompt_record.document_uri,
|
|
||||||
version=prompt_record.version,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
return prompts_by_id, prompt_summaries, issues
|
return prompts_by_id, prompt_summaries, issues
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -114,7 +114,3 @@ class SkillReferenceDocumentModel(StrictFrozenModel):
|
|||||||
relpath: str
|
relpath: str
|
||||||
content: str
|
content: str
|
||||||
entry: ReferenceEntry
|
entry: ReferenceEntry
|
||||||
|
|
||||||
|
|
||||||
# Transitional alias while callers move to neutral naming.
|
|
||||||
PersonalMcpMetadata = SkillMetadata
|
|
||||||
|
|||||||
Reference in New Issue
Block a user