@sakanano-moe/agenthelm 6.13.1 → 6.14.0

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.
Files changed (117) hide show
  1. package/package.json +1 -1
  2. package/runtime/index.json +6 -6
  3. package/runtime/plugins/agent-pack/.codex-plugin/plugin.json +1 -1
  4. package/runtime/plugins/agent-pack/plugin.json +1 -1
  5. package/runtime/plugins/agent-pack/references/capability-config.md +10 -0
  6. package/runtime/plugins/agent-pack/references/check-opinion-migrate.en.md +31 -0
  7. package/runtime/plugins/agent-pack/references/check-opinion-migrate.md +31 -0
  8. package/runtime/plugins/agent-pack/references/dedupe-contract.en.md +27 -0
  9. package/runtime/plugins/agent-pack/references/dedupe-contract.md +27 -0
  10. package/runtime/plugins/agent-pack/references/inventory-contract.en.md +83 -0
  11. package/runtime/plugins/agent-pack/references/inventory-contract.md +83 -0
  12. package/runtime/plugins/agent-pack/references/nudge.en.md +10 -2
  13. package/runtime/plugins/agent-pack/references/nudge.md +10 -2
  14. package/runtime/plugins/agent-pack/references/relocate-contract.en.md +41 -0
  15. package/runtime/plugins/agent-pack/references/relocate-contract.md +41 -0
  16. package/runtime/plugins/agent-pack/runtime/agent_pack_claude.py +572 -30
  17. package/runtime/plugins/agent-pack/runtime/agent_pack_clients.py +233 -0
  18. package/runtime/plugins/agent-pack/runtime/agent_pack_config.py +112 -4
  19. package/runtime/plugins/agent-pack/runtime/agent_pack_dedupe.py +502 -0
  20. package/runtime/plugins/agent-pack/runtime/agent_pack_desktop.py +92 -0
  21. package/runtime/plugins/agent-pack/runtime/agent_pack_ext_common.py +251 -0
  22. package/runtime/plugins/agent-pack/runtime/agent_pack_inventory.py +989 -0
  23. package/runtime/plugins/agent-pack/runtime/agent_pack_mcp_write.py +447 -0
  24. package/runtime/plugins/agent-pack/runtime/agent_pack_nudge.py +29 -4
  25. package/runtime/plugins/agent-pack/runtime/agent_pack_relocate.py +385 -0
  26. package/runtime/plugins/agent-pack/runtime/agent_pack_scope.py +233 -0
  27. package/runtime/plugins/agent-pack/runtime/agenthelm.py +183 -14
  28. package/runtime/plugins/agent-pack/runtime/locale/en.json +250 -1
  29. package/runtime/plugins/agent-pack/runtime/mcp_server.py +12 -0
  30. package/runtime/plugins/agent-pack/runtime/nudge_text.py +8 -2
  31. package/runtime/plugins/agent-pack/runtime/user_settings.py +2 -1
  32. package/runtime/plugins/agent-pack/skills/agent-pack/SKILL.md +15 -0
  33. package/runtime/plugins/agents-init/.codex-plugin/plugin.json +1 -1
  34. package/runtime/plugins/agents-init/content.json +4 -2
  35. package/runtime/plugins/agents-init/plugin.json +1 -1
  36. package/runtime/plugins/agents-init/skills/agents-init/SKILL.md +2 -0
  37. package/runtime/plugins/agents-init/skills/agents-init/launcher.en.sh +93 -0
  38. package/runtime/plugins/agents-init/skills/agents-init/project.schema.json +27 -0
  39. package/runtime/plugins/agents-init/skills/agents-init/scripts/baseline.py +4 -1
  40. package/runtime/plugins/agents-init/skills/agents-init/scripts/init_project.py +24 -9
  41. package/runtime/plugins/agents-init/skills/agents-init/skill.json +1 -1
  42. package/runtime/plugins/opinion-manager/.codex-plugin/plugin.json +1 -1
  43. package/runtime/plugins/opinion-manager/catalog/README.md +3 -1
  44. package/runtime/plugins/opinion-manager/catalog/rules/om.align-requirements/versions/1.1.0.json +34 -0
  45. package/runtime/plugins/opinion-manager/catalog/rules/om.assumptions-authority/versions/1.1.0.json +34 -0
  46. package/runtime/plugins/opinion-manager/catalog/rules/om.batch-questions/versions/1.1.0.json +34 -0
  47. package/runtime/plugins/opinion-manager/catalog/rules/om.bilingual-terms/versions/1.1.0.json +34 -0
  48. package/runtime/plugins/opinion-manager/catalog/rules/om.calculations/versions/1.1.0.json +34 -0
  49. package/runtime/plugins/opinion-manager/catalog/rules/om.chinese-response/versions/1.1.0.json +34 -0
  50. package/runtime/plugins/opinion-manager/catalog/rules/om.clean-deliverable/versions/1.1.0.json +34 -0
  51. package/runtime/plugins/opinion-manager/catalog/rules/om.complete-options/versions/1.1.0.json +34 -0
  52. package/runtime/plugins/opinion-manager/catalog/rules/om.conclusion-first/versions/1.1.0.json +34 -0
  53. package/runtime/plugins/opinion-manager/catalog/rules/om.concrete-titles/versions/1.1.0.json +34 -0
  54. package/runtime/plugins/opinion-manager/catalog/rules/om.consistent-items/versions/1.1.0.json +34 -0
  55. package/runtime/plugins/opinion-manager/catalog/rules/om.device-readable/versions/1.1.0.json +34 -0
  56. package/runtime/plugins/opinion-manager/catalog/rules/om.editable-diagrams/versions/1.1.0.json +34 -0
  57. package/runtime/plugins/opinion-manager/catalog/rules/om.evidence-inference/versions/1.1.0.json +34 -0
  58. package/runtime/plugins/opinion-manager/catalog/rules/om.maintenance-chinese/versions/1.1.0.json +34 -0
  59. package/runtime/plugins/opinion-manager/catalog/rules/om.maintenance-project-language/versions/1.1.0.json +34 -0
  60. package/runtime/plugins/opinion-manager/catalog/rules/om.markdown-structure/versions/1.1.0.json +34 -0
  61. package/runtime/plugins/opinion-manager/catalog/rules/om.portable-files/versions/1.1.0.json +34 -0
  62. package/runtime/plugins/opinion-manager/catalog/rules/om.report-context/versions/1.1.0.json +34 -0
  63. package/runtime/plugins/opinion-manager/catalog/rules/om.report-formats/versions/1.1.0.json +34 -0
  64. package/runtime/plugins/opinion-manager/catalog/rules/om.report-review/versions/1.1.0.json +34 -0
  65. package/runtime/plugins/opinion-manager/catalog/rules/om.response-brief/versions/1.1.0.json +34 -0
  66. package/runtime/plugins/opinion-manager/catalog/rules/om.response-dense/versions/1.1.0.json +34 -0
  67. package/runtime/plugins/opinion-manager/catalog/rules/om.rules-tools/versions/1.1.0.json +34 -0
  68. package/runtime/plugins/opinion-manager/catalog/rules/om.semantic-wrap/versions/1.1.0.json +34 -0
  69. package/runtime/plugins/opinion-manager/catalog/rules/om.solutions-proportional/versions/1.1.0.json +34 -0
  70. package/runtime/plugins/opinion-manager/catalog/rules/om.solutions-three-level/versions/1.1.0.json +34 -0
  71. package/runtime/plugins/opinion-manager/catalog/rules/om.tables-compact/versions/1.1.0.json +34 -0
  72. package/runtime/plugins/opinion-manager/catalog/rules/om.tables-list-first/versions/1.1.0.json +34 -0
  73. package/runtime/plugins/opinion-manager/catalog/rules/om.test-evidence/versions/1.1.0.json +34 -0
  74. package/runtime/plugins/opinion-manager/catalog/rules/om.versioned-files/versions/1.1.0.json +34 -0
  75. package/runtime/plugins/opinion-manager/catalog/templates/delivery-standard/compact-tables/versions/1.1.0.json +32 -0
  76. package/runtime/plugins/opinion-manager/catalog/templates/delivery-standard/list-first/versions/1.1.0.json +32 -0
  77. package/runtime/plugins/opinion-manager/catalog/templates/development-standard/chinese-maintenance/versions/1.1.0.json +26 -0
  78. package/runtime/plugins/opinion-manager/catalog/templates/development-standard/project-language/versions/1.1.0.json +26 -0
  79. package/runtime/plugins/opinion-manager/catalog/templates/response-style/brief-chinese/versions/1.1.0.json +30 -0
  80. package/runtime/plugins/opinion-manager/catalog/templates/response-style/dense-chinese/versions/1.1.0.json +30 -0
  81. package/runtime/plugins/opinion-manager/catalog/templates/scenario/concise-project/versions/1.1.0.json +181 -0
  82. package/runtime/plugins/opinion-manager/catalog/templates/scenario/reviewed-project/versions/1.1.0.json +179 -0
  83. package/runtime/plugins/opinion-manager/catalog/templates/work-method/proportional/versions/1.1.0.json +31 -0
  84. package/runtime/plugins/opinion-manager/catalog/templates/work-method/three-level/versions/1.1.0.json +31 -0
  85. package/runtime/plugins/opinion-manager/content.json +44 -3
  86. package/runtime/plugins/opinion-manager/plugin.json +1 -1
  87. package/runtime/plugins/opinion-manager/references/inbox.en.md +25 -4
  88. package/runtime/plugins/opinion-manager/references/inbox.md +25 -4
  89. package/runtime/plugins/opinion-manager/references/profile.schema.json +19 -2
  90. package/runtime/plugins/opinion-manager/references/rule.schema.json +25 -3
  91. package/runtime/plugins/opinion-manager/references/versioned-template.schema.json +5 -4
  92. package/runtime/plugins/opinion-manager/references/versioning.md +89 -4
  93. package/runtime/plugins/opinion-manager/runtime/context.py +26 -19
  94. package/runtime/plugins/opinion-manager/runtime/inbox.py +400 -25
  95. package/runtime/plugins/opinion-manager/runtime/inbox_relations.py +106 -0
  96. package/runtime/plugins/opinion-manager/runtime/inbox_routes.py +132 -0
  97. package/runtime/plugins/opinion-manager/runtime/inbox_text.py +117 -11
  98. package/runtime/plugins/opinion-manager/runtime/lifecycle.py +35 -5
  99. package/runtime/plugins/opinion-manager/runtime/locale/en.json +137 -2
  100. package/runtime/plugins/opinion-manager/runtime/migrate.py +582 -0
  101. package/runtime/plugins/opinion-manager/runtime/opinion_manager.py +9 -4
  102. package/runtime/plugins/opinion-manager/runtime/rule_lines.py +247 -0
  103. package/runtime/plugins/opinion-manager/runtime/tags.py +217 -0
  104. package/runtime/plugins/opinion-manager/runtime/versioned.py +289 -41
  105. package/runtime/plugins/opinion-manager/skills/opinion-manager/SKILL.md +8 -7
  106. package/runtime/plugins/project-orchestrator/.codex-plugin/plugin.json +1 -1
  107. package/runtime/plugins/project-orchestrator/plugin.json +1 -1
  108. package/runtime/plugins/project-orchestrator/runtime/locale/en.json +305 -3
  109. package/runtime/plugins/project-orchestrator/runtime/private_paths.py +11 -1
  110. package/runtime/plugins/project-orchestrator/runtime/project_cli.py +101 -1
  111. package/runtime/plugins/project-orchestrator/runtime/project_demo.py +13 -1
  112. package/runtime/plugins/project-orchestrator/runtime/project_ext_actions.py +415 -0
  113. package/runtime/plugins/project-orchestrator/runtime/project_extensions.py +971 -0
  114. package/runtime/plugins/project-orchestrator/runtime/project_extensions_demo.py +86 -0
  115. package/runtime/plugins/project-orchestrator/runtime/project_menu.py +345 -2
  116. package/runtime/plugins/project-orchestrator/runtime/project_real.py +17 -1
  117. package/runtime/plugins/project-orchestrator/skills/project-orchestrator/SKILL.md +2 -0
