feat: rename skills/skiff to pouch and move ACK state under .pouch
Use ~/.pouch, the pouch CLI, and .pouch.yaml as the SSOT container. Keep the inner skills/ packages, and store ACK project state in .pouch/ack instead of docs/ack.
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
"""Agent 名称解析(兼容 Vercel skills CLI 别名)。"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pouch.paths import ALL_TARGETS
|
||||
|
||||
AGENT_ALIASES: dict[str, str] = {
|
||||
"cursor": "cursor",
|
||||
"claude": "claude",
|
||||
"claude-code": "claude",
|
||||
"codex": "codex",
|
||||
"agents": "agents",
|
||||
}
|
||||
|
||||
AGENT_CHOICES = sorted({*ALL_TARGETS, *AGENT_ALIASES.keys()})
|
||||
|
||||
|
||||
def flatten_agent_args(groups: list[list[str]] | None) -> list[str] | None:
|
||||
if not groups:
|
||||
return None
|
||||
flat = [item for group in groups for item in group]
|
||||
return flat or None
|
||||
|
||||
|
||||
def resolve_agent_args(agents: list[str] | None) -> list[str]:
|
||||
if not agents or agents == ["*"] or "*" in agents:
|
||||
return list(ALL_TARGETS)
|
||||
|
||||
resolved: list[str] = []
|
||||
for raw in agents:
|
||||
key = raw.lower()
|
||||
if key == "*":
|
||||
return list(ALL_TARGETS)
|
||||
target = AGENT_ALIASES.get(key)
|
||||
if target is None:
|
||||
choices = ", ".join(AGENT_CHOICES)
|
||||
raise SystemExit(f"未知 agent: {raw!r},可选: {choices}")
|
||||
if target != "*" and target not in resolved:
|
||||
resolved.append(target)
|
||||
return resolved
|
||||
Reference in New Issue
Block a user