Skip to content

feat: WAVE agent plugin scaffold (wave-agent-plugin) - #1

Draft
yakimoto wants to merge 1 commit into
mainfrom
feat/scaffold
Draft

yakimoto wants to merge 1 commit into
mainfrom
feat/scaffold

Conversation

@yakimoto

@yakimoto yakimoto commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Scaffold Cursor/Agent plugin for surface `wave-agent-plugin`.
  • Headline: Media MCP for agents: captions, clips, render, live — pay with key or x402.
  • `mcp.json`: `https://api.wave.online/mcp\`no required `WAVE_API_KEY`; optional Bearer for person path.
  • Skills (INTENT matrix): wave-media, wave-transcribe, wave-captions, wave-render, wave-clips, wave-x402-call + OpenAPI.
  • Four-renderings law: API authority; skills teach when/how — not a fifth semantic path.

Test plan

  • Install / connect remote MCP; tools discoverable
  • Agent path works without key (402 → x402)
  • Person path accepts optional Bearer when set

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by Sourcery

Introduce the WAVE Cursor/Agent plugin scaffold for metered media operations through remote MCP with optional API-key and x402 payment paths.

New Features:

  • Add a Cursor/Agent plugin for WAVE’s remote media MCP, covering transcription, captions, rendering, clips, discovery, OpenAPI, and x402 payments.
  • Support both optional Bearer authentication and keyless HTTP 402/x402 agent access.

Enhancements:

  • Document WAVE’s API-authority model, media usage meters, connection states, and safeguards against fabricated media results.

Build:

  • Add plugin metadata and remote MCP configuration for the WAVE service.

Documentation:

  • Add user-facing setup, authentication, skill coverage, endpoint, and payment-flow documentation.

Chores:

  • Add the MIT license.

Review in cubic

Remote MCP https://api.wave.online/mcp with optional WAVE_API_KEY (person path
only). Lean skills: wave-media, wave-transcribe, wave-captions, wave-render,
wave-clips, wave-x402-call, wave-openapi. Listing copy per Scout Keep.
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Reviewer's Guide

Scaffolds the wave-agent-plugin as a Cursor/Agent integration around WAVE’s remote MCP endpoint, with plugin metadata, optional Bearer authentication, agent-native x402 payment guidance, and intent-based skills for media operations grounded in the OpenAPI authority.

Sequence diagram for the WAVE dual-auth call

sequenceDiagram
    participant Agent
    participant MCP as WAVE_MCP
    participant Gateway as WAVE_Gateway
    participant Payment as x402_Base_USDC

    Agent->>MCP: Call media tool
    alt WAVE_API_KEY is set
        MCP->>Gateway: Authorization: Bearer key
        Gateway-->>MCP: Media result
    else No API key
        MCP->>Gateway: Unpaid media call
        Gateway-->>MCP: HTTP 402 challenge
        MCP->>Payment: Settle challenge
        Payment-->>MCP: Protocol credential
        MCP->>Gateway: Retry with x402 credential
        Gateway-->>MCP: Media result
    end
    MCP-->>Agent: Return real result
Loading

State diagram for WAVE plugin connection and payment

stateDiagram-v2
    [*] --> unconnected
    unconnected --> connected_no_key: connect MCP
    connected_no_key --> connected_with_key: optional Bearer configured
    connected_no_key --> payment_required_402: media call returns 402
    payment_required_402 --> connected_no_key: x402 settled and retry succeeds
    connected_with_key --> [*]
    connected_no_key --> [*]
Loading

File-Level Changes

Change Details Files
Adds Cursor/Agent plugin metadata and remote MCP configuration for the WAVE media service.
  • Defines plugin identity, surface name, and MIT licensing metadata.
  • Points clients to the remote MCP server and documents optional Bearer authentication without requiring an API key.
  • Documents MCP discovery and OpenAPI authority endpoints.
.cursor-plugin/plugin.json
plugin.json
mcp.json
LICENSE
README.md
Introduces a lean set of intent-oriented skills covering WAVE media workflows and API usage.
  • Adds skills for discovery, transcription, captions, rendering, clips, x402 payment handling, and OpenAPI lookup.
  • Maps skills to representative MCP tools, HTTP endpoints, and usage meters.
  • Documents the no-key 402-to-x402 flow, optional Bearer path, and safeguards against fabricated outputs.
  • Establishes the API-authority/four-renderings guidance across the skills.
skills/wave-media/SKILL.md
skills/wave-transcribe/SKILL.md
skills/wave-captions/SKILL.md
skills/wave-render/SKILL.md
skills/wave-clips/SKILL.md
skills/wave-x402-call/SKILL.md
skills/wave-openapi/SKILL.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

4 issues found across 12 files

Confidence score: 2/5

  • mcp.json leaves WAVE_API_KEY unwired, so the documented Bearer person-path authentication can fail; reference the variable from the MCP command/args/environment configuration and verify the auth flow.
  • .cursor-plugin/plugin.json resolves mcp.json and skills/* within .cursor-plugin/, where those resources are absent, so packaged installations may not load the server or clips skill; align the packaged paths or include the referenced files.
  • LICENSE changes the repository from Apache-2.0 to MIT, potentially removing patent and NOTICE/attribution protections for existing contributions; confirm contributor consent and the intended relicensing scope before merging.
  • skills/wave-clips/SKILL.md declares no meters while the skill and README describe gateway metering, creating inconsistent billing behavior or documentation; make the meter declaration match the gateway contract.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".cursor-plugin/plugin.json">

<violation number="1" location=".cursor-plugin/plugin.json:19">
P2: A plugin packaged/installed from this directory resolves `mcp.json` and `skills/*` relative to `.cursor-plugin/`, but that directory only contains `plugin.json` — `mcp.json` and `skills/` live at the repository root. The MCP and skills referenced here won't be found. The sibling root `plugin.json` also declares this MCP under a different field name (`mcpServers`) with `./skills/` paths, so the two manifests diverge. Either point these paths at the actual files (`../mcp.json`, `../skills/...`) or keep a single manifest and align the field names.</violation>
</file>

<file name="LICENSE">

<violation number="1" location="LICENSE:1">
P2: This change relicenses the whole repository from Apache-2.0 to MIT. Apache-2.0 grants an explicit patent license and imposes contributor attribution/NOTICE terms; MIT drops both. Relicensing existing Apache-2.0-covered code also requires consent from every prior contributor. Confirm the downgrade is intentional and sign off on it before merge, especially given the x402/payment code in this repo.</violation>
</file>

<file name="mcp.json">

<violation number="1" location="mcp.json:9">
P2: The declared `WAVE_API_KEY` is never wired into the MCP server config, so the Bearer person-path auth documented in the README cannot work. Cursor's `mcp.json` only applies variables referenced in `command`/`args`/`env`/`url`/`headers`; the `wave` entry has no `headers` block referencing `${WAVE_API_KEY}`. As a result, configured keys are silently dropped and calls fall through to the unauthenticated x402 path. Add an explicit header mapping to the server entry (and drop the unused `variables` block if it is not a supported key).</violation>
</file>

<file name="skills/wave-clips/SKILL.md">

<violation number="1" location="skills/wave-clips/SKILL.md:4">
P3: The clips skill declares an empty `meters: []` list while its body claims clips are metered through the gateway ("Meters re-enter gateway per PRODUCT-TRUTH"), and README.md maps clips to a gateway meter. Every other metered skill in this batch names its meter explicitly (wave_transcription_minutes, wave_caption_minutes, wave_render_minutes). As written, an agent selecting this skill gets no meter identifier to attribute usage against, so metering/attribution for clips could be dropped. Name the clips meter (e.g. `wave_clip_minutes`) or, if clips genuinely are unmetered, remove the metering claim from the body so the two don't contradict.</violation>
</file>
Architecture diagram
sequenceDiagram
    participant Agent as Agent (MCP Client)
    participant WAVE as WAVE MCP Server
    participant API as WAVE API
    participant Payer as x402 Payer

    Note over Agent,WAVE: Plugin Registration & Discovery

    Agent->>WAVE: Connect to MCP (https://api.wave.online/mcp)
    WAVE-->>Agent: Tools discovered (transcribe, captions, render, clips)

    alt No API Key (Agent/x402 path)
        Agent->>WAVE: Call capability (e.g., transcribe)
        WAVE->>API: Forward request (no Bearer)
        API-->>WAVE: HTTP 402 Payment Required
        WAVE-->>Agent: Return 402 challenge
        Agent->>Payer: Resolve x402 challenge
        Payer-->>Agent: Payment credential
        Agent->>WAVE: Retry with settlement header
        WAVE->>API: Forward authenticated request
        API-->>WAVE: Result (transcript, captions, render)
        WAVE-->>Agent: Return media result
    else Optional API Key (Person path)
        Agent->>WAVE: Call capability + Authorization: Bearer
        WAVE->>API: Forward with bearer token
        alt Valid key
            API-->>WAVE: Result
            WAVE-->>Agent: Return media result
        else Invalid SPEND_CAP_TIER_BLOCKED
            API-->>WAVE: 402 SPEND_CAP_TIER_BLOCKED
            WAVE-->>Agent: Return spend cap error (needs card)
        end
    end

    Note over Agent,WAVE: OpenAPI/Discovery (unmetered)
    Agent->>WAVE: facilitator_status / discovery
    WAVE-->>Agent: Status + x402 rails
    Agent->>API: Fetch OpenAPI spec (https://api.wave.online/openapi.json)
    API-->>Agent: OpenAPI document (authority for paths/schemas)
Loading

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

"skills/wave-x402-call",
"skills/wave-openapi"
],
"mcp": "mcp.json"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: A plugin packaged/installed from this directory resolves mcp.json and skills/* relative to .cursor-plugin/, but that directory only contains plugin.jsonmcp.json and skills/ live at the repository root. The MCP and skills referenced here won't be found. The sibling root plugin.json also declares this MCP under a different field name (mcpServers) with ./skills/ paths, so the two manifests diverge. Either point these paths at the actual files (../mcp.json, ../skills/...) or keep a single manifest and align the field names.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .cursor-plugin/plugin.json, line 19:

<comment>A plugin packaged/installed from this directory resolves `mcp.json` and `skills/*` relative to `.cursor-plugin/`, but that directory only contains `plugin.json` — `mcp.json` and `skills/` live at the repository root. The MCP and skills referenced here won't be found. The sibling root `plugin.json` also declares this MCP under a different field name (`mcpServers`) with `./skills/` paths, so the two manifests diverge. Either point these paths at the actual files (`../mcp.json`, `../skills/...`) or keep a single manifest and align the field names.</comment>

<file context>
@@ -0,0 +1,20 @@
+    "skills/wave-x402-call",
+    "skills/wave-openapi"
+  ],
+  "mcp": "mcp.json"
+}
</file context>

Comment thread LICENSE
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
MIT License

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: This change relicenses the whole repository from Apache-2.0 to MIT. Apache-2.0 grants an explicit patent license and imposes contributor attribution/NOTICE terms; MIT drops both. Relicensing existing Apache-2.0-covered code also requires consent from every prior contributor. Confirm the downgrade is intentional and sign off on it before merge, especially given the x402/payment code in this repo.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At LICENSE, line 1:

<comment>This change relicenses the whole repository from Apache-2.0 to MIT. Apache-2.0 grants an explicit patent license and imposes contributor attribution/NOTICE terms; MIT drops both. Relicensing existing Apache-2.0-covered code also requires consent from every prior contributor. Confirm the downgrade is intentional and sign off on it before merge, especially given the x402/payment code in this repo.</comment>

<file context>
@@ -1,201 +1,21 @@
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
+MIT License
+
+Copyright (c) 2026 WAVE / wave-av
</file context>

Comment thread mcp.json
}
},
"variables": {
"WAVE_API_KEY": {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: The declared WAVE_API_KEY is never wired into the MCP server config, so the Bearer person-path auth documented in the README cannot work. Cursor's mcp.json only applies variables referenced in command/args/env/url/headers; the wave entry has no headers block referencing ${WAVE_API_KEY}. As a result, configured keys are silently dropped and calls fall through to the unauthenticated x402 path. Add an explicit header mapping to the server entry (and drop the unused variables block if it is not a supported key).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At mcp.json, line 9:

<comment>The declared `WAVE_API_KEY` is never wired into the MCP server config, so the Bearer person-path auth documented in the README cannot work. Cursor's `mcp.json` only applies variables referenced in `command`/`args`/`env`/`url`/`headers`; the `wave` entry has no `headers` block referencing `${WAVE_API_KEY}`. As a result, configured keys are silently dropped and calls fall through to the unauthenticated x402 path. Add an explicit header mapping to the server entry (and drop the unused `variables` block if it is not a supported key).</comment>

<file context>
@@ -0,0 +1,15 @@
+    }
+  },
+  "variables": {
+    "WAVE_API_KEY": {
+      "description": "Optional person-path API key. When set, clients may send Authorization: Bearer <WAVE_API_KEY>. Not required for agent/x402 path.",
+      "required": false,
</file context>

---
name: wave-clips
description: use when creating, detecting, or managing WAVE clips / highlights
meters: []

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The clips skill declares an empty meters: [] list while its body claims clips are metered through the gateway ("Meters re-enter gateway per PRODUCT-TRUTH"), and README.md maps clips to a gateway meter. Every other metered skill in this batch names its meter explicitly (wave_transcription_minutes, wave_caption_minutes, wave_render_minutes). As written, an agent selecting this skill gets no meter identifier to attribute usage against, so metering/attribution for clips could be dropped. Name the clips meter (e.g. wave_clip_minutes) or, if clips genuinely are unmetered, remove the metering claim from the body so the two don't contradict.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At skills/wave-clips/SKILL.md, line 4:

<comment>The clips skill declares an empty `meters: []` list while its body claims clips are metered through the gateway ("Meters re-enter gateway per PRODUCT-TRUTH"), and README.md maps clips to a gateway meter. Every other metered skill in this batch names its meter explicitly (wave_transcription_minutes, wave_caption_minutes, wave_render_minutes). As written, an agent selecting this skill gets no meter identifier to attribute usage against, so metering/attribution for clips could be dropped. Name the clips meter (e.g. `wave_clip_minutes`) or, if clips genuinely are unmetered, remove the metering claim from the body so the two don't contradict.</comment>

<file context>
@@ -0,0 +1,13 @@
+---
+name: wave-clips
+description: use when creating, detecting, or managing WAVE clips / highlights
+meters: []
+endpoints:
+  - /v1/clips
</file context>
Suggested change
meters: []
meters: [wave_clip_minutes]

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