@@ -16,6 +16,7 @@ import hashlib
16
16
  import json
17
17
  import os
18
18
  import re
19
+ import shlex
19
20
  import shutil
20
21
  import subprocess
21
22
  import sys
@@ -29,6 +30,7 @@ from datetime import UTC, datetime
29
30
  from pathlib import Path
30
31
  from typing import Any
31
32
  from i18n_agent_pack import _, N_, resolve_language # noqa: E402
33
+ import agent_pack_clients as client_registry # noqa: E402
32
34
 
33
35
  MARKETPLACE = "agenthelm"
34
36
  NPX = "npx @sakanano-moe/agenthelm"
@@ -803,6 +805,53 @@ def opinion_findings(project: Path, installed: list[dict]) -> list[dict]:
803
805
  return [{"status": "update-available" if result["updates"] else "current", "updates": result["updates"]}]
804
806
 
805
807
 
808
+ OPINION_MIGRATE_TIMEOUT = 5 # seconds, per project; a slow or stuck preview is silently skipped
809
+ OPINION_MIGRATE_CONFLICTS = ("manual-edit-conflict", "catalog-conflict")
810
+
811
+
812
+ def _shell_quote(value: Path | str) -> str:
813
+ """POSIX shlex.quote; cmd.exe has no single quotes, so Windows keeps double quotes (same rule as the nudge)."""
814
+ return shlex.quote(str(value)) if os.name == "posix" else f'"{value}"'
815
+
816
+
817
+ def opinion_migrate_findings(project: Path, installed: list[dict]) -> list[dict]:
818
+ """Advisory only: ask opinion-manager for a read-only ``migrate`` preview of the project's opinion.
819
+
820
+ Silent (empty list) for everything except a previewable migration or a conflict the user can resolve: no lock, no
821
+ installed opinion-manager, timeout, non-JSON output, an unknown status, and every other status/reason. Never raises.
822
+ One subprocess per project, bounded by OPINION_MIGRATE_TIMEOUT; opinion-manager is only ever run, never imported.
823
+ """
824
+ try:
825
+ if not (project / OPINION_LOCK).is_file():
826
+ return []
827
+ manager = locate_companion("opinion-manager", installed)
828
+ runtime = manager / "runtime" / "opinion_manager.py" if manager else None
829
+ if runtime is None or not runtime.is_file():
830
+ return []
831
+ root = project.expanduser().resolve()
832
+ completed = subprocess.run([sys.executable, str(runtime), "migrate", "--project", str(root), "--output", "json"],
833
+ capture_output=True, text=True, check=False, timeout=OPINION_MIGRATE_TIMEOUT)
834
+ result = json.loads(completed.stdout)
835
+ if not isinstance(result, dict):
836
+ return []
837
+ status, reason = result.get("status"), result.get("reason")
838
+ command = f"python3 {_shell_quote(runtime)} migrate --project {_shell_quote(root)}"
839
+ if status == "preview" and completed.returncode == 0:
840
+ target = result.get("target") if isinstance(result.get("target"), dict) else {}
841
+ updates = [{key: item.get(key) for key in ("kind", "id", "current", "target", "action")}
842
+ for item in result.get("updates") or [] if isinstance(item, dict)]
843
+ incomplete = (result.get("inbox") or {}).get("incomplete") or []
844
+ return [{"kind": "opinion-migrate", "status": "preview", "reason": None, "command": command,
845
+ "target": {"profile": target.get("profile"), "schema_version": target.get("schema_version")},
846
+ "updates": updates, "inbox_incomplete": len(incomplete) if isinstance(incomplete, list) else 0}]
847
+ if status == "cannot-migrate" and reason in OPINION_MIGRATE_CONFLICTS and completed.returncode == 3:
848
+ return [{"kind": "opinion-migrate", "status": "cannot-migrate", "reason": reason, "command": command,
849
+ "message": result.get("message") if isinstance(result.get("message"), str) else None}]
850
+ except Exception: # noqa: BLE001 - an advisory hint must never make check fail or slow down
851
+ return []
852
+ return []
853
+
854
+
806
855
  # ---------------------------------------------------------------- project scaffold
807
856
 
808
857
  PROFILE_FILE = Path(".agents/moe.sakanano.agent-pack/project.json")
@@ -984,8 +1033,8 @@ def scaffold_fingerprint(env: Env, scaffold: dict | None) -> dict | None:
984
1033
  return module.fingerprint(scaffold)
985
1034
 
986
1035
 
987
- CLIENT_NAMES = {"claude": "Claude Code", "codex": "Codex", "cursor": "Cursor"}
988
- CLIENT_KEYS = ("claude", "codex", "cursor")
1036
+ CLIENT_NAMES = client_registry.display_names()
1037
+ CLIENT_KEYS = client_registry.default_ids()
989
1038
 
