tools: expose a2a_pack source to the inner LLM loop
All checks were successful
build / build (push) Successful in 3s

list_a2a_pack(subdir) / read_a2a_pack(path) let the builder browse the
installed SDK at runtime — the same package the scaffolded agents
import. Path-traversal guarded; reads capped at 64 KiB.

Why: the system prompt only carries an abridged example. When the LLM
needed to recall what RunContext exposes (ctx.workspace API, ctx.ask
vs ctx.collect, runtime.apt_packages…) it would guess. Now it can
read the actual source.

Prompt updated to point at the new tools.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
robert
2026-05-15 22:08:54 -03:00
parent abc4b96455
commit 80a5d3bce4
2 changed files with 99 additions and 0 deletions

View File

@@ -94,6 +94,23 @@ Your tools:
- cp_deploy_tarball(name, version="0.1.0", public=True)
— ship it to the platform; returns the
public URL
- cp_refresh_agent(name) — force the control plane to re-fetch
the agent's live card after an
out-of-band redeploy
- list_a2a_pack(subdir="") — browse the installed a2a_pack SDK
- read_a2a_pack(path) — read SDK source. Use these when
you're unsure what's exposed. The
code you scaffold runs on this
exact SDK, so reading it is the
authoritative reference — start
with ``read_a2a_pack("agent.py")``
for ``@skill`` semantics,
``context.py`` for ``RunContext``
(workspace, sandbox, emit_progress,
ask, collect, request_scope),
``runtime.py`` for ``AgentRuntime``
fields (apt_packages, pricing,
egress, etc.).
Discipline: