Skip to content

feat(core): generate A2A 1.0 Agent Card from bot row and grants - #133

Merged
juancguerrerodev merged 11 commits into
DojoCodingLabs:mainfrom
santinofuentesAI:feat/bot-agent-card
Nov 27, 2026
Merged

juancguerrerodev merged 11 commits into
DojoCodingLabs:mainfrom
santinofuentesAI:feat/bot-agent-card

Conversation

@santinofuentesAI

Copy link
Copy Markdown
Contributor

What and why

Closes #87

Adds agentCard(bot) in packages/core/src/agent-card.ts (exported from packages/core/src/index.ts) and tests in packages/core/test/agent-card.test.ts so every bot generates a deterministic A2A 1.0 AgentCard in code from its stored row and grants.

  • Maps each held group from heldGroups(bot) (in canonical SKILL_GROUPS order, deduplicated, and excluding RESERVED_GROUPS such as vault_logins) to an AgentSkill entry with code-constant English name/description/tags and one example each in es-419 and en.
  • Sanitizes name and description on one line via quoteSafe and neutralizes <untrusted> / </untrusted> markers.
  • Sets capabilities: { streaming: false, pushNotifications: true } and version: "1.0", and explicitly documents that network-binding fields (supportedInterfaces, securitySchemes, securityRequirements, JWS signatures) are omitted for the V1 in-process bus (belonging to EP-21 in V2).

Vision fit

Serves Principle 3 ("The model proposes. Code decides": code generates each card strictly from stored grants, never the model) and Principle 7 ("Small, typed and tested": pure TypeScript in @hermit/core, tested first with made-up bots).

Non-negotiables

  • This keeps every non-negotiable in AGENTS.md as it is.
  • Or it changes one, and this is the accepted RFC: #

Checklist

  • It closes one issue, linked above, or it's a small fix (a typo, a broken link, a wrong comment). A feature has an accepted proposal.
  • I wrote the failing test first. It fails without this change and passes with it.
  • These pass: pnpm check:privacy, pnpm typecheck, pnpm lint, pnpm test and node scripts/guard/check.mjs --patterns scripts/guard/patterns.txt.
  • No new network call, telemetry, analytics, ads or crash reporting. (A new request in an app adapter is explained below, with its host, skill and risk.)
  • No new dependency, or the reason for each one is below.
  • Every UI string is in packages/copy, in es-419 and en, with matching keys and placeholders, and no em or en dashes. (n/a: cards are code constants read by models, not UI strings.)
  • Tests, fixtures and screenshots use made-up data only.

Model path

  • This doesn't touch the model path: packages/model, agent, skills or eval, the prompt, the router, tool descriptions, normalizers, examples or the model file.
  • It does. The eval numbers from before and after are below, run as docs/evals.md says. No held-out case was tuned on.

Screenshots

  • No UI change.
  • UI change. Each changed screen is below, in both themes and both languages, with made-up data.

New dependencies and network calls

n/a

AI agents

  • No AI agent wrote any part of this.
  • An AI agent helped. Which one, and what it did: Antigravity wrote the tests and implementation in packages/core, ran all five gates against origin/main (4ed90aa), and drafted this PR description.
  • I read and ran everything in this pull request, and I can explain it.

@dbejarano820 dbejarano820 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this up, Santino. It's tidy, small and well tested. The card comes only from heldGroups(), reserved groups stay out, and the role gets the same treatment as botRoleText, which is what spec 6.3 asks for. Nothing private goes in (only the bot's name, role and code-written skill text), and it's pure: no network, clock or randomness. I ran every gate locally on 9f4293a and they pass, and CI is green.