990
1039
 
991
1040
  def ignored_clients(env: Env) -> list[str]:
@@ -1065,7 +1114,7 @@ def capability_notice(reports: list[dict]) -> str | None:
1065
1114
 
1066
1115
  def run_check(env: Env, project: Path | None, *, latest_source: str | None = None, offline: bool = False,
1067
1116
  max_age: int = CACHE_TTL_SECONDS, hook_mode: bool = False, reprompt: bool = False,
1068
- clients: list[str] | None = None, source: Path | None = None) -> dict:
1117
+ clients: list[str] | None = None, source: Path | None = None, migrate_hint: bool = False) -> dict:
1069
1118
  latest, origin = load_latest(
1070
1119
  env, latest_source, offline=offline, max_age=max_age,
1071
1120
  timeout=HOOK_FETCH_TIMEOUT_SECONDS if hook_mode else FETCH_TIMEOUT_SECONDS, backoff=hook_mode,
@@ -1081,6 +1130,8 @@ def run_check(env: Env, project: Path | None, *, latest_source: str | None = Non
1081
1130
  state = install_state(env, latest, everything, others, declared_marketplaces(env, project), selection["active"])
1082
1131
  content = content_findings(project, latest) if project else []
1083
1132
  opinion = opinion_findings(project, installed) if project else []
1133
+ # Explicit `check` only (never the session-start hook, doctor or update): one bounded read-only preview per project.
1134
+ opinion_migrate = opinion_migrate_findings(project, installed) if project and migrate_hint and not hook_mode else []
1084
1135
  scaffold = scaffold_report(env, project, reprompt=reprompt)
1085
1136
  machine = machine_findings(env, project, reprompt=reprompt, quick=hook_mode)
1086
1137
  local_attention = sum(1 for item in machine["findings"] if item.get("attention"))
@@ -1128,7 +1179,7 @@ def run_check(env: Env, project: Path | None, *, latest_source: str | None = Non
1128
1179
  settings = user_settings_module()
1129
1180
  language = settings.report_section(env.variables, settings.read_settings(env.config_file)[0], scaffold,
1130
1181
  drift=language_drift(project) if project else None, cli=CLI)
1131
- return {
1182
+ report = {
1132
1183
  "ok": True,
1133
1184
  "latest": {"source": origin, "released_at": latest.get("released_at")},
1134
1185
  "_latest": latest,
@@ -1168,6 +1219,9 @@ def run_check(env: Env, project: Path | None, *, latest_source: str | None = Non
1168
1219
  or local_attention),
1169
1220
  },
1170
1221
  }
1222
+ if opinion_migrate: # advisory: not in summary, not in up_to_date, absent when silent so existing output is unchanged
1223
+ report["opinion_migrate"] = opinion_migrate
1224
+ return report
1171
1225
 
1172
1226
 
1173
1227
  def update_hint(client: str | None) -> str | None:
@@ -1378,6 +1432,28 @@ def render_install_state(state: dict) -> list[str]:
1378
1432
  return lines
1379
1433
 
1380
1434
 
1435
+ def render_opinion_migrate(findings: list[dict]) -> list[str]:
1436
+ lines = []
1437
+ for item in findings:
1438
+ if item["status"] == "preview":
1439
+ target = item.get("target") or {}
1440
+ ids = [str(update.get("id")) for update in item.get("updates") or [] if update.get("id")]
1441
+ line = _(" [Opinion·可迁移] 该项目的 opinion 有可迁移到标签按需加载的内容:目标 {0}(schema {1})").format(
1442
+ target.get("profile"), target.get("schema_version"))
1443
+ if item.get("updates"):
1444
+ line += _(",{0} 项更新").format(len(item["updates"]))
1445
+ if ids:
1446
+ line += _("(") + _("、").join(ids[:3]) + (_("等") if len(ids) > 3 else "") + _(")")
1447
+ if item.get("inbox_incomplete"):
1448
+ line += _(",{0} 条收件箱记录未完成").format(item["inbox_incomplete"])
1449
+ lines.append(line + _("\n 查看迁移预览(只读):{0}\n 确认后再执行;不迁移则保持原样,不影响现有行为。").format(item["command"]))
1450
+ elif item.get("reason") == "manual-edit-conflict":
1451
+ lines.append(_(" [Opinion·可迁移] 迁移预览发现手工改动与迁移冲突,需要你先处理 OPINION.md 的改动。\n 查看详情(只读):{0}").format(item["command"]))
1452
+ elif item.get("reason") == "catalog-conflict":
1453
+ lines.append(_(" [Opinion·可迁移] 迁移预览发现公开 catalog 与 Profile 记录的来源不一致,暂时无法迁移。\n 查看详情(只读):{0}").format(item["command"]))
1454
+ return lines
1455
+
1456
+
1381
1457
  def render_text(report: dict, *, show_skipped: bool = False, details: bool = False, show_extras: bool = False) -> str:
1382
1458
  lines = []
1383
1459
  origin = report["latest"]["source"]
@@ -1451,6 +1527,7 @@ def render_text(report: dict, *, show_skipped: bool = False, details: bool = Fal
1451
1527
  lines.append(_(" [Opinion] 有新版本:{0}(用 opinion-manager 预览后确认)").format(refs))
1452
1528
  elif item["status"] in {"error", "unknown"}:
1453
1529
  lines.append(f" [Opinion] {item.get('error')}")
1530
+ lines += render_opinion_migrate(report.get("opinion_migrate") or [])
1454
1531
  lines += render_scaffold(report, show_skipped, details, show_extras)
1455
1532
  lines += render_machine(report, details=details)
1456
1533
  lines += [_(" [语言] {0}").format(hint) for hint in (report.get("language") or {}).get("hints", [])]
@@ -1574,7 +1651,7 @@ def hook(env: Env, project: Path | None, output: str, *, latest_source: str | No
1574
1651
 
1575
1652
  # ---------------------------------------------------------------- install / update / migrate
1576
1653
 
1577
- CLIENTS = ("claude", "codex", "cursor")
1654
+ CLIENTS = client_registry.default_ids() # the default set, derived from the driver registry
1578
1655
 
1579
1656
 
1580
1657
  def github_slug(latest: dict) -> str:
@@ -1585,14 +1662,10 @@ def github_slug(latest: dict) -> str:
1585
1662
 
1586
1663
 
1587
1664
  def detect_clients(env: Env) -> list[str]:
1588
- found = []
1589
- if find_cli(env, "claude") or env.claude_dir.is_dir():
1590
- found.append("claude")
1591
- if find_cli(env, "codex") or env.codex_dir.is_dir():
1592
- found.append("codex")
1593
- if (env.home / ".cursor").is_dir():
1594
- found.append("cursor")
1595
- return found
1665
+ """Default-set clients whose declared detection evidence (executable or configuration directory) is present."""
1666
+ return [driver["id"] for driver in client_registry.BUILTIN
1667
+ if driver["capabilities"]["default_set"]
1668
+ and client_registry.detect(driver, env.home, env.get, lambda name: find_cli(env, name))["detected"]]
1596
1669
 
1597
1670
 
1598
1671
  def _safe_extract(archive: Path, destination: Path) -> None:
@@ -2533,6 +2606,54 @@ def parser() -> argparse.ArgumentParser:
2533
2606
  help=_("用户级设置:界面语言、语言提示、项目文件语言(config show / language / language-hint / project-language;默认只预览)"))
2534
2607
  sub.add_parser("project", add_help=False,
2535
2608
  help=_("项目自助入口:找资料、看进展、项目指南、检查(不需要 AI Agent;详见 project --help)"))
2609
+ inventory = sub.add_parser("inventory", help=_("只读:列出各客户端能看到的 Skill 与 MCP(存放位置、重复、description 字节数),输出带 schema_version 的稳定 JSON"))
2610
+ inventory.add_argument("--output", choices=("text", "json"), default="text")
2611
+ inventory.add_argument("--client", action="append", choices=(*sorted(client_registry.all_ids()), "all"),
2612
+ help=_("只看这个客户端(可重复);默认 claude、codex、cursor;claude-desktop 须点名或用 all"))
2613
+ inventory.add_argument("--type", choices=("skills", "mcp", "all"), default="all", help=_("只看 Skill 或 MCP;默认全部"))
2614
+ inventory.add_argument("--scope", choices=("project", "user", "all"), default="all", help=_("只看项目级或用户级;默认全部"))
2615
+ inventory.add_argument("--project", type=Path, default=None, help=_("项目目录;默认当前目录"))
2616
+ inventory.add_argument("--include-description", action="store_true",
2617
+ help=_("在 JSON 里附上 description 文本(截断到 1,536 个字符);默认不输出"))
2618
+ inventory.add_argument("--lang", choices=("auto", "zh", "en"), help=_("输出语言;默认 AGENTHELM_LANG,再到用户配置与系统语言"))
2619
+ inventory.add_argument("--home", type=Path, help=argparse.SUPPRESS)
2620
+ clients_parser = sub.add_parser("clients", help=_("只读:列出已注册的客户端驱动,以及本机检测到哪些(依据、分发驱动类型、能力标志)"))
2621
+ clients_parser.add_argument("--output", choices=("text", "json"), default="text")
2622
+ clients_parser.add_argument("--lang", choices=("auto", "zh", "en"), help=_("输出语言;默认 AGENTHELM_LANG,再到用户配置与系统语言"))
2623
+ clients_parser.add_argument("--home", type=Path, help=argparse.SUPPRESS)
2624
+ relocate = sub.add_parser("relocate", help=_("把一个 Skill 或 MCP 复制或迁移到另一个客户端/作用域(默认预览;--apply --expect-plan <指纹> 才写入)"))
2625
+ relocate.add_argument("ref", help=_("inventory 的 Skill 或 MCP 引用,如 skill:名字@claude:user、mcp:名字@claude:user"))
2626
+ relocate.add_argument("--to", required=True, help=_("目标 <客户端>:<作用域>,如 codex:project;MCP 的作用域为 user|local|project"))
2627
+ relocate.add_argument("--mode", choices=("copy", "link"), default="copy", help=_("copy(默认)或 link(只限同一作用域内的相对符号链接)"))
2628
+ relocate.add_argument("--project", type=Path, default=None, help=_("项目目录;默认当前目录"))
2629
+ relocate.add_argument("--allow-widen", action="store_true", help=_("允许放宽(项目级 → 用户级)"))
2630
+ relocate.add_argument("--keep-source", action="store_true", help=_("复制并保留源;默认校验通过后把源归档(不是删除)"))
2631
+ relocate.add_argument("--confirm-project-content", action="store_true",
2632
+ help=_("确认进入项目目录的内容许可证合适且不含私有内容(用户级 → 项目级时需要)"))
2633
+ relocate.add_argument("--apply", action="store_true", help=_("写入;必须同时带 --expect-plan"))
2634
+ relocate.add_argument("--expect-plan", help=_("预览输出的计划指纹;与重新计算的结果不一致则拒绝写入"))
2635
+ relocate.add_argument("--output", choices=("text", "json"), default="text")
2636
+ relocate.add_argument("--lang", choices=("auto", "zh", "en"), help=_("输出语言;默认 AGENTHELM_LANG,再到用户配置与系统语言"))
2637
+ relocate.add_argument("--home", type=Path, help=argparse.SUPPRESS)
2638
+ relocate.add_argument("--recovery-root", type=Path, help=argparse.SUPPRESS)
2639
+ dedupe = sub.add_parser("dedupe", help=_("处置 inventory 报告的一个重复分组:保留一份并归档其余(Skill)、全部保留、忽略(默认预览;--apply --expect-plan <指纹> 才写入)"))
2640
+ dedupe.add_argument("group", nargs="?", help=_("分组 id(用 --list 查看)"))
2641
+ dedupe.add_argument("--list", action="store_true", help=_("只读:列出重复分组与已记录的决定"))
2642
+ dedupe.add_argument("--keep", help=_("保留的条目引用(配合 --retire-others 或 --desktop-snippet)"))
2643
+ dedupe.add_argument("--retire-others", action="store_true", help=_("归档其余 Skill 副本;MCP 副本只输出手工命令,工具不编辑"))
2644
+ dedupe.add_argument("--keep-all", action="store_true", help=_("都保留:只写决定文件,需要 --note"))
2645
+ dedupe.add_argument("--note", help=_("--keep-all 的保留理由(最长 200 个字符,不要写凭据)"))
2646
+ dedupe.add_argument("--ignore", action="store_true", help=_("忽略这一组:只写决定文件,可用 --unignore 撤销"))
2647
+ dedupe.add_argument("--unignore", action="store_true", help=_("撤销对这一组的 --ignore"))
2648
+ dedupe.add_argument("--desktop-snippet", action="store_true",
2649
+ help=_("只读:给出 claude_desktop_config.json 的路径与可粘贴的 mcpServers 片段(不写任何文件)"))
2650
+ dedupe.add_argument("--project", type=Path, default=None, help=_("项目目录;默认当前目录"))
2651
+ dedupe.add_argument("--apply", action="store_true", help=_("写入;必须同时带 --expect-plan"))
2652
+ dedupe.add_argument("--expect-plan", help=_("预览输出的计划指纹;与重新计算的结果不一致则拒绝写入"))
2653
+ dedupe.add_argument("--output", choices=("text", "json"), default="text")
2654
+ dedupe.add_argument("--lang", choices=("auto", "zh", "en"), help=_("输出语言;默认 AGENTHELM_LANG,再到用户配置与系统语言"))
2655
+ dedupe.add_argument("--home", type=Path, help=argparse.SUPPRESS)
2656
+ dedupe.add_argument("--recovery-root", type=Path, help=argparse.SUPPRESS)
2536
2657
  locate_parser = sub.add_parser("locate", help=_("输出插件的已安装位置(最新优先),供下游脚本查找"))
2537
2658
  locate_parser.add_argument("plugin")
2538
2659
  locate_parser.add_argument("--version", help=_("只要这个版本"))
@@ -2654,6 +2775,39 @@ def _print_steps(results: list[dict], apply: bool) -> None:
2654
2775
  print(_("以上为预览;确认后追加 --apply 执行。"))
2655
2776
 
2656
2777
 
2778
+ def run_inventory(args: argparse.Namespace, env: Env) -> int:
2779
+ """Thin entry: the observation lives in ``agent_pack_inventory`` (read-only, never writes)."""
2780
+ if args.lang and args.lang != "auto":
2781
+ os.environ["AGENTHELM_LANG"] = args.lang
2782
+ sys.path.insert(0, str(RUNTIME_DIR))
2783
+ import agent_pack_inventory # noqa: PLC0415 - shipped next to this file
2784
+
2785
+ project = (args.project or Path.cwd()).resolve()
2786
+ report = agent_pack_inventory.observe(env.home, project, args.client, args.type, args.scope,
2787
+ include_description=args.include_description)
2788
+ if args.output == "json":
2789
+ print(json.dumps(report, ensure_ascii=False, indent=2))
2790
+ else:
2791
+ sys.stdout.write(agent_pack_inventory.render_text(report))
2792
+ return 0
2793
+
2794
+
2795
+ def run_relocate(args: argparse.Namespace, env: Env) -> int:
2796
+ """Thin entry: planning and writing live in ``agent_pack_relocate`` (preview by default)."""
2797
+ sys.path.insert(0, str(RUNTIME_DIR))
2798
+ import agent_pack_relocate # noqa: PLC0415 - shipped next to this file
2799
+
2800
+ return agent_pack_relocate.run(args, env.home)
2801
+
2802
+
2803
+ def run_dedupe(args: argparse.Namespace, env: Env) -> int:
2804
+ """Thin entry: grouping, planning and writing live in ``agent_pack_dedupe`` (preview by default)."""
2805
+ sys.path.insert(0, str(RUNTIME_DIR))
2806
+ import agent_pack_dedupe # noqa: PLC0415 - shipped next to this file
2807
+
2808
+ return agent_pack_dedupe.run(args, env.home)
2809
+
2810
+
2657
2811
  def run_project(argv: list[str]) -> int:
2658
2812
  """``agenthelm project``: hand over to project-orchestrator's project entry, which owns it."""
2659
2813
  installed = installed_plugins(current_env(), {"project-orchestrator"})
@@ -2803,6 +2957,21 @@ def main(argv: list[str] | None = None) -> int:
2803
2957
  project = (args.project or Path.cwd()).resolve()
2804
2958
  if args.command == "check" and args.hook:
2805
2959
  return hook(env, project, args.hook_format, latest_source=args.latest, offline=args.offline, clients=args.client)
2960
+ if args.command == "inventory":
2961
+ return run_inventory(args, env)
2962
+ if args.command == "clients":
2963
+ if args.lang and args.lang != "auto":
2964
+ os.environ["AGENTHELM_LANG"] = args.lang
2965
+ data = client_registry.report(env.home, env.get, lambda name: find_cli(env, name))
2966
+ if args.output == "json":
2967
+ print(json.dumps(data, ensure_ascii=False, indent=2))
2968
+ else:
2969
+ sys.stdout.write(client_registry.render_text(data))
2970
+ return 0
2971
+ if args.command == "relocate":
2972
+ return run_relocate(args, env)
2973
+ if args.command == "dedupe":
2974
+ return run_dedupe(args, env)
2806
2975
  if args.command == "locate":
2807
2976
  found = locate(env, args.plugin, args.version, include_legacy=args.include_legacy)
2808
2977
  if args.output == "json":
@@ -2814,7 +2983,7 @@ def main(argv: list[str] | None = None) -> int:
2814
2983
  if args.command == "check":
2815
2984
  report = run_check(env, project, latest_source=args.latest, offline=args.offline,
2816
2985
  max_age=0 if args.refresh else CACHE_TTL_SECONDS, reprompt=args.reprompt,
2817
- clients=args.client, source=args.source)
2986
+ clients=args.client, source=args.source, migrate_hint=True)
2818
2987
  report.pop("_latest")
2819
2988
  if args.fingerprint or args.explain:
2820
2989
  return print_fingerprint(env, report, args, project)
@@ -638,5 +638,254 @@
638
638
  "{0} 个步骤不可用": "{0} unavailable",
639
639
  "{0} 个步骤失败": "{0} failed",
640
640
  "agenthelm(套件版本未知:此运行时不含 index.json);agent-pack 插件 {0}": "agenthelm (suite version unknown: this runtime ships without index.json); agent-pack plugin {0}",
641
- "输出 agenthelm 套件版本后退出": "Print the agenthelm suite version and exit"
641
+ "输出 agenthelm 套件版本后退出": "Print the agenthelm suite version and exit",
642
+ "只读:列出各客户端能看到的 Skill 与 MCP(存放位置、重复、description 字节数),输出带 schema_version 的稳定 JSON": "Read-only: list the Skills and MCP servers each client can see (where they live, duplicates, description bytes); the JSON output carries a stable schema_version",
643
+ "只看 Skill 或 MCP;默认全部": "Only Skills or only MCP servers; default is both",
644
+ "只看项目级或用户级;默认全部": "Only project-level or only user-level entries; default is both",
645
+ "输出语言;默认 AGENTHELM_LANG,再到用户配置与系统语言": "Output language; default is AGENTHELM_LANG, then the user setting, then the system locale",
646
+ "JSON 无法解析": "JSON cannot be parsed",
647
+ "TOML 无法解析": "TOML cannot be parsed",
648
+ "无法读取": "Cannot be read",
649
+ "文件过大,未读取": "File too large; not read",
650
+ "结构不是预期的对象": "Unexpected structure (not an object)",
651
+ "~/.claude.json 里按项目路径存放的条目结构无法识别": "The entries ~/.claude.json keeps under the project path have an unrecognized structure",
652
+ "符号链接已失效": "Broken symlink",
653
+ "SKILL.md 没有可读的 frontmatter": "SKILL.md has no readable frontmatter",
654
+ "frontmatter 没有 description": "The frontmatter has no description",
655
+ "frontmatter 的 name 与目录名不同": "The frontmatter name differs from the directory name",
656
+ "SKILL.md 过大,未解析": "SKILL.md is too large; not parsed",
657
+ "Codex 只在受信任的项目里读取项目级配置;本工具读不到信任记录": "Codex reads project-level config only in trusted projects; this tool cannot read the trust record",
658
+ "用户级优先于项目级(官方文档)": "User level wins over project level (official documentation)",
659
+ "两份都会出现在选择器里(官方文档)": "Both appear in the selector (official documentation)",
660
+ "官方文档没有说明优先级": "The official documentation does not state a precedence",
661
+ "local 优先于 project 优先于 user(官方文档)": "local wins over project wins over user (official documentation)",
662
+ "项目级条目是否已批准未读取,无法判定哪份生效": "Whether the project-level entry is approved was not read, so which one takes effect is undetermined",
663
+ "项目是否受信任未读取,无法判定哪份生效": "Whether the project is trusted was not read, so which one takes effect is undetermined",
664
+ "无法判定": "Undetermined",
665
+ "同一个文件": "The same file",
666
+ "内容相同": "Identical content",
667
+ "内容不同": "Different content",
668
+ "无法比较": "Cannot be compared",
669
+ "项目:{0}": "Project: {0}",
670
+ "[{0}] Skill {1} 个,每次会话开始加载的 description 共 {2} 字节;MCP {3} 个": "[{0}] Skills: {1}; description bytes loaded at the start of every session: {2}; MCP servers: {3}",
671
+ "重复 [{0}] {1}({2}):{3}": "Duplicate [{0}] {1} ({2}): {3}",
672
+ "相似提示(仅机械比对,不是语义判断)[{0}] {1}:{2}": "Similarity hint (mechanical comparison only, not a semantic judgement) [{0}] {1}: {2}",
673
+ "无法判定:{0}({1})": "Undetermined: {0} ({1})",
674
+ "没有发现任何 Skill 或 MCP 配置。": "No Skill or MCP configuration found.",
675
+ "只看这个客户端(可重复);默认 claude、codex、cursor;claude-desktop 须点名或用 all": "Only this client (repeatable); default is claude, codex and cursor; claude-desktop must be named or use all",
676
+ "文件不存在": "File does not exist",
677
+ "本命令只解析 macOS 与 Linux 的路径": "This command resolves only macOS and Linux paths",
678
+ "官方文档没有说明该文件是否展开 ${VAR}": "The official documentation does not say whether this file expands ${VAR}",
679
+ "{0}:{1}({2})": "{0}: {1} ({2})",
680
+ "claude:{0} 在 claude_desktop_config.json 里也有定义;Claude Desktop 的本地 Code 标签可能改用那一份(官方文档当前没有明确同名优先级),独立 CLI 不受影响": "claude: {0} is also defined in claude_desktop_config.json; the Claude Desktop local Code tab may use that definition instead (the official documentation currently states no same-name precedence); the standalone CLI is not affected",
681
+ "在 JSON 里附上 description 文本(截断到 1,536 个字符);默认不输出": "Include the description text in the JSON (truncated to 1,536 characters); off by default",
682
+ "目录文件过多,未统计大小与文件数": "Too many files in the directory; size and file count not computed",
683
+ "只读:列出已注册的客户端驱动,以及本机检测到哪些(依据、分发驱动类型、能力标志)": "Read-only: list the registered client drivers and which ones this machine has (evidence, distribution driver type, capability flags)",
684
+ "含不支持的字段:{0}": "Unsupported fields: {0}",
685
+ "schema_version 必须为 1": "schema_version must be 1",
686
+ "id 必须匹配 ^[a-z][a-z0-9-]{0,31}$": "id must match ^[a-z][a-z0-9-]{0,31}$",
687
+ "id 与内置客户端冲突:{0}": "id clashes with a built-in client: {0}",
688
+ "display 必须是 1–64 字符的单行文本": "display must be single-line text of 1–64 characters",
689
+ "detect 必须是只含 executables / dirs 的对象": "detect must be an object with only executables / dirs",
690
+ "detect.executables 必须是可执行文件名列表(不含路径与参数)": "detect.executables must be a list of executable names (no paths or arguments)",
691
+ "detect.dirs 必须是 ~/ 开头、不含 .. 的路径列表": "detect.dirs must be a list of paths that start with ~/ and contain no ..",
692
+ "detect 至少要有一项检测依据": "detect needs at least one piece of evidence",
693
+ "distribution 必须是:{0}": "distribution must be one of: {0}",
694
+ "stores 必须是只含 skills / mcp 的对象": "stores must be an object with only skills / mcp",
695
+ "stores.{0} 的每一项必须是 scope / path / format(取值见文档)": "Every entry of stores.{0} must be scope / path / format (values are in the docs)",
696
+ "capabilities 只能含布尔值的:{0}": "capabilities may only hold these boolean flags: {0}",
697
+ "不是普通文件或超过 {0} 字节": "Not a regular file, or larger than {0} bytes",
698
+ "id 重复:{0}": "Duplicate id: {0}",
699
+ "无法读取:{0}": "Cannot read: {0}",
700
+ "客户端驱动(内置与用户声明):": "Client drivers (built-in and user-declared):",
701
+ "已检测到({0}:{1})": "detected ({0}: {1})",
702
+ "可执行文件": "executable",
703
+ "目录": "directory",
704
+ "未检测到": "not detected",
705
+ "已声明,本版未支持安装": "declared; install is not supported in this version",
706
+ "警告:忽略声明 {0}:{1}": "Warning: ignoring declaration {0}: {1}",
707
+ "{0}({1}):{2};分发 {3};能力 {4}": "{0} ({1}): {2}; distribution {3}; capabilities {4}",
708
+ "用户级 · 对所有项目生效": "User level · applies to every project",
709
+ "项目级 · 仅此项目 · .claude/skills": "Project level · this project only · .claude/skills",
710
+ "项目级 · 仅此项目 · local(~/.claude.json,不进版本库)": "Project level · this project only · local (~/.claude.json, not in version control)",
711
+ "项目级 · 仅此项目 · 项目文件 .mcp.json": "Project level · this project only · project file .mcp.json",
712
+ "只统计在本机同步过的项目(~/.claude/agent-pack/state),未同步过的项目看不到,也无法计入": "Only projects synced on this machine (~/.claude/agent-pack/state) are counted; projects never synced here are not visible and cannot be counted",
713
+ "其中也声明了它的项目记录:{names}": "Of these, records that also declare it: {names}",
714
+ "跳过 {kind} {name}({client}):{reason}": "Skipped {kind} {name} ({client}): {reason}",
715
+ "项目级写入尚未提供;不会回退写入用户级": "project-level write is not available yet; it is never written to the user level instead",
716
+ "Skill 由项目 .agents/skills 原生加载,不写用户级包": "the Skill is loaded natively from the project's .agents/skills; it is not copied into the user-level package",
717
+ "该客户端的项目级 MCP 写入尚未提供;不会回退写入用户级": "project-level MCP write for this client is not available yet; it is never written to the user level instead",
718
+ "{kind} {name} 声明为项目级,对 {client} 跳过:{reason}": "{kind} {name} is declared project-level and is skipped for {client}: {reason}",
719
+ "为项目里不存在的条目声明了作用域:{names}": "Scope declared for entries the project does not define: {names}",
720
+ "收窄:{n} 个项目将不再看到 {kind} {name}": "Narrowing: projects other than this one will no longer see {kind} {name} (known on this machine: {n})",
721
+ "~/.claude.json 里按项目路径存放的条目结构无法识别,未写入": "the entries kept under the project's path in ~/.claude.json have an unrecognized structure; nothing was written",
722
+ "目标位置不可写,未写入": "the target is not writable; nothing was written",
723
+ ".mcp.json 是符号链接,未写入": ".mcp.json is a symbolic link; nothing was written",
724
+ ".mcp.json 无法解析,未写入": ".mcp.json cannot be parsed; nothing was written",
725
+ "替换 {n} 个项目级 MCP 条目;它们只对本项目生效(被替换的原文件进恢复目录)": "Replaces {n} project-level MCP entries; they apply to this project only (the original file goes to recovery)",
726
+ "用户级原条目将归档到恢复目录(可取回)": "The original user-level entry will be archived to the recovery directory (it can be restored)",
727
+ "本次不改动用户级原条目": "The original user-level entry is left as it is",
728
+ "收窄": "narrowing",
729
+ "放宽": "widening",
730
+ "作用域迁移({direction}):{kind} {name}": "Scope migration ({direction}): {kind} {name}",
731
+ "写入新位置:{action}": "Write the new location: {action}",
732
+ "从旧位置退役(不自动编辑,请手工执行):{command}": "Retire the old location (not edited automatically; run by hand): {command}",
733
+ "旧位置不由本包创建,不退役": "The old location was not created by this package; it is not retired",
734
+ "从旧位置退役:{action}": "Retire the old location: {action}",
735
+ "放宽:此后所有项目都会看到 {kind} {name}": "Widening: every project will see {kind} {name} from now on",
736
+ "替换 {n} 个项目级 Skill;它们只对本项目生效(被替换的原件进恢复目录)": "Replaces {n} project-level Skills; they apply to this project only (the replaced originals go to recovery)",
737
+ "项目位于同步盘({service}):项目级 Skill 改为复制而不是符号链接(同步盘对符号链接的行为未核实)": "The project sits in a sync folder ({service}): project-level Skills are copied instead of linked (how sync folders treat symbolic links is unverified)",
738
+ "{kind} {name}:{shadowed} 的同名项被 {winner} 优先({rule},仅建议)": "{kind} {name}: the same-named entry in {shadowed} is outranked by {winner} ({rule}; advisory only)",
739
+ "项目 .claude/skills 或 .claude 是符号链接,未写入": "the project's .claude/skills or .claude is a symbolic link; nothing was written",
740
+ "Skill 源目录不在项目内,未写入": "the Skill source directory is outside the project; nothing was written",
741
+ "本次不改动用户级原条目(项目级写入尚未提供或未选择)": "The original user-level entry is left as it is this time (project-level write is not available yet or not selected)",
742
+ "放宽:这个 Skill 之后在所有项目里可见": "Widening: this Skill becomes visible in every project",
743
+ "无需写入:{to} 已被该客户端原生读取": "Nothing to write: {to} is already read natively by that client",
744
+ "在 {to} 下建恢复目录(权限 0700)": "Create a recovery directory under {to} (mode 0700)",
745
+ "复制 {from} → {to}({files} 个条目,目录内符号链接保持为链接)": "Copy {from} -> {to} ({files} entries; symbolic links inside the directory stay links)",
746
+ "建立相对符号链接 {to} → {target}": "Create the relative symbolic link {to} -> {target}",
747
+ "读回校验 {to}:逐文件比较相对路径与内容摘要,SKILL.md 摘要与源一致": "Read back {to}: compare relative paths and content digests file by file; the SKILL.md digest must equal the source's",
748
+ "校验通过后把源 {from} 归档到恢复目录(归档不是删除)": "After verification, archive the source {from} into the recovery directory (archiving is not deleting)",
749
+ "保留源 {from}": "Keep the source {from}",
750
+ "下一步:重启 {client} 或重新进入项目,确认它出现(工具不执行客户端命令)": "Next: restart {client} or re-enter the project and confirm it appears (this tool runs no client command)",
751
+ "恢复:把归档目录移回原位(本版没有 restore 命令)": "To restore: move the archived directory back (this version has no restore command)",
752
+ "这个客户端已经原生读取该存储,无需写入": "This client already reads that store natively; no write needed",
753
+ "符号链接模式必然保留源(目标指向它);两处内容同步变化": "Link mode always keeps the source (the target points to it); a change in one place shows in the other",
754
+ "agenthelm relocate:预览(未写入任何文件)": "agenthelm relocate: preview (nothing written)",
755
+ "agenthelm relocate:已执行": "agenthelm relocate: executed",
756
+ "只支持 macOS 与 Linux\n": "Only macOS and Linux are supported\n",
757
+ "--apply 必须带 --expect-plan <计划指纹>(先预览取得)\n": "--apply requires --expect-plan <plan digest> (get it from a preview first)\n",
758
+ "引用格式应为 skill:<名>@<客户端>:<作用域>": "The reference must look like skill:<name>@<client>:<scope>",
759
+ "目标格式应为 <客户端>:<作用域>,客户端为 {0},作用域为 user|project": "The target must be <client>:<scope>, client one of {0}, scope user|project",
760
+ "没有找到这个 Skill 引用": "No Skill matches this reference",
761
+ "需要项目目录,请用 --project 指定": "A project directory is needed; pass --project",
762
+ "源条目没有文件级证据(目录损坏或没有可读的 SKILL.md),只读,不能迁移": "The source has no file-level evidence (broken directory or unreadable SKILL.md); read-only, cannot be relocated",
763
+ "项目级 → 用户级会放宽作用域(所有项目都会看到),需要 --allow-widen": "Project -> user level widens the scope (every project would see it); --allow-widen is required",
764
+ "目标就是源本身": "The target is the source itself",
765
+ "来源:{0}": "Source: {0}",
766
+ "同级": "same level",
767
+ "方式:{0};方向:{1}": "Mode: {0}; direction: {1}",
768
+ "注意:{0}": "Note: {0}",
769
+ "跨作用域(家目录 ↔ 项目)不能用符号链接,只能复制": "Symbolic links cannot cross scopes (home <-> project); copy only",
770
+ "需要确认:{0}(加 --confirm-project-content)": "Confirmation needed: {0} (add --confirm-project-content)",
771
+ "目标:{0}:{1} {2}": "Target: {0}:{1} {2}",
772
+ "需要确认({0}):{1}": "Confirmation needed ({0}): {1}",
773
+ "已阻止 [{0}]:{1}": "Blocked [{0}]: {1}",
774
+ "计划指纹:{0}": "Plan digest: {0}",
775
+ "结果:{0}": "Result: {0}",
776
+ "Skill 目录内有指向目录外的符号链接,复制后会失效": "The Skill directory has symbolic links pointing outside it; they would break after copying",
777
+ "目标已存在同名条目(内容{0}),不覆盖、不改名、不合并": "A same-name entry already exists at the target (content {0}); it is not overwritten, renamed or merged",
778
+ "相同": "identical",
779
+ "不同": "different",
780
+ "将进入项目目录:{0}(可能被提交到版本库);请自行确认其许可证与是否含私有内容,工具无法判断": "Will enter the project directory: {0} (may be committed to version control); confirm yourself that its license allows it and that it holds nothing private - this tool cannot judge that",
781
+ "失败,已回滚:{0}": "Failed and rolled back: {0}",
782
+ "确认后执行:{0}": "To apply: {0}",
783
+ "恢复目录:{0}": "Recovery directory: {0}",
784
+ "手工恢复:{0}": "Manual restore: {0}",
785
+ "计划指纹与预览不一致(源、目标或参数已变化),未写入;请重新预览。当前指纹:{0}": "The plan digest differs from the preview (source, target or options changed); nothing written. Preview again. Current digest: {0}",
786
+ "Skill 目录文件过多(超过 {0} 个),不迁移": "The Skill directory has too many files (over {0}); not relocated",
787
+ "检测到同步盘位置({0}):同步盘对符号链接的行为没有一手文档,已降级为复制": "A synced-folder location was detected ({0}): there is no first-party documentation of how sync products treat symbolic links, so the link was downgraded to a copy",
788
+ "copy(默认)或 link(只限同一作用域内的相对符号链接)": "copy (default) or link (a relative symbolic link, within the same scope only)",
789
+ "允许放宽(项目级 → 用户级)": "Allow widening (project level -> user level)",
790
+ "复制并保留源;默认校验通过后把源归档(不是删除)": "Copy and keep the source; by default the source is archived after verification (not deleted)",
791
+ "确认进入项目目录的内容许可证合适且不含私有内容(用户级 → 项目级时需要)": "Confirm that the content entering the project has a suitable license and nothing private (needed for user level -> project level)",
792
+ "写入;必须同时带 --expect-plan": "Write; must be combined with --expect-plan",
793
+ "预览输出的计划指纹;与重新计算的结果不一致则拒绝写入": "Plan digest from the preview; the write is refused when it differs from the recomputed one",
794
+ "归档 {from} 到恢复目录(归档不是删除)": "Archive {from} into the recovery directory (archiving is not deleting)",
795
+ "下一步:重启 {client} 或重新进入项目,确认结果(工具不执行客户端命令)": "Next: restart {client} or re-enter the project and check the result (this tool runs no client command)",
796
+ "{ref}:不可由工具归档,见下面的手工命令": "{ref}: not archivable by this tool; see the manual command below",
797
+ "写入决定文件 {to}(权限 0600,不含任何值)": "Write the decision file {to} (mode 0600, no values)",
798
+ "从决定文件 {to} 移除这个分组的决定": "Remove this group's decision from the decision file {to}",
799
+ "重复分组(用 id 调用 dedupe):": "Duplicate groups (pass the id to dedupe):",
800
+ "只写决定文件,不改任何客户端配置": "Only the decision file is written; no client configuration changes",
801
+ "MCP 副本不可由工具归档:配置文件可能含本地凭据,本工具不编辑它,只给手工命令": "MCP copies cannot be archived by this tool: the config file may hold local credentials, so it is not edited; only manual commands are given",
802
+ "先自己备份 ~/.claude.json,再执行下面的命令": "Back up ~/.claude.json yourself first, then run the commands below",
803
+ "没有发现重复分组。": "No duplicate groups found.",
804
+ "agenthelm dedupe:预览(未写入任何文件)": "agenthelm dedupe: preview (nothing written)",
805
+ "agenthelm dedupe:已执行": "agenthelm dedupe: executed",
806
+ "其他客户端里有同指纹的条目:跨客户端的相同 MCP 不冲突,建议保留,不推荐退役": "Other clients have entries with the same fingerprint: the same MCP across clients does not conflict; keeping is recommended, retiring is not",
807
+ "必须且只能选一个:--keep <ref> --retire-others、--keep-all、--ignore、--unignore": "Choose exactly one: --keep <ref> --retire-others, --keep-all, --ignore, --unignore",
808
+ "没有这个重复分组;先用 --list 查看": "No such duplicate group; run --list first",
809
+ "这个分组当前不是 ignore 状态": "This group is not currently ignored",
810
+ "--retire-others 需要 --keep <ref>": "--retire-others needs --keep <ref>",
811
+ "--keep 的引用不在这个分组里": "The --keep reference is not in this group",
812
+ "各副本内容不同:退役的副本只是归档,之后可手工移回": "The copies differ in content: retired copies are only archived and can be moved back by hand",
813
+ "哪一份生效官方文档没有给出(或需要读设置),请自行确认后再执行": "The official documentation does not say which copy wins (or it needs a setting that is not read); confirm yourself before running",
814
+ "分组:{0}({1})": "Group: {0} ({1})",
815
+ "--keep-all 需要 --note 写明保留理由": "--keep-all needs --note stating the reason",
816
+ "手工删除 {0} 里名为 {1} 的 MCP 条目(先自己备份该文件)": "Delete the MCP entry named {1} in {0} by hand (back the file up first)",
817
+ "手工(不可由工具归档):{0}": "Manual (not archivable by this tool): {0}",
818
+ "--desktop-snippet 需要有效的分组 id 和 --keep <mcp 引用>": "--desktop-snippet needs a valid group id and --keep <mcp reference>",
819
+ "失败:{0}": "Failed: {0}",
820
+ "[已决定:{0}{1}]": "[decided: {0}{1}]",
821
+ ",过期": ", stale",
822
+ " 先备份:{0}": " Back up first: {0}",
823
+ "备注疑似含有令牌或口令,不写入;决定文件不保存任何凭据": "The note looks like it contains a token or password; not written. The decision file stores no credentials",
824
+ "{0} 没有文件级证据:只读,不能退役": "{0} has no file-level evidence: read-only, cannot be retired",
825
+ "保留的条目依赖要退役的目录:{0}": "The kept entry depends on a directory that would be retired: {0}",
826
+ "{0} 由插件管理:退役后下次同步可能又会出现": "{0} is managed by a plugin: it may reappear after the next sync",
827
+ "备注最长 {0} 个字符": "The note may be at most {0} characters",
828
+ "保存后请完全退出并重启 Claude Desktop": "After saving, fully quit and restart Claude Desktop",
829
+ "<在此填入你的 {0}>": "<fill in your {0}>",
830
+ "Desktop 是否会加载这一项没有可核实的证据,工具只给出文件内容": "There is no verifiable evidence that Desktop loads this entry; the tool only provides file content",
831
+ "把下面的内容合并进文件里的 mcpServers(已有同名条目先自行比较):": "Merge the following into mcpServers in that file (compare any same-name entry yourself first):",
832
+ "只支持 macOS 与 Linux": "Only macOS and Linux are supported",
833
+ "这个条目没有文件级证据,只读": "This entry has no file-level evidence; read-only",
834
+ "这个条目含有内联的凭据值:不生成片段。请先把凭据改成环境变量引用,再重新运行": "This entry holds an inline credential value: no snippet is generated. Change it to an environment-variable reference first, then run again",
835
+ "这是 SSE 传输;Desktop 是否加载未确认": "This is an SSE transport; whether Desktop loads it is unconfirmed",
836
+ "Claude Desktop 配置片段(只读输出,不写任何文件):{0}": "Claude Desktop config snippet (read-only output, no file written): {0}",
837
+ "目标文件:{0}": "Target file: {0}",
838
+ "凭据": "credential",
839
+ "参数里有被脱敏的值,已换成占位符,请自行填入": "Some arguments were redacted and replaced by placeholders; fill them in yourself",
840
+ "官方文档没有说明 claude_desktop_config.json 是否加载远程 url 条目:未确认": "The official documentation does not say whether claude_desktop_config.json loads remote url entries: unconfirmed",
841
+ "条目里没有 command 或 url,无法生成片段": "The entry has neither command nor url; no snippet can be generated",
842
+ "请求头 {0} 未写入片段:Desktop 是否支持未确认": "Request headers left out of the snippet ({0}): whether Desktop supports them is unconfirmed",
843
+ "处置 inventory 报告的一个重复分组:保留一份并归档其余(Skill)、全部保留、忽略(默认预览;--apply --expect-plan <指纹> 才写入)": "Handle one duplicate group reported by inventory: keep one and archive the rest (Skills), keep all, or ignore (preview by default; --apply --expect-plan <digest> writes)",
844
+ "分组 id(用 --list 查看)": "Group id (see --list)",
845
+ "只读:列出重复分组与已记录的决定": "Read-only: list duplicate groups and recorded decisions",
846
+ "保留的条目引用(配合 --retire-others 或 --desktop-snippet)": "Reference of the entry to keep (with --retire-others or --desktop-snippet)",
847
+ "归档其余 Skill 副本;MCP 副本只输出手工命令,工具不编辑": "Archive the other Skill copies; for MCP copies only manual commands are printed, nothing is edited",
848
+ "都保留:只写决定文件,需要 --note": "Keep all: writes only the decision file; needs --note",
849
+ "--keep-all 的保留理由(最长 200 个字符,不要写凭据)": "Reason for --keep-all (at most 200 characters; no credentials)",
850
+ "忽略这一组:只写决定文件,可用 --unignore 撤销": "Ignore this group: writes only the decision file; undo with --unignore",
851
+ "撤销对这一组的 --ignore": "Undo --ignore for this group",
852
+ "只读:给出 claude_desktop_config.json 的路径与可粘贴的 mcpServers 片段(不写任何文件)": "Read-only: print the path of claude_desktop_config.json and a paste-ready mcpServers snippet (no file written)",
853
+ "先自己备份相关配置文件,再手工修改": "Back up the relevant config file yourself first, then edit it by hand",
854
+ "放宽:这个 MCP 之后在所有项目里可见": "Widening: this MCP will be visible in all projects",
855
+ "写入 {to}:条目 {name}(原样复制,不显示任何值)": "Write {to}: entry {name} (copied as is; no value is shown)",
856
+ "读回校验 {to}:条目 {name} 与源逐字段一致": "Read back {to}: entry {name} matches the source field by field",
857
+ "校验通过后从 {from} 移除源条目 {name};原片段存入恢复目录 mcp/(0600),配置文件先整份逐字节备份": "After the check, remove source entry {name} from {from}; the original fragment goes to mcp/ in the recovery directory (0600) and the whole config file is backed up byte for byte first",
858
+ "更新 agent-pack 的归属记录:{name} → {place}": "Update the agent-pack ownership record: {name} -> {place}",
859
+ "引用格式应为 mcp:<名>@<客户端>:<作用域>": "The reference should look like mcp:<name>@<client>:<scope>",
860
+ "MCP 的目标格式应为 <客户端>:<作用域>,作用域为 user|local|project": "An MCP target should look like <client>:<scope>, with scope user|local|project",
861
+ "没有找到这个 MCP 引用": "No MCP entry matches this reference",
862
+ "本版本只在同一客户端的作用域之间迁移 MCP;跨客户端用 transfer 或 sync": "This version moves an MCP only between scopes of one client; use transfer or sync across clients",
863
+ "{0} 的 MCP 配置本工具不写入": "This tool does not write the MCP configuration of {0}",
864
+ "{0} 不支持项目级写入": "{0} does not support project-level writes",
865
+ "MCP 条目只能复制,不支持 --mode link": "An MCP entry can only be copied; --mode link is not supported",
866
+ "目标作用域就是源本身": "The target scope is the source itself",
867
+ "源条目没有文件级证据,只读,不能迁移": "The source entry has no file-level evidence; it is read-only and cannot be moved",
868
+ "读不到源条目(配置文件结构不被识别或已变化),不迁移": "Cannot read the source entry (the config structure is not recognized or has changed); nothing is moved",
869
+ "源条目自上次同步后被改过:仍按受管处理,原片段会完整存入恢复目录": "The source entry was edited after the last sync: it is still treated as managed and the full original fragment goes to the recovery directory",
870
+ "目标存储的结构不被识别,不写入": "The target store has an unrecognized structure; nothing is written",
871
+ "目标文件不可写": "The target file is not writable",
872
+ "条目含内联密钥值,不能写入项目文件 .mcp.json;请先改成 ${VAR} 引用(工具不改写条目)": "The entry has an inline secret value and cannot go into the project file .mcp.json; change it to a ${VAR} reference first (the tool does not rewrite entries)",
873
+ "条目含本机路径({0}),不能写入项目文件 .mcp.json": "The entry depends on this machine ({0}) and cannot go into the project file .mcp.json",
874
+ "将进入项目文件 .mcp.json(可能被提交到版本库);请自行确认其内容适合共享": "It will go into the project file .mcp.json (it may be committed); make sure its content is fine to share",
875
+ "项目 Profile 把 {0} 声明为 {1} 级:下次 sync 会按声明处理它,请同步更新声明": "The project Profile declares {0} as {1}-level: the next sync will follow the declaration, so update it to match",
876
+ "未受管条目不可由工具归档:只复制到新位置,原位置不动;要移除请按下面的手工命令(先自己备份)": "An unmanaged entry cannot be archived by the tool: it is only copied to the new place and the original is left alone; to remove it use the manual command below (back up first)",
877
+ "把 {0} 里的 entry 手工放回 {1} 的 mcpServers.{2};或整份还原 {3}(逐字节备份,会丢掉之后的其他改动)": "Put the entry in {0} back by hand under mcpServers.{2} of {1}; or restore the whole file from {3} (a byte-exact backup; later changes to that file are lost)",
878
+ "本版本只处理 Skill 与 MCP": "This version handles Skills and MCP entries only",
879
+ "inventory 的 Skill 或 MCP 引用,如 skill:名字@claude:user、mcp:名字@claude:user": "Skill or MCP reference from inventory, e.g. skill:name@claude:user, mcp:name@claude:user",
880
+ "目标 <客户端>:<作用域>,如 codex:project;MCP 的作用域为 user|local|project": "Target <client>:<scope>, e.g. codex:project; MCP scopes are user|local|project",
881
+ "把一个 Skill 或 MCP 复制或迁移到另一个客户端/作用域(默认预览;--apply --expect-plan <指纹> 才写入)": "Copy or move one Skill or MCP entry to another client/scope (preview by default; --apply --expect-plan <digest> writes)",
882
+ "{0} 自上次同步后被改过:仍按受管处理,原片段会完整存入恢复目录": "{0} was edited after the last sync: it is still treated as managed and the full original fragment goes to the recovery directory",
883
+ "从 agent-pack 的归属记录里去掉 {name}": "Drop {name} from the agent-pack ownership record",
884
+ " [Opinion·可迁移] 该项目的 opinion 有可迁移到标签按需加载的内容:目标 {0}(schema {1})": " [Opinion migration] this project's opinion has content that can move to on-demand tag loading: target {0} (schema {1})",
885
+ ",{0} 项更新": ", updates: {0}",
886
+ ",{0} 条收件箱记录未完成": ", unfinished inbox records: {0}",
887
+ "等": " and more",
888
+ "\n 查看迁移预览(只读):{0}\n 确认后再执行;不迁移则保持原样,不影响现有行为。": "\n Preview the migration (read-only): {0}\n Run it only after you confirm; if you do not migrate, nothing changes and current behaviour is unaffected.",
889
+ " [Opinion·可迁移] 迁移预览发现手工改动与迁移冲突,需要你先处理 OPINION.md 的改动。\n 查看详情(只读):{0}": " [Opinion migration] the preview found manual edits that conflict with the migration; resolve the OPINION.md changes first.\n Details (read-only): {0}",
890
+ " [Opinion·可迁移] 迁移预览发现公开 catalog 与 Profile 记录的来源不一致,暂时无法迁移。\n 查看详情(只读):{0}": " [Opinion migration] the preview found the public catalog disagrees with the source recorded in the Profile, so it cannot migrate for now.\n Details (read-only): {0}"
642
891
  }