agent: collapse capability As* helpers onto two generic gates

Commit

Soph2mo ago

Every As* helper repeated the same nil-check / type-assert / CapabilityDeclarer-gate dance. Fold the logic into declaredCapability[T] (assert + DeclaredCaps gate) and builtinCapability[T] (assert only, for built-in-only capabilities), leaving each As* a one-line wrapper with its existing doc contract. Behavior is unchanged and covered by the existing per-capability gate tests in capabilities_test.go.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com Entire-Checkpoint: 7b73bd925300

Checkpoints

/goal simplify this repo, make sure to de-slop it continue until you are happy, make sure to backfill tests and validate any significant change. The output of this should be a PR with green CI, review

Claude CodeFable 5
View session
Checkpoint 1