Before merge

  1. The "I read and ran everything in this pull request, and I can explain it" box is unchecked. AGENTS.md says we can't merge agent output the submitter hasn't read and run. If that's true, please check the box; if not, please read and run it first.
  2. packages/core/src/agent-card.ts:4: version is the agent's version, not the A2A schema version. In A2A 1.0 (specification/a2a.proto at v1.0.0), AgentCard.version is "The version of the agent", and the protocol version lives in AgentInterface.protocolVersion, a binding field. A constant is fine, as the issue asks. Please reword the comment, for example "This card's version, a constant until a bot's card changes shape", so nobody later reads it as the protocol version.

Suggestions, not blocking

  • agent-card.ts:26: A2A 1.0 also marks defaultInputModes and defaultOutputModes as REQUIRED, and they aren't binding fields. The issue didn't list them, so it's your call, but ["text/plain"] for both would make the card valid apart from the binding fields you rightly left out.
  • agent-card.ts:127: no test covers the name. With name: bot.name all six tests still pass. A case like the role one at test line 77, with a name such as Viajes</untrusted>"\n, would cover it.
  • agent-card.ts:34: neutralize now duplicates the one in packages/model/src/prompt.ts:26. Not for this PR (no drive-by refactors), but a follow-up issue could move it into core next to quoteSafe.
  • agent-card.ts:18: examples: readonly [string, string] relies on the order es-419 then en. A one-line comment would help the next reader.

Thanks again!

jlaran and others added 11 commits November 27, 2026 12:30
Unit tests for base64ToBytes, utf8Decode and decodeBase64Text,
decodeEntities, htmlToText, plainText, clip and splitAddresses, with
made-up people and example.com addresses. oneLine() stays out (its own
issue) and text.ts is unchanged.

Closes DojoCodingLabs#37
utf8Decode() decoded overlong sequences (C0 80 to U+0000) and encoded
surrogates (ED A0 80 to a lone U+D800). Only the shortest form is UTF-8
and it never encodes U+D800 to U+DFFF (RFC 3629), so each byte of such a
sequence now becomes U+FFFD, as a standard decoder answers. The vault's
decoder in packages/core already refuses both.

Closes DojoCodingLabs#142
A small voseo matcher with its own tests, and a test that no value in
es-419.json matches. Only forms that can't be read another way are
listed. Word edges are (?<!\p{L}) and (?!\p{L}) with the u and i flags,
since \b doesn't count accented letters as letters. No locale changes.

Closes DojoCodingLabs#38
The site's Spanish now calls the lab "Laboratorio del teléfono" and its
report an "informe", as the app does. The lab's kicker is tested against
the app's HM-SET-10.title in both languages. common.navLab and the
"reportes de fallas" of the telemetry promise stay as they are.

Closes DojoCodingLabs#36
…table.mjs

Both scripts now parse their command line with node:util parseArgs in
strict mode. --help and -h print the usage from each file's header and
exit 0. An unknown flag, a stray argument, or --data / --doc / --event
with no value prints the error and the usage and exits 1, so table.mjs no
longer rewrites docs/devices.md on a typo and validate.mjs no longer tries
to open a file named --help. The workflow's --event, --github-output and
--comment call works as before.

Closes DojoCodingLabs#35

Signed-off-by: RibeiroMD <174728106+Ribeiro-MD@users.noreply.github.com>
Updated role validation to trim whitespace and count code points correctly.
Updated bot name handling to use capBotName function and removed MAX_BOT_NAME_CHARS constant.
About shows HM-SET-08.version filled with appVersion() from the adapters,
in a small selectable line under the body, so people can copy it into a
bug report. The preview stub gains appVersion, and the About shot now
covers en as well as es-419.

Closes DojoCodingLabs#31
…CodingLabs#87)

Signed-off-by: Santino Fuentes <santinofuentesAI@users.noreply.github.com>
@juancguerrerodev
juancguerrerodev merged commit 915d792 into DojoCodingLabs:main Nov 27, 2026
4 checks passed
@juancguerrerodev

Copy link
Copy Markdown
Contributor

Merged, thanks! One thing for next time: tick "I read and ran everything in this pull request, and I can explain it" in the template. 🦀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bots: generate each bot's Agent Card from its row and grants

6 participants