0708e99e4e
Agents may declare git.user (name/email); it overlays the referenced bottle's git.user per-field at Manifest.bottle_for (agent wins on non-empty), mirroring the extends: merge. git.remotes is rejected on agents — it carries credentials and host trust and stays bottle-only. The overlay lives at bottle_for, the single chokepoint both backends use, so the docker/smolmachines git provisioners are unchanged. Adds Manifest.git_identity_summary with per-field (agent)/(bottle) provenance, printed in both preflights and `info`. Refs #94 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
49 lines
1.6 KiB
Python
49 lines
1.6 KiB
Python
"""info: print env, skills, and prompt details for a named agent."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
|
|
from ..log import info
|
|
from ..manifest import Manifest
|
|
from ._common import PROG, USER_CWD
|
|
|
|
|
|
def cmd_info(argv: list[str]) -> int:
|
|
parser = argparse.ArgumentParser(prog=f"{PROG} info", add_help=True)
|
|
parser.add_argument("name", help="agent name defined in bot-bottle.json")
|
|
args = parser.parse_args(argv)
|
|
|
|
manifest = Manifest.resolve(USER_CWD)
|
|
manifest.require_agent(args.name)
|
|
|
|
agent = manifest.agents[args.name]
|
|
bottle = manifest.bottle_for(args.name)
|
|
env_names = list(bottle.env.keys())
|
|
prompt_first_line = agent.prompt.splitlines()[0] if agent.prompt else ""
|
|
|
|
print()
|
|
info(f"agent : {args.name}")
|
|
info(f"env (names only): {', '.join(env_names) if env_names else '(none)'}")
|
|
info(f"skills : {' '.join(agent.skills) if agent.skills else '(none)'}")
|
|
info(
|
|
f"prompt : {len(agent.prompt)} chars; "
|
|
f"first line: {prompt_first_line or '(empty)'}"
|
|
)
|
|
info(f"bottle : {agent.bottle}")
|
|
identity = manifest.git_identity_summary(args.name)
|
|
if identity:
|
|
info(f" git identity : {identity}")
|
|
if bottle.git:
|
|
for e in bottle.git:
|
|
info(
|
|
f" git remote : {e.Name} -> {e.Upstream} "
|
|
f"(IdentityFile={e.IdentityFile})"
|
|
)
|
|
if e.KnownHostKey:
|
|
info(f" KnownHostKey: {e.KnownHostKey}")
|
|
else:
|
|
info(" git remotes : (none)")
|
|
print()
|
|
return 0
|