mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-09-05 08:06:15 +00:00
* feat: simplify local links and support line anchors * fix: align line anchor tests with CI lint * fix: preserve local links across file moves * fix: encode markdown paths when rewriting links * refactor(read): keep explicit line range parameters * fix: simplify legacy link predicate compatibility * docs: align local link behavior with implementation * fix: skip unsupported markdown destination escapes * fix: normalize workspace link paths across platforms * fix: bound markdown link scanning * fix: keep local link processing linear * docs: clarify permissive markdown link parsing * fix: handle local link processing failures * refactor: limit file links to wikilink syntax * docs: align wikilink contract with implementation * fix: normalize dream and neighbor paths on Windows * fix: resolve workspace path for neighbor expansion
20 lines
730 B
Python
20 lines
730 B
Python
"""FileLink"""
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class FileLink(BaseModel):
|
|
"""file link
|
|
[[target_path]]
|
|
[[target_path#target_anchor]]
|
|
"""
|
|
|
|
model_config = ConfigDict(extra="forbid")
|
|
source_path: str = Field(default=..., description="source file path relative to working dir")
|
|
target_path: str = Field(default=..., description="target file path relative to working dir")
|
|
target_anchor: str | None = Field(default=None, description="Heading, block, or line anchor (text after '#')")
|
|
predicate: str | None = Field(
|
|
default=None,
|
|
exclude=True,
|
|
description="Deprecated compatibility field; accepted when loading legacy indexes but otherwise unused",
|
|
)
|