@sakanano-moe/agenthelm 6.8.0 → 6.11.0-rc.2
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.
- package/README.md +1 -1
- package/README.zh-CN.md +2 -0
- package/package.json +1 -1
- package/runtime/index.json +6 -6
- package/runtime/plugins/agent-pack/.codex-plugin/plugin.json +1 -1
- package/runtime/plugins/agent-pack/hooks/hooks.json +32 -0
- package/runtime/plugins/agent-pack/plugin.json +1 -1
- package/runtime/plugins/agent-pack/references/local-only.md +126 -0
- package/runtime/plugins/agent-pack/references/nudge.en.md +58 -0
- package/runtime/plugins/agent-pack/references/nudge.md +58 -0
- package/runtime/plugins/agent-pack/runtime/agent_pack_nudge.py +613 -0
- package/runtime/plugins/agent-pack/runtime/agenthelm.py +1271 -221
- package/runtime/plugins/agent-pack/runtime/agenthelm_runtime.py +114 -65
- package/runtime/plugins/agent-pack/runtime/i18n_agent_pack.py +78 -0
- package/runtime/plugins/agent-pack/runtime/local_only.py +1132 -0
- package/runtime/plugins/agent-pack/runtime/locale/en.json +569 -0
- package/runtime/plugins/agent-pack/runtime/mcp_server.py +25 -0
- package/runtime/plugins/agent-pack/runtime/nudge_text.py +127 -0
- package/runtime/plugins/agent-pack/runtime/user_settings.py +275 -0
- package/runtime/plugins/agent-pack/skills/agent-pack/SKILL.md +11 -1
- package/runtime/plugins/agents-init/.codex-plugin/plugin.json +1 -1
- package/runtime/plugins/agents-init/content.json +4 -4
- package/runtime/plugins/agents-init/plugin.json +1 -1
- package/runtime/plugins/agents-init/skills/agents-init/AGENT.template.md +141 -5
- package/runtime/plugins/agents-init/skills/agents-init/SKILL.md +41 -8
- package/runtime/plugins/agents-init/skills/agents-init/project.schema.json +408 -80
- package/runtime/plugins/agents-init/skills/agents-init/scripts/adopt.py +615 -0
- package/runtime/plugins/agents-init/skills/agents-init/scripts/baseline.py +221 -0
- package/runtime/plugins/agents-init/skills/agents-init/scripts/i18n_init.py +78 -0
- package/runtime/plugins/agents-init/skills/agents-init/scripts/init_project.py +748 -159
- package/runtime/plugins/agents-init/skills/agents-init/scripts/locale/en.json +289 -0
- package/runtime/plugins/agents-init/skills/agents-init/scripts/merge3.py +149 -0
- package/runtime/plugins/agents-init/skills/agents-init/scripts/regions.py +99 -0
- package/runtime/plugins/agents-init/skills/agents-init/scripts/scaffold.py +594 -90
- package/runtime/plugins/agents-init/skills/agents-init/skeleton.json +2 -0
- package/runtime/plugins/agents-init/skills/agents-init/skill.json +1 -1
- package/runtime/plugins/opinion-manager/.codex-plugin/plugin.json +1 -1
- package/runtime/plugins/opinion-manager/plugin.json +1 -1
- package/runtime/plugins/opinion-manager/references/inbox.en.md +48 -0
- package/runtime/plugins/opinion-manager/references/inbox.md +48 -0
- package/runtime/plugins/opinion-manager/runtime/context.py +31 -26
- package/runtime/plugins/opinion-manager/runtime/i18n_opinion.py +78 -0
- package/runtime/plugins/opinion-manager/runtime/inbox.py +398 -0
- package/runtime/plugins/opinion-manager/runtime/inbox_text.py +114 -0
- package/runtime/plugins/opinion-manager/runtime/lifecycle.py +45 -44
- package/runtime/plugins/opinion-manager/runtime/locale/en.json +193 -0
- package/runtime/plugins/opinion-manager/runtime/opinion_manager.py +55 -50
- package/runtime/plugins/opinion-manager/runtime/versioned.py +90 -85
- package/runtime/plugins/opinion-manager/skills/opinion-manager/SKILL.md +15 -2
- package/runtime/plugins/project-orchestrator/.codex-plugin/plugin.json +1 -1
- package/runtime/plugins/project-orchestrator/content.json +30 -3
- package/runtime/plugins/project-orchestrator/plugin.json +1 -1
- package/runtime/plugins/project-orchestrator/references/case-workspaces.md +9 -1
- package/runtime/plugins/project-orchestrator/references/case.schema.json +1 -0
- package/runtime/plugins/project-orchestrator/references/sop-interview.md +83 -0
- package/runtime/plugins/project-orchestrator/references/sop.md +156 -0
- package/runtime/plugins/project-orchestrator/runtime/assets.py +52 -57
- package/runtime/plugins/project-orchestrator/runtime/case.py +139 -80
- package/runtime/plugins/project-orchestrator/runtime/case_structure.py +71 -0
- package/runtime/plugins/project-orchestrator/runtime/case_workspace.py +47 -46
- package/runtime/plugins/project-orchestrator/runtime/i18n_orchestrator.py +78 -0
- package/runtime/plugins/project-orchestrator/runtime/locale/en.json +1450 -0
- package/runtime/plugins/project-orchestrator/runtime/memory.py +45 -45
- package/runtime/plugins/project-orchestrator/runtime/private_paths.py +119 -0
- package/runtime/plugins/project-orchestrator/runtime/project_base.py +37 -19
- package/runtime/plugins/project-orchestrator/runtime/project_cli.py +307 -195
- package/runtime/plugins/project-orchestrator/runtime/project_demo.py +130 -48
- package/runtime/plugins/project-orchestrator/runtime/project_maintain.py +328 -221
- package/runtime/plugins/project-orchestrator/runtime/project_menu.py +167 -89
- package/runtime/plugins/project-orchestrator/runtime/project_real.py +187 -105
- package/runtime/plugins/project-orchestrator/runtime/project_write.py +58 -55
- package/runtime/plugins/project-orchestrator/runtime/sop.py +1670 -0
- package/runtime/plugins/project-orchestrator/runtime/sop_structure.py +226 -0
- package/runtime/plugins/project-orchestrator/runtime/wf.py +74 -70
- package/runtime/plugins/project-orchestrator/skills/project-orchestrator/SKILL.md +22 -0
- package/runtime/plugins/project-orchestrator/sop-templates/blank/SOP.en.md +57 -0
- package/runtime/plugins/project-orchestrator/sop-templates/blank/SOP.md +57 -0
- package/runtime/plugins/project-orchestrator/sop-templates/knowledge-digest/SOP.en.md +77 -0
- package/runtime/plugins/project-orchestrator/sop-templates/knowledge-digest/SOP.md +77 -0
- package/runtime/plugins/project-orchestrator/sop-templates/knowledge-digest/templates/digest.en.md +11 -0
- package/runtime/plugins/project-orchestrator/sop-templates/knowledge-digest/templates/digest.md +11 -0
- package/runtime/plugins/project-orchestrator/sop-templates/video-to-transcript/SOP.en.md +87 -0
- package/runtime/plugins/project-orchestrator/sop-templates/video-to-transcript/SOP.md +87 -0
- package/runtime/plugins/project-orchestrator/sop-templates/weekly-review/SOP.en.md +75 -0
- package/runtime/plugins/project-orchestrator/sop-templates/weekly-review/SOP.md +75 -0
- package/runtime/plugins/project-orchestrator/sop-templates/weekly-review/templates/review.en.md +11 -0
- package/runtime/plugins/project-orchestrator/sop-templates/weekly-review/templates/review.md +12 -0
- package/runtime/plugins/project-orchestrator/templates/CASE.en.md +39 -0
- package/runtime/plugins/agents-init/skills/agents-init/scripts/test_init_project.py +0 -678
- package/runtime/plugins/agents-init/skills/agents-init/scripts/test_scaffold.py +0 -551
|
@@ -115,6 +115,22 @@ TOOLS = [
|
|
|
115
115
|
"additionalProperties": False,
|
|
116
116
|
},
|
|
117
117
|
},
|
|
118
|
+
{
|
|
119
|
+
"name": "agent_pack_cloud_sync_safety_check",
|
|
120
|
+
"title": "Check Cloud-Sync Safety of a Project",
|
|
121
|
+
"description": "Read-only. Inspect a project that lives (or may live) inside an iCloud Drive, Dropbox, OneDrive or Google Drive folder and report anything that should stay on this machine but would be synced: .venv and other virtualenvs, node_modules, tool caches, SQLite -wal/-shm files, plus conflict copies, directories close to or over the configured size limits, npm/pnpm use (their node_modules cannot be moved out of the synced folder; yarn classic and bun can), whether externalized links point at this machine's local store and still exist (a missing target means dependencies are not installed on this device), and whether HOME matches the project's recorded HOME (a hard requirement for the links). Returns structured findings with ids, severity (attention=true means act now), the evidence, and the exact CLI command to run for each fix. It never changes files; to fix, run the returned `agenthelm local-only fix` command (preview by default, --apply to write) or ask the user. Findings the user already dismissed on this machine are left out and listed under `skipped`. Projects that are not in a synced folder and have no local-only configuration return no findings.",
|
|
122
|
+
"inputSchema": {
|
|
123
|
+
"type": "object",
|
|
124
|
+
"properties": {
|
|
125
|
+
"project": {"type": "string", "description": "Project directory (any folder inside an agenthelm project works)."},
|
|
126
|
+
"mode": {"type": "string", "enum": ["quick", "standard", "full"], "default": "standard",
|
|
127
|
+
"description": "quick: shallow scan without sizes (about 1.5 s); standard: complete scan within a 6 s budget; full: complete scan, up to 2 minutes."},
|
|
128
|
+
"home": {"type": "string", "description": "Treat this directory as HOME (testing or isolation)."},
|
|
129
|
+
},
|
|
130
|
+
"required": ["project"],
|
|
131
|
+
"additionalProperties": False,
|
|
132
|
+
},
|
|
133
|
+
},
|
|
118
134
|
{
|
|
119
135
|
"name": "agent_pack_transfer",
|
|
120
136
|
"title": "Transfer Skills and MCP Servers",
|
|
@@ -233,6 +249,15 @@ def _call(name: str, arguments: dict[str, Any]) -> dict[str, Any]:
|
|
|
233
249
|
reset_overrides=bool(arguments.get("resetOverrides", False)),
|
|
234
250
|
recovery_root=Path(recovery_value) if isinstance(recovery_value, str) else None,
|
|
235
251
|
)
|
|
252
|
+
if name == "agent_pack_cloud_sync_safety_check":
|
|
253
|
+
import agenthelm # noqa: PLC0415 - shipped next to this file
|
|
254
|
+
|
|
255
|
+
mode = arguments.get("mode", "standard")
|
|
256
|
+
if mode not in ("quick", "standard", "full"):
|
|
257
|
+
raise AgentPackError("mode must be quick, standard or full")
|
|
258
|
+
report = agenthelm.local_only_report(agenthelm.current_env(home), Path(arguments["project"]), mode=mode)
|
|
259
|
+
report["ok"] = True
|
|
260
|
+
return report
|
|
236
261
|
raise AgentPackError(f"unknown tool: {name}")
|
|
237
262
|
|
|
238
263
|
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"""nudge 面向用户和模型的文案(中文、英文)与语言选择。
|
|
2
|
+
|
|
3
|
+
语言按这个顺序决定:配置 ``nudge.language``(``auto`` / ``zh`` / ``en``,用户配置优先于项目 Profile)→ 环境变量
|
|
4
|
+
``AGENTHELM_LANG`` → 系统 locale(``LC_ALL``、``LC_MESSAGES``、``LANG``)→ 英文。``auto``、空值和 C/POSIX 视为
|
|
5
|
+
未指定;中文 locale 用中文,其他语言的 locale 暂用英文。解析出的语言同时传给 opinion-manager 的 ``inbox``,所以同一次提示
|
|
6
|
+
里用户和模型看到的是同一种语言。候选内容是用户自己的话,不翻译。关键词列表是数据,不属于文案。
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import re
|
|
12
|
+
import shlex
|
|
13
|
+
from typing import Any
|
|
14
|
+
|
|
15
|
+
LANGUAGES = ("zh", "en")
|
|
16
|
+
PLACEHOLDER = re.compile(r"\{(\w+)\}")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
from i18n_agent_pack import DEFAULT_LANGUAGE, normalize, resolve_language # noqa: E402,F401
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
MESSAGES: dict[str, dict[str, str]] = {
|
|
23
|
+
"label_profile": {"zh": "项目 Profile opinion.nudge", "en": "Project Profile opinion.nudge"},
|
|
24
|
+
"label_user": {"zh": "用户配置 nudge", "en": "User config nudge"},
|
|
25
|
+
"warn_object": {"zh": "{label} 必须是对象,已忽略", "en": "{label} must be an object; ignored"},
|
|
26
|
+
"warn_unknown": {"zh": "{label}.{key} 不是已知设置,已忽略", "en": "{label}.{key} is not a known setting; ignored"},
|
|
27
|
+
"warn_bool": {"zh": "{label}.{key} 必须是布尔值,已忽略", "en": "{label}.{key} must be a boolean; ignored"},
|
|
28
|
+
"warn_stop": {"zh": "{label}.stop_prompt 须为 {modes} 或 {{客户端: 模式}},已忽略",
|
|
29
|
+
"en": "{label}.stop_prompt must be {modes} or {{client: mode}}; ignored"},
|
|
30
|
+
"warn_words": {"zh": "{label}.{key} 须为非空的字符串数组,已忽略", "en": "{label}.{key} must be a non-empty array of strings; ignored"},
|
|
31
|
+
"warn_int": {"zh": "{label}.{key} 须为正整数,已忽略", "en": "{label}.{key} must be a positive integer; ignored"},
|
|
32
|
+
"warn_language": {"zh": "{label}.language 须为 auto、zh 或 en,已忽略", "en": "{label}.language must be auto, zh or en; ignored"},
|
|
33
|
+
"reminder": {
|
|
34
|
+
"zh": "[Opinion] 有 {count} 条候选观点待确认{age}{trial}。在对话里让 Agent 逐条确认,或自行运行 opinion-manager 的 inbox list。",
|
|
35
|
+
"en": "[Opinion] {count} candidate opinions await confirmation{age}{trial}. Ask the Agent to go through them in the conversation, or run opinion-manager's inbox list yourself.",
|
|
36
|
+
},
|
|
37
|
+
"reminder_age": {"zh": "(最久 {days} 天未处理)", "en": " (the oldest untouched for {days} days)"},
|
|
38
|
+
"reminder_trial": {"zh": ",另有 {trial} 条在项目内试行", "en": ", and {trial} more are on trial in this project"},
|
|
39
|
+
"reminder_hint": {
|
|
40
|
+
"zh": "\n用户已看到提示:「{text}」。不要打断当前任务;用户提起或任务间隙再协助逐条确认(inbox list --status pending --output markdown)。",
|
|
41
|
+
"en": "\nThe user has seen this notice: \"{text}\". Do not interrupt the current task; help go through the candidates when the user brings it up or between tasks (inbox list --status pending --output markdown).",
|
|
42
|
+
},
|
|
43
|
+
"relay": {
|
|
44
|
+
"zh": "\n[给用户的提示,他可能没有看到;请在首次回复里用一句话如实转告,是否处理由用户决定,不要自行改 .gitignore]\n{notice}",
|
|
45
|
+
"en": "\n[A notice for the user, who may not have seen it. Pass it on in one sentence in your first reply, as written; what to do about it is the user's decision, and do not edit .gitignore yourself]\n{notice}",
|
|
46
|
+
},
|
|
47
|
+
"add_command": {
|
|
48
|
+
"zh": 'python3 {manager} inbox add --project {root} --title "<标题>" --text "<完整规则>" --scope "<适用范围>" --quote "<用户原话>"{session} --lang {lang}',
|
|
49
|
+
"en": 'python3 {manager} inbox add --project {root} --title "<title>" --text "<the full rule>" --scope "<where it applies>" --quote "<the user\'s own words>"{session} --lang {lang}',
|
|
50
|
+
},
|
|
51
|
+
"add_command_fallback": {"zh": "opinion-manager 的 inbox add", "en": "opinion-manager's inbox add"},
|
|
52
|
+
"sep": {"zh": "、", "en": ", "},
|
|
53
|
+
"prompt_hint": {
|
|
54
|
+
"zh": "[Opinion] 用户这条消息里有可能是长期偏好或对你行为的纠正的表述(命中:{hits})。"
|
|
55
|
+
"若确属长期偏好、规则或纠正,先静默暂存为候选,不打断当前工作:{command}。"
|
|
56
|
+
"仅限本次任务的要求、项目事实和命令不是候选,忽略即可。任务完成前再请用户集中确认。",
|
|
57
|
+
"en": "[Opinion] This user message may state a lasting preference or a correction of your behavior (matched: {hits}). "
|
|
58
|
+
"If it really is a lasting preference, rule or correction, stash it as a candidate silently without interrupting the current work: {command}. "
|
|
59
|
+
"Requirements for this task only, project facts and commands are not candidates; ignore them. Ask the user to confirm candidates together before the task ends.",
|
|
60
|
+
},
|
|
61
|
+
"stop_request": {
|
|
62
|
+
"zh": "[Opinion] 本次会话暂存了 {count} 条候选观点,尚未向用户确认。请在不重复已完成工作的前提下,"
|
|
63
|
+
"用下面的编号列表一次性请用户裁决:正式采纳 / 项目内试行 / 暂缓 / 丢弃(也可以逐条说明)。"
|
|
64
|
+
"用户明确表态后运行:python3 {manager} inbox decide <编号…> --project {root} --to trial|formal|held|rejected --confirmed --lang {lang}。"
|
|
65
|
+
"采纳为正式只改状态,写入 OPINION.md 须走 opinion-manager 的完整预览与确认;未经确认不要写入。\n\n{listing}",
|
|
66
|
+
"en": "[Opinion] You stashed {count} candidate opinions in this session and have not confirmed them with the user yet. Without repeating finished work, "
|
|
67
|
+
"ask the user once, using the numbered list below: adopt as formal / trial in this project / hold / discard (they may also answer item by item). "
|
|
68
|
+
"After the user states a decision explicitly, run: python3 {manager} inbox decide <ids...> --project {root} --to trial|formal|held|rejected --confirmed --lang {lang}. "
|
|
69
|
+
"Adopting as formal only records the decision; writing it into OPINION.md goes through opinion-manager's full preview and confirmation. Do not write anything before the user confirms.\n\n{listing}",
|
|
70
|
+
},
|
|
71
|
+
"note_cursor": {
|
|
72
|
+
"zh": "Cursor 的 sessionStart 注入是否到达模型取决于 Cursor 版本(社区有未到达的反馈);"
|
|
73
|
+
"协议同时写在 opinion-manager 的 Skill 中,未到达时仍可按需触发。stop 提示默认关闭,"
|
|
74
|
+
"需要时把 nudge.stop_prompt.cursor 设为 on-completion。",
|
|
75
|
+
"en": "Whether Cursor's sessionStart injection reaches the model depends on the Cursor version (the community reports cases where it does not). "
|
|
76
|
+
"The protocol is also written in opinion-manager's Skill, so it can still be triggered on demand. The stop prompt is off by default; "
|
|
77
|
+
"set nudge.stop_prompt.cursor to on-completion if you want it.",
|
|
78
|
+
},
|
|
79
|
+
"note_no_project": {
|
|
80
|
+
"zh": "当前目录不在启用了 opinion-manager 的项目里:hook 不会产生任何输出。",
|
|
81
|
+
"en": "This directory is not in a project that uses opinion-manager: the hooks produce no output here.",
|
|
82
|
+
},
|
|
83
|
+
"err_hooks_json": {"zh": "{target} 不是合法 JSON,已停止:{error}", "en": "{target} is not valid JSON; stopped: {error}"},
|
|
84
|
+
"err_hooks_root": {"zh": "{target} 的根节点必须是对象", "en": "The root of {target} must be an object"},
|
|
85
|
+
"err_backup": {"zh": "无法备份 {target} 到 {backup}({error});没有改动任何文件。",
|
|
86
|
+
"en": "Could not back up {target} to {backup} ({error}); nothing was changed."},
|
|
87
|
+
"status_project": {"zh": "项目:{project}", "en": "Project: {project}"},
|
|
88
|
+
"status_no_project": {"zh": "(不在启用 opinion-manager 的项目里)", "en": "(not in a project that uses opinion-manager)"},
|
|
89
|
+
"status_switch": {"zh": "开关:{state}", "en": "Switch: {state}"},
|
|
90
|
+
"status_env_off": {"zh": "已被环境变量 AGENTHELM_NO_NUDGE 关闭", "en": "turned off by the environment variable AGENTHELM_NO_NUDGE"},
|
|
91
|
+
"status_on": {"zh": "开启", "en": "on"},
|
|
92
|
+
"status_off": {"zh": "关闭", "en": "off"},
|
|
93
|
+
"status_thresholds": {
|
|
94
|
+
"zh": "阈值:待确认 ≥{pending} 条或最久 ≥{stale} 天;每会话确认 ≤{prompts} 次;试行 {expire} 天未转正回退;任务结束提示 {stop};语言 {language}",
|
|
95
|
+
"en": "Thresholds: pending ≥ {pending} or oldest age (days) ≥ {stale}; confirmation requests per session ≤ {prompts}; trial expiry (days): {expire}; end-of-task prompt {stop}; language {language}",
|
|
96
|
+
},
|
|
97
|
+
"status_current": {
|
|
98
|
+
"zh": "当前:待确认 {pending} 条,试行 {trial} 条,最久 {days} 天", "en": "Now: {pending} pending, {trial} on trial, the oldest {days} days old"},
|
|
99
|
+
"status_quiet": {"zh": "按当前阈值,开新会话不会提示。", "en": "With the current thresholds, a new session shows no reminder."},
|
|
100
|
+
"status_exposure": {"zh": "收件箱的可见范围:{message}", "en": "Who can see the inbox: {message}"},
|
|
101
|
+
"status_hook_error": {
|
|
102
|
+
"zh": "最近一次钩子错误(共记录 {count} 条,钩子已静默跳过,不影响会话):{line}\n运行 agenthelm nudge status --clear-errors 清除。",
|
|
103
|
+
"en": "Last hook error ({count} recorded; the hook skipped silently and the session was not affected): {line}\nRun agenthelm nudge status --clear-errors to clear it."},
|
|
104
|
+
"status_errors_cleared": {"zh": "已清除钩子错误记录。", "en": "Hook error records cleared."},
|
|
105
|
+
"status_warning": {"zh": "配置警告:{item}", "en": "Config warning: {item}"},
|
|
106
|
+
"install_written": {"zh": "已写入", "en": "Written"},
|
|
107
|
+
"install_unchanged": {"zh": "没有变化", "en": "No change"},
|
|
108
|
+
"install_preview": {"zh": "将写入(加 --apply 执行)", "en": "Would write (add --apply to do it)"},
|
|
109
|
+
"install_line": {"zh": "{verb}:{target}", "en": "{verb}: {target}"},
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
# 这些消息里的 {manager} {root} 会被模型原样当作命令行执行,代入的路径必须经 shell 引用(POSIX);
|
|
114
|
+
# 其他消息(如 status_project)是给人看的,不引用。
|
|
115
|
+
COMMAND_MESSAGES = {"add_command", "stop_request"}
|
|
116
|
+
PATH_FIELDS = ("manager", "root")
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def session_flag(session: str) -> str:
|
|
120
|
+
"""命令行里的 `` --session <id>``(会话 ID 同样经 shlex.quote);没有会话 ID 时为空。"""
|
|
121
|
+
return f" --session {shlex.quote(str(session))}" if session else ""
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def text(message_id: str, language: str, /, **fields: Any) -> str:
|
|
125
|
+
if message_id in COMMAND_MESSAGES:
|
|
126
|
+
fields = {key: shlex.quote(str(value)) if key in PATH_FIELDS else value for key, value in fields.items()}
|
|
127
|
+
return MESSAGES[message_id][language].format(**fields)
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""agenthelm config:用户级设置(``~/.config/agenthelm/config.json``)与语言提示。
|
|
3
|
+
|
|
4
|
+
有两种语言,互不相干:
|
|
5
|
+
|
|
6
|
+
* **界面语言**:命令行输出、菜单、提示用哪种语言。顺序是调用方指定 → 环境变量 ``AGENTHELM_LANG`` →
|
|
7
|
+
用户配置的 ``language`` → 系统 locale → 英文。只影响屏幕上的文字,不改动任何项目文件。
|
|
8
|
+
* **项目文件语言**:写进项目里的文件(Case 小节名、README 追加的说明、SOP)用哪种语言,是项目 Profile 顶层的
|
|
9
|
+
``language``(``zh`` | ``en``,没有就按中文),随项目同步。
|
|
10
|
+
|
|
11
|
+
界面实际显示英文、且没有任何地方指定界面语言时,``check`` 和会话开始的提示说明当前语言从哪来,并给出设置命令;
|
|
12
|
+
中文界面不提示;项目 Profile 没有 ``language`` 的提示同样只给英文界面。``language_hint`` 设为 ``false`` 永久关闭这些提示。设置命令默认只预览,``--apply`` 才写入,
|
|
13
|
+
并且只改动要改的键:文件里的其他设置原样保留,替换前先备份。
|
|
14
|
+
"""
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import argparse
|
|
18
|
+
import json
|
|
19
|
+
import os
|
|
20
|
+
import subprocess
|
|
21
|
+
import sys
|
|
22
|
+
from pathlib import Path
|
|
23
|
+
from typing import Any, Mapping
|
|
24
|
+
|
|
25
|
+
from i18n_agent_pack import _, N_, normalize # noqa: E402
|
|
26
|
+
|
|
27
|
+
LANGUAGE_NAMES = {"zh": N_("中文"), "en": "English"}
|
|
28
|
+
SOURCE_NAMES = {"locale": N_("系统 locale"), "default": N_("默认值")}
|
|
29
|
+
KNOWN_KEYS = ("language", "language_hint", "update_check", "ignored_clients")
|
|
30
|
+
CLIENT_CHOICES = ("claude", "codex", "cursor")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def read_settings(path: Path) -> tuple[dict, str | None]:
|
|
34
|
+
"""(设置, 错误):文件不存在算空设置;无法解析时返回空设置和原因,调用方不得覆盖这个文件。"""
|
|
35
|
+
try:
|
|
36
|
+
text = path.read_text(encoding="utf-8")
|
|
37
|
+
except FileNotFoundError:
|
|
38
|
+
return {}, None
|
|
39
|
+
except OSError as exc:
|
|
40
|
+
return {}, str(exc)
|
|
41
|
+
try:
|
|
42
|
+
data = json.loads(text)
|
|
43
|
+
except ValueError as exc:
|
|
44
|
+
return {}, str(exc)
|
|
45
|
+
if not isinstance(data, dict):
|
|
46
|
+
return {}, _("根节点必须是对象")
|
|
47
|
+
return data, None
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def language_status(variables: Mapping[str, str], settings: Mapping[str, Any]) -> dict:
|
|
51
|
+
"""界面语言从哪来,以及要不要提示用户去设置。"""
|
|
52
|
+
explicit_env = normalize(variables.get("AGENTHELM_LANG"))
|
|
53
|
+
configured = normalize(settings.get("language"))
|
|
54
|
+
if explicit_env:
|
|
55
|
+
language, source = explicit_env, "env"
|
|
56
|
+
elif configured:
|
|
57
|
+
language, source = configured, "config"
|
|
58
|
+
else:
|
|
59
|
+
language, source = "en", "default"
|
|
60
|
+
for name in ("LC_ALL", "LC_MESSAGES", "LANG"):
|
|
61
|
+
found = normalize(variables.get(name))
|
|
62
|
+
if found:
|
|
63
|
+
language, source = found, "locale"
|
|
64
|
+
break
|
|
65
|
+
explicit = source in ("env", "config")
|
|
66
|
+
dismissed = settings.get("language_hint") is False
|
|
67
|
+
return {"language": language, "source": source, "explicit": explicit, "dismissed": dismissed,
|
|
68
|
+
"hint": not explicit and not dismissed and language == "en"}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def interface_hint(status: dict) -> str:
|
|
72
|
+
return _("界面语言未设置,当前使用 {1}(来自{0})。固定语言:agenthelm config language zh(中文)或 agenthelm config language en(English),"
|
|
73
|
+
"默认只预览,加 --apply 写入;不想再看到这条提示:agenthelm config language-hint off。"
|
|
74
|
+
"界面语言只影响命令输出,不改动任何项目文件。").format(
|
|
75
|
+
_(SOURCE_NAMES.get(status["source"], status["source"])), _(LANGUAGE_NAMES[status["language"]]))
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def project_hint() -> str:
|
|
79
|
+
return _("这个项目没有声明项目文件语言(Profile 的 language),写进项目的文件按中文生成。要改成英文:agenthelm config project-language en"
|
|
80
|
+
"(预览;加 --apply 写入,只改 Profile,不改写已有文件)。")
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def short_hint(status: dict) -> str:
|
|
84
|
+
"""会话开始用的一行。"""
|
|
85
|
+
return _("界面语言未设置(当前 {0}):agenthelm config language zh|en 固定;agenthelm config language-hint off 关闭这条提示。").format(
|
|
86
|
+
_(LANGUAGE_NAMES[status["language"]]))
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def report_section(variables: Mapping[str, str], settings: Mapping[str, Any], scaffold: dict | None) -> dict:
|
|
90
|
+
"""check 报告里的 ``language`` 段(无论是否提示都给出,便于脚本读取)。"""
|
|
91
|
+
status = language_status(variables, settings)
|
|
92
|
+
declared_known = isinstance(scaffold, dict) and isinstance(scaffold.get("project_language"), dict)
|
|
93
|
+
declared = scaffold["project_language"].get("declared") if declared_known else None
|
|
94
|
+
project_needs_hint = declared_known and declared is None and not status["dismissed"] and status["language"] == "en"
|
|
95
|
+
return {"interface": {"language": status["language"], "source": status["source"], "explicit": status["explicit"]},
|
|
96
|
+
"project": {"declared": declared, "effective": declared or "zh"} if declared_known else None,
|
|
97
|
+
"hint_dismissed": status["dismissed"],
|
|
98
|
+
"hints": ([interface_hint(status)] if status["hint"] else []) + ([project_hint()] if project_needs_hint else []),
|
|
99
|
+
"session_hint": short_hint(status) if status["hint"] else None}
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
# ---------------------------------------------------------------- the command
|
|
103
|
+
|
|
104
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
105
|
+
result = argparse.ArgumentParser(prog="agenthelm config", description=_("用户级设置:界面语言、语言提示、项目文件语言。默认只预览,--apply 才写入。"))
|
|
106
|
+
result.add_argument("--home", type=Path, help=argparse.SUPPRESS)
|
|
107
|
+
sub = result.add_subparsers(dest="action", required=True)
|
|
108
|
+
|
|
109
|
+
def common(parser: argparse.ArgumentParser, project: bool = False) -> None:
|
|
110
|
+
parser.add_argument("--output", choices=("text", "json"), default="text")
|
|
111
|
+
parser.add_argument("--apply", action="store_true", help=_("写入(缺省只预览)"))
|
|
112
|
+
if project:
|
|
113
|
+
parser.add_argument("--project", type=Path, help=_("项目目录;缺省当前目录"))
|
|
114
|
+
|
|
115
|
+
show = sub.add_parser("show", help=_("显示生效的设置与文件位置"))
|
|
116
|
+
show.add_argument("--output", choices=("text", "json"), default="text")
|
|
117
|
+
language = sub.add_parser("language", help=_("设置界面语言(命令行输出用哪种语言);auto 表示跟随系统 locale"))
|
|
118
|
+
language.add_argument("value", choices=("zh", "en", "auto"))
|
|
119
|
+
common(language)
|
|
120
|
+
hint = sub.add_parser("language-hint", help=_("开关“语言未设置”的提示"))
|
|
121
|
+
hint.add_argument("value", choices=("on", "off"))
|
|
122
|
+
common(hint)
|
|
123
|
+
for name, text in (("ignore-client", _("忽略一个客户端:check / update / 会话开始提示不再处理它(--client 显式指定仍可处理)")),
|
|
124
|
+
("unignore-client", _("取消忽略一个客户端"))):
|
|
125
|
+
ignore = sub.add_parser(name, help=text)
|
|
126
|
+
ignore.add_argument("value", choices=CLIENT_CHOICES)
|
|
127
|
+
common(ignore)
|
|
128
|
+
project = sub.add_parser("project-language", help=_("设置当前项目的文件语言(Profile 的 language;只改 Profile,不改写已有文件)"))
|
|
129
|
+
project.add_argument("value", choices=("zh", "en"))
|
|
130
|
+
common(project, project=True)
|
|
131
|
+
return result
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def _write_settings(path: Path, data: dict) -> None:
|
|
135
|
+
if path.is_symlink(): # 配置文件可能是 dotfiles 仓库的软链接:写到它指向的文件,不把链接换成普通文件
|
|
136
|
+
path = path.resolve()
|
|
137
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
138
|
+
temporary = path.with_name(f".{path.name}.{os.getpid()}.tmp")
|
|
139
|
+
temporary.write_text(json.dumps(data, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
|
|
140
|
+
os.replace(temporary, path)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
def _change(settings: dict, key: str, value: Any) -> tuple[dict, list[dict]]:
|
|
144
|
+
"""``value`` 为 None 表示删除该键。其余键原样保留。"""
|
|
145
|
+
updated = dict(settings)
|
|
146
|
+
before = settings.get(key)
|
|
147
|
+
if value is None:
|
|
148
|
+
updated.pop(key, None)
|
|
149
|
+
else:
|
|
150
|
+
updated[key] = value
|
|
151
|
+
return updated, ([{"key": key, "from": before, "to": value}] if before != value else [])
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def _ignored(settings: Mapping[str, Any]) -> list[str]:
|
|
155
|
+
value = settings.get("ignored_clients")
|
|
156
|
+
return [name for name in CLIENT_CHOICES if isinstance(value, list) and name in value]
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def _emit(args: argparse.Namespace, payload: dict, lines: list[str]) -> None:
|
|
160
|
+
print(json.dumps(payload, ensure_ascii=False, indent=2) if args.output == "json" else "\n".join(lines))
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
def _show(args: argparse.Namespace, host: Any, env: Any) -> int:
|
|
164
|
+
settings, error = read_settings(env.config_file)
|
|
165
|
+
status = language_status(env.variables, settings)
|
|
166
|
+
unknown = sorted(key for key in settings if key not in KNOWN_KEYS)
|
|
167
|
+
payload = {"ok": error is None, "path": str(env.config_file), "exists": env.config_file.is_file(), "error": error,
|
|
168
|
+
"language": {"effective": status["language"], "source": status["source"], "configured": settings.get("language")},
|
|
169
|
+
"language_hint": not status["dismissed"], "update_check": settings.get("update_check", True) is not False,
|
|
170
|
+
"ignored_clients": _ignored(settings), "other_keys": unknown}
|
|
171
|
+
sources = {"env": _("环境变量 AGENTHELM_LANG"), "config": _("用户配置"), "locale": _("系统 locale"), "default": _("默认值")}
|
|
172
|
+
lines = [_("用户配置:{0}({1})").format(env.config_file, _("存在") if payload["exists"] else _("不存在")),
|
|
173
|
+
_("界面语言:{0}(来自{1})").format(_(LANGUAGE_NAMES[status["language"]]), sources[status["source"]]),
|
|
174
|
+
_("语言未设置的提示:{0}").format(_("开") if payload["language_hint"] else _("关")),
|
|
175
|
+
_("联网检查更新:{0}").format(_("开") if payload["update_check"] else _("关")),
|
|
176
|
+
_("忽略的客户端:{0}").format(_("、").join(payload["ignored_clients"]) or _("(无)"))]
|
|
177
|
+
if unknown:
|
|
178
|
+
lines.append(_("其他设置(不由本命令管理):{0}").format(_("、").join(unknown)))
|
|
179
|
+
if error:
|
|
180
|
+
lines.append(_("配置文件无法读取:{0}").format(error))
|
|
181
|
+
_emit(args, payload, lines)
|
|
182
|
+
return 0 if error is None else 2
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def _set_key(args: argparse.Namespace, host: Any, env: Any, key: str, value: Any, label: str) -> int:
|
|
186
|
+
path = env.config_file
|
|
187
|
+
settings, error = read_settings(path)
|
|
188
|
+
if error is not None:
|
|
189
|
+
message = _("{0} 无法读取:{1}。先修正它;本命令不会覆盖无法解析的文件。").format(path, error)
|
|
190
|
+
_emit(args, {"ok": False, "error": message}, [message])
|
|
191
|
+
return 2
|
|
192
|
+
updated, changes = _change(settings, key, value)
|
|
193
|
+
payload: dict[str, Any] = {"ok": True, "applied": False, "path": str(path), "changes": changes,
|
|
194
|
+
"effective_language": language_status(env.variables, updated)["language"]}
|
|
195
|
+
lines = []
|
|
196
|
+
for item in changes:
|
|
197
|
+
before = _("(未设置)") if item["from"] is None else json.dumps(item["from"], ensure_ascii=False)
|
|
198
|
+
after = _("(删除)") if item["to"] is None else json.dumps(item["to"], ensure_ascii=False)
|
|
199
|
+
lines.append(f" {item['key']}: {before} → {after}")
|
|
200
|
+
if not changes:
|
|
201
|
+
lines.append(" " + _("{0} 已经是这个值,没有需要改的。").format(label))
|
|
202
|
+
elif args.apply:
|
|
203
|
+
if path.is_file(): # 替换前备份,和其他会替换文件的命令一样
|
|
204
|
+
recovery = host.recovery_dir_for(env, "config")
|
|
205
|
+
try:
|
|
206
|
+
recovery.mkdir(parents=True, mode=0o700)
|
|
207
|
+
(recovery / path.name).write_bytes(path.read_bytes())
|
|
208
|
+
except OSError as exc: # abort before rewriting: no backup, no change
|
|
209
|
+
message = _("无法备份 {0} 到 {1}({2});没有改动任何文件。").format(path, recovery, exc)
|
|
210
|
+
_emit(args, {"ok": False, "error": message}, [message])
|
|
211
|
+
return 2
|
|
212
|
+
payload["recovery"] = str(recovery)
|
|
213
|
+
lines.append(_("原件已备份到:{0}").format(recovery))
|
|
214
|
+
_write_settings(path, updated)
|
|
215
|
+
payload["applied"] = True
|
|
216
|
+
lines.append(_("其他设置原样保留。"))
|
|
217
|
+
else:
|
|
218
|
+
lines.append(_("确认后加 --apply 写入;其他设置原样保留。"))
|
|
219
|
+
header = _("已写入:用户配置 {0}") if payload["applied"] else _("预览:用户配置 {0}")
|
|
220
|
+
_emit(args, payload, [header.format(path), *lines])
|
|
221
|
+
return 0
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
def _project_language(args: argparse.Namespace, host: Any, env: Any) -> int:
|
|
225
|
+
project = (args.project or Path.cwd()).resolve()
|
|
226
|
+
manager = host.locate_companion("agents-init", host.installed_plugins(env, {"agents-init"}))
|
|
227
|
+
script = manager / "skills" / "agents-init" / "scripts" / "init_project.py" if manager else None
|
|
228
|
+
if script is None or "language" not in script.read_text(encoding="utf-8"):
|
|
229
|
+
message = _("没有找到支持设置项目文件语言的 agents-init:更新插件后再试。")
|
|
230
|
+
_emit(args, {"ok": False, "error": message}, [message])
|
|
231
|
+
return 3
|
|
232
|
+
command = [sys.executable, str(script), "--project", str(project), "--mode", "language", "--language", args.value,
|
|
233
|
+
"--output", "json"] + (["--apply"] if args.apply else [])
|
|
234
|
+
completed = subprocess.run(command, capture_output=True, text=True, check=False, env=env.child_environment())
|
|
235
|
+
try:
|
|
236
|
+
result = json.loads(completed.stdout)
|
|
237
|
+
except ValueError:
|
|
238
|
+
message = (completed.stderr or completed.stdout).strip()[:300] or _("agents-init 没有返回结果")
|
|
239
|
+
_emit(args, {"ok": False, "error": message}, [message])
|
|
240
|
+
return 2
|
|
241
|
+
if completed.returncode != 0 or not result.get("ok", True):
|
|
242
|
+
message = str(result.get("error") or result)
|
|
243
|
+
_emit(args, {"ok": False, "error": message}, [message])
|
|
244
|
+
return 2
|
|
245
|
+
header = _("已写入:项目 Profile 的 language {0} → {1}") if result.get("applied") else _("预览:项目 Profile 的 language {0} → {1}")
|
|
246
|
+
lines = [header.format(result.get("from") or _("(未声明,按中文)"), result["language"])]
|
|
247
|
+
if not result.get("changed"):
|
|
248
|
+
lines.append(" " + _("项目文件语言已经是 {0},没有需要改的。").format(result["language"]))
|
|
249
|
+
if result.get("diff"):
|
|
250
|
+
lines.append(result["diff"].rstrip())
|
|
251
|
+
if result.get("recovery"):
|
|
252
|
+
lines.append(_("原件已备份到:{0}").format(result["recovery"]))
|
|
253
|
+
if result["changed"] and not result.get("applied"):
|
|
254
|
+
lines.append(_("确认后加 --apply 写入;只改 Profile,已有文件不会被改写。"))
|
|
255
|
+
_emit(args, result, lines)
|
|
256
|
+
return 0
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
def main(argv: list[str] | None, host: Any) -> int:
|
|
260
|
+
args = build_parser().parse_args(argv)
|
|
261
|
+
env = host.current_env(args.home)
|
|
262
|
+
if args.action == "show":
|
|
263
|
+
return _show(args, host, env)
|
|
264
|
+
if args.action == "language":
|
|
265
|
+
return _set_key(args, host, env, "language", None if args.value == "auto" else args.value, _("界面语言"))
|
|
266
|
+
if args.action == "language-hint":
|
|
267
|
+
return _set_key(args, host, env, "language_hint", None if args.value == "on" else False, _("语言提示"))
|
|
268
|
+
if args.action in ("ignore-client", "unignore-client"):
|
|
269
|
+
settings, error = read_settings(env.config_file)
|
|
270
|
+
current = set(_ignored(settings))
|
|
271
|
+
current = current | {args.value} if args.action == "ignore-client" else current - {args.value}
|
|
272
|
+
# 只改 ignored_clients 这个键;空了就删除键,其他设置原样保留。
|
|
273
|
+
return _set_key(args, host, env, "ignored_clients", [n for n in CLIENT_CHOICES if n in current] or None,
|
|
274
|
+
_("忽略的客户端"))
|
|
275
|
+
return _project_language(args, host, env)
|
|
@@ -15,10 +15,12 @@ description: Deterministically inventory, verify, install, sync, migrate and rec
|
|
|
15
15
|
|
|
16
16
|
## 入口
|
|
17
17
|
|
|
18
|
-
优先使用随附的 `agent-pack` MCP Tool(`agent_pack_inventory` / `agent_pack_doctor` / `agent_pack_bootstrap` / `agent_pack_sync` / `agent_pack_transfer` / `agent_pack_reconcile`);不可用时运行标准库 CLI `runtime/agent_pack_config.py`。执行能力管理前读取 [references/capability-config.md](../../references/capability-config.md)。
|
|
18
|
+
优先使用随附的 `agent-pack` MCP Tool(`agent_pack_inventory` / `agent_pack_doctor` / `agent_pack_bootstrap` / `agent_pack_sync` / `agent_pack_transfer` / `agent_pack_reconcile` / `agent_pack_cloud_sync_safety_check`);不可用时运行标准库 CLI `runtime/agent_pack_config.py`。执行能力管理前读取 [references/capability-config.md](../../references/capability-config.md)。
|
|
19
19
|
|
|
20
20
|
`runtime/agenthelm.py` 另有两个面向人的入口:`project` 转交 project-orchestrator 的项目入口(不需要 AI Agent);`runtime install|update|use|status` 管理用户级运行时(`~/.local/share/agenthelm/`,项目根目录的启动器优先使用它),写操作默认预览、`--apply` 才执行,新版本装在旁边、旧版本保留。
|
|
21
21
|
|
|
22
|
+
`agenthelm config` 管理用户级设置(`~/.config/agenthelm/config.json`),默认只预览,`--apply` 才写入,只改要改的键,替换前备份原文件:`config show` 显示生效的设置;`config language zh|en|auto` 设置界面语言(命令行输出用哪种语言,不改动项目文件);`config language-hint on|off` 开关“界面语言未设置”的提示;`config project-language zh|en [--project <目录>]` 设置当前项目的文件语言(Profile 的 `language`,写进项目的文件用哪种语言;只改 Profile)。只有界面实际显示英文、且没有任何地方指定界面语言时,`agenthelm check` 与会话开始的提示才会说明当前语言从哪来并给出命令(中文界面不提示);界面显示英文、已有项目没有 `language` 时 `check` 也会说明。两种语言的区别要向用户讲清楚:界面语言只影响屏幕上的文字,项目文件语言随项目同步。
|
|
23
|
+
|
|
22
24
|
## 执行顺序
|
|
23
25
|
|
|
24
26
|
1. 盘点来源与目标(`inventory --source project:/path | plugin:/path | client:codex | client:cursor | client:claude`);
|
|
@@ -39,8 +41,16 @@ description: Deterministically inventory, verify, install, sync, migrate and rec
|
|
|
39
41
|
|
|
40
42
|
`plugin.json#version` 是唯一权威。`doctor` 对每个被盘点插件比对仓库 `plugin.json` 版本与其 `.codex-plugin/plugin.json` 适配器版本,不一致即报 issue(fail,不是 warning)。`~/.codex/plugins/cache/personal/` 是 Codex 自身的版本化缓存,滞后于 marketplace 源,须由 Codex 下次激活或重启刷新——这不是 `agent-pack` 能写的。
|
|
41
43
|
|
|
44
|
+
## 同步盘与本机专属目录(local-only)
|
|
45
|
+
|
|
46
|
+
项目放在 iCloud、Dropbox、OneDrive 等同步目录里时,`.venv`、`node_modules`、工具缓存不该进同步盘。只读 MCP Tool `agent_pack_cloud_sync_safety_check` 返回结构化发现(含 `attention`、证据、可执行的命令);改动由用户同意后运行 `agenthelm local-only fix … --apply`(默认预览,失败整体撤销)。Agent 不要自己 `mv` / `ln -s`;体积接近阈值的发现把选项交给用户。契约、实测兼容性(yarn / bun / uv 可外置,npm 会把链接换回真实目录,pnpm 会失败)、配置与多设备流程见 `references/local-only.md`。
|
|
47
|
+
|
|
42
48
|
## 边界
|
|
43
49
|
|
|
44
50
|
- 不初始化项目、不创建骨架(那是 `agents-init`)。
|
|
45
51
|
- 不选择 Task/Case、不写项目进度、不做 Git 提交(那是 project-orchestrator)。
|
|
46
52
|
- 不把原生客户端 MCP 配置中的凭据复制进可移植包;含密钥条目保持 `blocked` 并留在客户端本地。
|
|
53
|
+
|
|
54
|
+
## 观点候选采集与未决事项提示(nudge)
|
|
55
|
+
|
|
56
|
+
插件随附的 hook 调用 `runtime/agenthelm.py nudge hook`:在项目启用了 opinion-manager 时,会话开始注入候选采集协议与试行候选,工作中提醒暂存长期偏好,任务完成时请用户集中确认,并在待确认候选堆积或久未处理时提示一行。该工具只读写 opinion-manager 的收件箱,不写规则、不改项目文件。阈值、客户端差异与关闭方式见 [references/nudge.md](../../references/nudge.md);`agenthelm nudge status` 显示生效配置,`agenthelm nudge install-hooks --client cursor` 预览 Cursor 的 hook 配置。
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"packs": [
|
|
4
4
|
{
|
|
5
5
|
"id": "agents-init/project-contract",
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.3.0",
|
|
7
7
|
"kind": "template",
|
|
8
8
|
"title": "项目契约模板",
|
|
9
9
|
"description": "初始化时渲染为项目入口文件的中文模板与根目录启动器;更新后由用户逐文件选择是否重新渲染。",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
],
|
|
21
21
|
"project_lock": "agenthelm",
|
|
22
22
|
"files": {
|
|
23
|
-
"skills/agents-init/AGENT.template.md": "
|
|
23
|
+
"skills/agents-init/AGENT.template.md": "c0e807c2f5b979a1b08370ad01c4c5e6e974e65ae54f714ea34b3817fa45f831",
|
|
24
24
|
"skills/agents-init/launcher.sh": "cf27d6cca786905a192446ea4eefe5635942914c3358c78d12117af912107cad"
|
|
25
25
|
},
|
|
26
26
|
"materializes_from_profile": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
"id": "agents-init/project-skeleton",
|
|
32
|
-
"version": "1.
|
|
32
|
+
"version": "1.1.0",
|
|
33
33
|
"kind": "manifest",
|
|
34
34
|
"title": "期望骨架清单",
|
|
35
35
|
"description": "项目脚手架应有的文件、Profile 受检字段与不参与比较的字段(审计字段、Opinion 设置);agenthelm check 据此对比项目,不写入项目。",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"materializes": [],
|
|
40
40
|
"project_lock": "none",
|
|
41
41
|
"files": {
|
|
42
|
-
"skills/agents-init/skeleton.json": "
|
|
42
|
+
"skills/agents-init/skeleton.json": "4a7c2ccaed293bc63ae2f3b3e6c8fa5e906292462f81c41a0fc88fcb22a3eeeb"
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "agents-init",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.8.1",
|
|
5
5
|
"description": "Initialize or migrate an Agent project contract (AGENTS.md, Project Profile, root launcher); ships with project-orchestrator, agent-pack and opinion-manager.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "lc4t"
|