Skip to content

feat(capabilities): PR-4 — run_capability generic verb (zero-code onboarding G4)#683

Merged
seanhanca merged 1 commit into
mainfrom
feat/run-capability-verb
Jul 20, 2026
Merged

feat(capabilities): PR-4 — run_capability generic verb (zero-code onboarding G4)#683
seanhanca merged 1 commit into
mainfrom
feat/run-capability-verb

Conversation

@seanhanca

Copy link
Copy Markdown
Contributor

PR-4 of the zero-code onboarding effort (plan §4, gap G4). Builds on PR-1/2/3.

What: run_capability — the output-kind-generic invocation verb. create_media is media-in/media-out; run_capability dispatches ANY cap through the same transparent SDK /inference (inheriting PR-2's descriptor-driven routing), returning a hosted URL for media caps and the payload inline for text/json caps (e.g. a video-understanding analyzer — the screen-agent shape). describe_capability now picks the verb by output_kind (media→create_media, else→run_capability).

Files: tools/run-capability.ts (new, thin dispatch + pure formatRunResult), server.ts (register), tools/describe-capability.ts (verb-selection).

No-regression: additive; no hot-path change; image caps' describe output unchanged (test green). Deliberately thin — no auto-injection/quality gates (that's create_media); spend-report integration is a documented follow-up. 6 formatter tests + describe/golden green.

🤖 Generated with Claude Code

…oarding G4)

The output-kind-generic invocation surface. create_media is media-in/media-out;
run_capability dispatches ANY capability through the same transparent SDK
/inference envelope (inheriting PR-2's descriptor-driven routing), returning a
hosted URL for media caps and the payload inline for text/json caps (e.g. a
video-understanding analyzer). This is the verb an agent uses for non-media caps.

- lib/mcp-server/tools/run-capability.ts (new): thin dispatch + a PURE
  formatRunResult (media→url, text/json→inline, upstream-error→humanized) that
  reuses create_media's classifyUpstreamError + creative-kit's extract helpers.
- server.ts: register run_capability.
- describe_capability: verb-selection by output_kind — media→create_media,
  else→run_capability (+ a matching example/invoke hint). Image caps unchanged.

Additive; no hot-path change. Deliberately thin (no auto-injection/quality
gates); spend-report integration is a documented follow-up. 6 formatter tests +
existing describe/golden tests green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@seanhanca
seanhanca merged commit bbe185a into main Jul 20, 2026
6 checks passed
@seanhanca
seanhanca deleted the feat/run-capability-verb branch July 20, 2026 01:28
@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
storyboard Error Error Jul 20, 2026 1:35am
storyboard-a3 Error Error Jul 20, 2026 1:35am
storyboard-creative-stage Ready Ready Preview, Comment Jul 20, 2026 1:35am

Request Review

seanhanca added a commit that referenced this pull request Jul 20, 2026
… next build)

describe_capability's defaultInvokeVia(entry?.output_kind) passes
OutputKind | null | undefined, but the param was typed string | undefined —
`null` isn't assignable, so `next build`'s type-check failed (vitest/esbuild
doesn't typecheck, so it slipped through PR-4's #683 gate; main is red on Vercel
as a result). Widen the param to string | null | undefined (the `?? "image"`
already handles null at runtime). tsc clean on all touched files.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
seanhanca added a commit that referenced this pull request Jul 20, 2026
…ity generator (#684)

* feat(capabilities): PR-8 — capability standard export + draft_capability generator (G1 authoring)

Author-by-derivation (plan §3.5): a provider supplies only irreducible facts;
storyboard generates every derivable field + refuses non-compliant input.

- lib/capabilities/standard.ts (browser-safe): the machine-readable standard —
  kinds, output-kinds, modality vocabulary + live-registry modalities, agent-param
  names, input transforms, naming grammar. + isKnownModality / suggestModalities.
- app/api/capabilities/standard/route.ts: public cached GET so a provider / their
  agent authors against the current standard (same one the sync + validator use).
- lib/mcp-server/tools/draft-capability.ts: draft_capability verb — pure buildDraft
  (derive semantic_key + canonical name + output_kind, assemble, validate) +
  dedupVerdict (NEW / ADD-CAPACITY / SYNONYM) + a modality-vocabulary check.
  Returns a ready-to-publish descriptor.
- server.ts: register draft_capability.

Additive; reuses PR-1 schema + PR-3 canonicalName/dedup. 9 tests + golden green.
(CLI `cap init` wrapper over the same buildDraft is a thin follow-up.)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(capabilities): defaultInvokeVia accepts null output_kind (unbreak next build)

describe_capability's defaultInvokeVia(entry?.output_kind) passes
OutputKind | null | undefined, but the param was typed string | undefined —
`null` isn't assignable, so `next build`'s type-check failed (vitest/esbuild
doesn't typecheck, so it slipped through PR-4's #683 gate; main is red on Vercel
as a result). Widen the param to string | null | undefined (the `?? "image"`
already handles null at runtime). tsc clean on all touched files.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant