@sakanano-moe/agenthelm 6.11.0 → 6.12.0-rc.1
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/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/plugin.json +1 -1
- package/runtime/plugins/agent-pack/references/capability-config.md +11 -1
- package/runtime/plugins/agent-pack/runtime/agent_pack_codex_mcp.py +161 -0
- package/runtime/plugins/agent-pack/runtime/agent_pack_config.py +232 -53
- package/runtime/plugins/agent-pack/runtime/agenthelm.py +171 -23
- package/runtime/plugins/agent-pack/runtime/agenthelm_runtime.py +1 -1
- package/runtime/plugins/agent-pack/runtime/locale/en.json +13 -1
- package/runtime/plugins/agent-pack/runtime/mcp_server.py +5 -1
- package/runtime/plugins/agents-init/.codex-plugin/plugin.json +1 -1
- package/runtime/plugins/agents-init/content.json +2 -2
- package/runtime/plugins/agents-init/plugin.json +1 -1
- package/runtime/plugins/agents-init/skills/agents-init/AGENT.template.md +169 -0
- package/runtime/plugins/agents-init/skills/agents-init/scripts/adopt.py +9 -1
- package/runtime/plugins/agents-init/skills/agents-init/scripts/init_project.py +74 -20
- package/runtime/plugins/agents-init/skills/agents-init/scripts/locale/en.json +7 -2
- package/runtime/plugins/agents-init/skills/agents-init/scripts/scaffold.py +5 -2
- 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/runtime/constants.py +3 -0
- package/runtime/plugins/project-orchestrator/.codex-plugin/plugin.json +1 -1
- package/runtime/plugins/project-orchestrator/plugin.json +1 -1
- package/runtime/plugins/project-orchestrator/references/case-workspaces.md +4 -0
- package/runtime/plugins/project-orchestrator/runtime/case.py +20 -2
- package/runtime/plugins/project-orchestrator/runtime/locale/en.json +5 -1
- package/runtime/plugins/project-orchestrator/runtime/memory.py +25 -8
- package/runtime/plugins/project-orchestrator/runtime/project_cli.py +4 -2
- package/runtime/plugins/project-orchestrator/runtime/project_maintain.py +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sakanano-moe/agenthelm",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.12.0-rc.1",
|
|
4
4
|
"description": "agenthelm CLI: install, check and update the agenthelm plugins for Claude Code, Codex and Cursor; a user-level runtime; and a project menu that works without any AI agent.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
package/runtime/index.json
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
"name": "agenthelm",
|
|
5
5
|
"description": "Cross-agent project management plugins: project contract, lifecycle, extension capabilities and behavior rules. 跨 Agent 的项目管理插件集。",
|
|
6
6
|
"version": "0.7.0",
|
|
7
|
-
"updated_at": "2026-
|
|
7
|
+
"updated_at": "2026-11-07",
|
|
8
8
|
"homepage": "./index.html",
|
|
9
9
|
"domain": "agenthelm.sakanano.moe",
|
|
10
10
|
"legacy_domain": "skill.sakanano.moe"
|
|
11
11
|
},
|
|
12
12
|
"plugin": {
|
|
13
13
|
"manifest": "./plugins/agents-init/plugin.json",
|
|
14
|
-
"version": "6.
|
|
14
|
+
"version": "6.12.0",
|
|
15
15
|
"install_unit": "marketplace",
|
|
16
16
|
"bundled_plugins": [
|
|
17
17
|
"./plugins/project-orchestrator/plugin.json",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"id": "agents-init",
|
|
31
31
|
"name": "agents-init v6 / Project Profile initialization and migration",
|
|
32
32
|
"description": "Create or migrate the project skeleton and root launcher; checks that project-orchestrator, agent-pack and opinion-manager from the same release are present before writing.",
|
|
33
|
-
"version": "6.
|
|
33
|
+
"version": "6.9.0",
|
|
34
34
|
"status": "stable",
|
|
35
35
|
"entrypoints": {
|
|
36
36
|
"browser": "./plugins/agents-init/skills/agents-init/index.html",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"id": "project-orchestrator",
|
|
44
44
|
"name": "project-orchestrator / project lifecycle orchestration",
|
|
45
45
|
"description": "Organizes Case workspaces or keeps existing Task/Case layouts; search, lossless migration, verification, scoped Git delivery, and a project menu that works without any AI agent.",
|
|
46
|
-
"version": "1.11.
|
|
46
|
+
"version": "1.11.4",
|
|
47
47
|
"status": "stable",
|
|
48
48
|
"entrypoints": {
|
|
49
49
|
"agent": "./plugins/project-orchestrator/skills/project-orchestrator/SKILL.md",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"id": "agent-pack",
|
|
56
56
|
"name": "agent-pack / Agent extension capability management",
|
|
57
57
|
"description": "Inventory, verify, install, sync, migrate and reconcile Plugins, Skills and MCP between projects and Codex / Cursor / Claude; the agenthelm command line and user-level runtime.",
|
|
58
|
-
"version": "1.
|
|
58
|
+
"version": "1.12.0",
|
|
59
59
|
"status": "stable",
|
|
60
60
|
"entrypoints": {
|
|
61
61
|
"agent": "./plugins/agent-pack/skills/agent-pack/SKILL.md",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"id": "opinion-manager",
|
|
69
69
|
"name": "opinion-manager / Agent behavior rule management",
|
|
70
70
|
"description": "Three first-run entry points plus optional memory candidates; one content confirmation, then Profile, body and lock are saved separately, with exact versions and protection of personal edits.",
|
|
71
|
-
"version": "0.5.
|
|
71
|
+
"version": "0.5.2",
|
|
72
72
|
"status": "experimental",
|
|
73
73
|
"entrypoints": {
|
|
74
74
|
"agent": "./plugins/opinion-manager/skills/opinion-manager/SKILL.md",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "agent-pack",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.12.0",
|
|
5
5
|
"description": "Deterministic Agent-extension capability management: inventory, doctor, bootstrap, sync, transfer, and reconcile Agent Plugins / Skills / MCP servers across Codex, Cursor, Claude Code, and project sources. Ships a stdio MCP.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "lc4t"
|
|
@@ -141,8 +141,18 @@ Codex 同步会写入 `~/.agents/plugins/plugins/<name>` 可移植包、`.codex-
|
|
|
141
141
|
- 禁止静默覆盖现有 Skill、MCP 名称、Agent Plugin、客户端包或 marketplace 条目。
|
|
142
142
|
- 在 `native_mcp_sources` 中声明历史或客户端专属 MCP 文件。可移植条目成为打包候选;包含密钥的条目保持为 `blocked`/doctor warning,并留在客户端本地。
|
|
143
143
|
- 原生 MCP 来源可以使用 `__PROJECT_DIR__` 与 `__REPO_ROOT__`;源文件保留占位符,生成客户端包时解析为当前本地项目路径。
|
|
144
|
-
-
|
|
144
|
+
- **stdio 的环境变量引用**:把 `credential_env_file` 设置为项目相对路径的 dotenv 文件,权限必须为 `0600`。生成包只保存 `${VAR}` 引用;本地 launcher 在 MCP 启动时读取值,禁止复制进 Git 或插件 manifest。
|
|
145
145
|
- 使用 `mcp_client_policy.<server>.include` 或 `.exclude` 完成客户端路由(`codex`、`cursor`、`claude` 各自生效)。禁止在 MCP 定义中放入 adapter 专属 `_skip` 字段。
|
|
146
146
|
- 客户端里本机才有的认证值(例如远程 MCP 的 `headers.Authorization`)不进入项目;同步与 bootstrap 默认保留它们,`--reset-overrides` 才丢弃。
|
|
147
147
|
- `${PLUGIN_ROOT}` 用于不可变包文件,`${PLUGIN_DATA}` 用于客户端管理的可写状态。
|
|
148
148
|
- 客户端原生 adapter 只在安装阶段使用;Agent Plugins 1.0 文件保持权威源地位。
|
|
149
|
+
|
|
150
|
+
## 远程 HTTP 认证与更新项目声明
|
|
151
|
+
|
|
152
|
+
远程 MCP 的 `headers.Authorization: "Bearer ${EXAMPLE_MCP_TOKEN}"` 与 `bearer_token_env_var: "EXAMPLE_MCP_TOKEN"` 等价,不读取 `credential_env_file`。Codex 导入还支持 `http_headers` / `env_http_headers`,Cursor 导入接受 `${env:NAME}`;项目统一保存 `${NAME}` 引用。`doctor --client` 只检查进程环境中变量是否非空,只显示变量名。不要把令牌值传给任何导入或同步命令。
|
|
153
|
+
|
|
154
|
+
`sync --client codex` 把远程配置写入原生 `~/.codex/config.toml` 的 `bearer_token_env_var` / `env_http_headers`,项目包只加载 stdio MCP,避免远程服务器重复加载。现存同名原生配置不同、或本项目安装的条目被本机改动时,需 `--replace`(替换整条配置);未被本机改动的条目在后续同步时更新,删除时仅移除仍与记录一致的条目。其他 TOML 内容保留,旧配置进入本机恢复目录。Codex 的 header 变量只支持纯 `${NAME}` 或 Authorization 的 `Bearer ${NAME}`,更复杂的拼接会明确拒绝。Claude Code 原样保存 `${NAME}`,Cursor 输出 `${env:NAME}`;已有 Claude 本机认证值仍按上述覆盖规则保留,需要改为项目引用时显式加 `--reset-overrides`。
|
|
155
|
+
|
|
156
|
+
`transfer --update` 允许更新已有同名 Skill / MCP;默认预览列出变化路径、Skill 前后摘要和 MCP 变化的键名,不显示配置值。只有同时加 `--apply` 才替换,旧内容进入本机恢复目录,失败时回滚。MCP Tool `agent_pack_transfer` 提供等价的 `update` / `apply` 参数。
|
|
157
|
+
|
|
158
|
+
`check` / SessionStart 本地比较检测到的客户端与项目声明;一致时不增加提示,联网版本检查失败也不会阻止差异提示。只关闭能力检查可在本机用户配置设置 `capability_check_ignored_clients: ["cursor"]`;忽略整个客户端沿用 `agenthelm config ignore-client cursor --apply`。多机完整步骤见 [README](../../../README.md#A-机新增能力B-机同步)。
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"""Native Codex remote MCP projection. Preserve unrelated TOML and never expand env values."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import json
|
|
5
|
+
import os
|
|
6
|
+
import tempfile
|
|
7
|
+
import re
|
|
8
|
+
import stat
|
|
9
|
+
import tomllib
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
from typing import Any
|
|
12
|
+
|
|
13
|
+
import agent_pack_config as core
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def native_entry(config: dict[str, Any]) -> dict[str, Any]:
|
|
17
|
+
result: dict[str, Any] = {"url": config["url"]}
|
|
18
|
+
plain, env = {}, {}
|
|
19
|
+
for key, value in (config.get("headers") or {}).items():
|
|
20
|
+
bearer = re.fullmatch(r"Bearer \$\{([A-Za-z_][A-Za-z0-9_]*)\}", value, re.IGNORECASE)
|
|
21
|
+
reference = core.ENV_REFERENCE_RE.fullmatch(value)
|
|
22
|
+
if key.lower() == "authorization" and bearer:
|
|
23
|
+
result["bearer_token_env_var"] = bearer.group(1)
|
|
24
|
+
elif reference:
|
|
25
|
+
env[key] = reference.group(1)
|
|
26
|
+
elif core.ENV_REFERENCE_RE.search(value):
|
|
27
|
+
raise core.AgentPackError(f"Codex header requires a single environment reference: {key}")
|
|
28
|
+
else:
|
|
29
|
+
plain[key] = value
|
|
30
|
+
if plain:
|
|
31
|
+
result["http_headers"] = plain
|
|
32
|
+
if env:
|
|
33
|
+
result["env_http_headers"] = env
|
|
34
|
+
return result
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _section_name(line: str) -> str | None:
|
|
38
|
+
if not line.lstrip().startswith("["):
|
|
39
|
+
return None
|
|
40
|
+
try:
|
|
41
|
+
table = tomllib.loads(line.strip() + "\n")
|
|
42
|
+
servers = table.get("mcp_servers")
|
|
43
|
+
if isinstance(servers, dict) and len(servers) == 1:
|
|
44
|
+
return next(iter(servers))
|
|
45
|
+
except tomllib.TOMLDecodeError:
|
|
46
|
+
pass
|
|
47
|
+
return None
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _toml_string(value: str) -> str:
|
|
51
|
+
"""A TOML basic string. JSON's escapes are valid TOML; keep non-BMP characters literal because JSON would emit
|
|
52
|
+
surrogate pairs, which TOML rejects, and escape DEL, which TOML forbids unescaped."""
|
|
53
|
+
return json.dumps(value, ensure_ascii=False).replace("\x7f", "\\u007f")
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def render(original: str, entries: dict[str, dict], removed: set[str]) -> str:
|
|
57
|
+
"""Replace only explicitly owned named tables; retain all other source bytes."""
|
|
58
|
+
output: list[str] = []
|
|
59
|
+
dropping = False
|
|
60
|
+
for line in original.splitlines(keepends=True):
|
|
61
|
+
if line.lstrip().startswith("["):
|
|
62
|
+
name = _section_name(line)
|
|
63
|
+
dropping = name in removed or name in entries
|
|
64
|
+
if not dropping:
|
|
65
|
+
output.append(line)
|
|
66
|
+
text = "".join(output).rstrip() + "\n" if output else ""
|
|
67
|
+
for name, config in sorted(entries.items()):
|
|
68
|
+
text += f"\n[mcp_servers.{_toml_string(name)}]\n"
|
|
69
|
+
for key, value in config.items():
|
|
70
|
+
if isinstance(value, dict):
|
|
71
|
+
encoded = "{ " + ", ".join(_toml_string(k) + " = " + _toml_string(v) for k, v in value.items()) + " }"
|
|
72
|
+
else:
|
|
73
|
+
encoded = _toml_string(value)
|
|
74
|
+
text += f"{key} = {encoded}\n"
|
|
75
|
+
return text
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def plan(project: Path, home: Path, *, replace: bool = False) -> dict:
|
|
79
|
+
layout = core.load_project_layout(project)
|
|
80
|
+
name = core._package_name(layout.root)
|
|
81
|
+
state_path = home / ".agent-pack" / "state" / f"codex-remote-{name}.json"
|
|
82
|
+
old = core._read_json(state_path).get("servers", {}) if state_path.exists() else {}
|
|
83
|
+
if not isinstance(old, dict) or not all(isinstance(value, dict) for value in old.values()):
|
|
84
|
+
raise core.AgentPackError("invalid Codex MCP ownership state")
|
|
85
|
+
desired = {item.name: native_entry(item.config) for item in core.inventory_project(layout.root).mcps
|
|
86
|
+
if item.portable and item.config.get("type") != "stdio" and core._mcp_allowed(layout, item.name, "codex")}
|
|
87
|
+
config_path = home / ".codex" / "config.toml"
|
|
88
|
+
if not desired and not old:
|
|
89
|
+
return {"active": False, "operations": []}
|
|
90
|
+
if config_path.is_symlink():
|
|
91
|
+
raise core.AgentPackError(f"refusing symlinked Codex config: {config_path}")
|
|
92
|
+
original = config_path.read_text(encoding="utf-8") if config_path.exists() else ""
|
|
93
|
+
try:
|
|
94
|
+
current = tomllib.loads(original).get("mcp_servers", {})
|
|
95
|
+
except tomllib.TOMLDecodeError as exc:
|
|
96
|
+
raise core.AgentPackError("invalid Codex config.toml") from exc
|
|
97
|
+
changes, operations = {}, []
|
|
98
|
+
for server, entry in desired.items():
|
|
99
|
+
if current.get(server) == entry:
|
|
100
|
+
continue
|
|
101
|
+
if server in current and current[server] != old.get(server) and not replace:
|
|
102
|
+
raise core.AgentPackError(f"Codex MCP destination differs: {server}; preview with --replace")
|
|
103
|
+
changes[server] = entry
|
|
104
|
+
operations.append({"action": "update-native-mcp" if server in current else "add-native-mcp", "name": server})
|
|
105
|
+
# A locally changed entry is no longer ours to remove.
|
|
106
|
+
removed = {server for server in old if server not in desired and current.get(server) == old[server]}
|
|
107
|
+
operations += [{"action": "remove-native-mcp", "name": server} for server in sorted(removed)]
|
|
108
|
+
result = render(original, changes, removed) if operations else original
|
|
109
|
+
try:
|
|
110
|
+
parsed = tomllib.loads(result).get("mcp_servers", {})
|
|
111
|
+
if any(parsed.get(server) != entry for server, entry in desired.items()):
|
|
112
|
+
raise ValueError()
|
|
113
|
+
except (tomllib.TOMLDecodeError, ValueError) as exc:
|
|
114
|
+
raise core.AgentPackError("Codex MCP must use named [mcp_servers.NAME] tables; convert inline entries first") from exc
|
|
115
|
+
return {"active": True, "path": config_path, "state_path": state_path, "original": original, "text": result,
|
|
116
|
+
"desired": desired, "operations": operations, "existed": config_path.exists(),
|
|
117
|
+
"old_state": state_path.read_text(encoding="utf-8") if state_path.exists() else None}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def _write(path: Path, text: str) -> None:
|
|
121
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
122
|
+
# A rewrite keeps the file's permissions (mkstemp would otherwise narrow 0644 to 0600); new files stay 0600.
|
|
123
|
+
mode = stat.S_IMODE(path.stat().st_mode) if path.exists() else None
|
|
124
|
+
handle, temporary = tempfile.mkstemp(prefix=".agent-pack-", dir=path.parent)
|
|
125
|
+
try:
|
|
126
|
+
with os.fdopen(handle, "w", encoding="utf-8") as stream:
|
|
127
|
+
stream.write(text)
|
|
128
|
+
if mode is not None:
|
|
129
|
+
os.chmod(temporary, mode)
|
|
130
|
+
os.replace(temporary, path)
|
|
131
|
+
finally:
|
|
132
|
+
if os.path.exists(temporary):
|
|
133
|
+
os.unlink(temporary)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def rollback(plan: dict) -> None:
|
|
137
|
+
if not plan["active"]:
|
|
138
|
+
return
|
|
139
|
+
if plan["existed"]:
|
|
140
|
+
_write(plan["path"], plan["original"])
|
|
141
|
+
elif plan["path"].exists():
|
|
142
|
+
plan["path"].unlink()
|
|
143
|
+
if plan["old_state"] is not None:
|
|
144
|
+
_write(plan["state_path"], plan["old_state"])
|
|
145
|
+
elif plan["state_path"].exists():
|
|
146
|
+
plan["state_path"].unlink()
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def apply(plan: dict, recovery: Path) -> None:
|
|
150
|
+
if not plan["active"]:
|
|
151
|
+
return
|
|
152
|
+
changed = plan["text"] != plan["original"]
|
|
153
|
+
try:
|
|
154
|
+
if changed:
|
|
155
|
+
if plan["existed"]:
|
|
156
|
+
_write(recovery / "codex-config.toml", plan["original"])
|
|
157
|
+
_write(plan["path"], plan["text"])
|
|
158
|
+
core._write_json_atomic(plan["state_path"], {"servers": plan["desired"]}, mode=0o600)
|
|
159
|
+
except Exception:
|
|
160
|
+
rollback(plan)
|
|
161
|
+
raise
|