refactor(beaver): 移除Hermes相关引用和迁移代码,完善Beaver后端主线实现
移除了所有Hermes相关的命名引用,包括: - 从.gitignore中清理相关构建缓存文件 - 将README中的beaver-home路径配置更新 - 完善backend/README.md文档说明Beaver后端主线实现 - 移除Hermes风格的相关注释和兼容性代码 - 清理nanobot环境变量兼容性处理 - 删除技能迁移和服务迁移相关功能代码 - 更新测试用例中相关命名和函数名 BREAKING CHANGE: 移除了Hermes迁移相关API和CLI命令,不再支持nanobot环境变量兼容性
This commit is contained in:
@ -1,7 +1,5 @@
|
||||
"""CLI entry for Beaver."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
try:
|
||||
import typer
|
||||
except ModuleNotFoundError: # pragma: no cover - fallback for skeleton-only environments
|
||||
@ -29,8 +27,6 @@ except ModuleNotFoundError: # pragma: no cover - fallback for skeleton-only env
|
||||
typer = _FallbackTyper() # type: ignore[assignment]
|
||||
|
||||
from beaver.services.agent_service import AgentService
|
||||
from beaver.services.hermes_migration import HermesMigrationService
|
||||
from beaver.skills.specs import SkillSpecStore
|
||||
|
||||
app = typer.Typer(help="Beaver backend CLI") if hasattr(typer, "Typer") else typer
|
||||
|
||||
@ -59,26 +55,6 @@ def run(
|
||||
typer.echo(result.output_text)
|
||||
|
||||
|
||||
@app.command("migrate-hermes")
|
||||
def migrate_hermes(
|
||||
repo: str = typer.Option(..., "--repo", help="Local checkout of https://github.com/NousResearch/hermes-agent."),
|
||||
workspace: str | None = typer.Option(None, "--workspace", help="Workspace root to import skills into."),
|
||||
manifest: str | None = typer.Option(None, "--manifest", help="Path for hermes_migration_manifest.json."),
|
||||
dry_run: bool = typer.Option(False, "--dry-run", help="Only write the manifest without importing skills."),
|
||||
) -> None:
|
||||
"""Import no-credential Hermes Agent skills and write a manifest."""
|
||||
|
||||
service = AgentService(workspace=workspace)
|
||||
loaded = service.create_loop().boot()
|
||||
store = loaded.skill_spec_store or SkillSpecStore(loaded.workspace)
|
||||
migration = HermesMigrationService(store, manifest_path=Path(manifest) if manifest else None)
|
||||
result = migration.migrate(repo, dry_run=dry_run)
|
||||
typer.echo(
|
||||
f"Hermes migration complete: {len(result['included'])} included, "
|
||||
f"{len(result['skipped'])} skipped."
|
||||
)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""Project script entrypoint."""
|
||||
app()
|
||||
|
||||
Reference in New Issue
Block a user