feat(capabilities): PR-4 — run_capability generic verb (zero-code onboarding G4)#683
Merged
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_mediais media-in/media-out;run_capabilitydispatches 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_capabilitynow picks the verb byoutput_kind(media→create_media, else→run_capability).Files:
tools/run-capability.ts(new, thin dispatch + pureformatRunResult),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