Skip to content

[cold-review] feat(cli): cross-flavor inline image display#52

Draft
heavygee wants to merge 13 commits into
mainfrom
feat/cross-flavor-inline-images
Draft

[cold-review] feat(cli): cross-flavor inline image display#52
heavygee wants to merge 13 commits into
mainfrom
feat/cross-flavor-inline-images

Conversation

@heavygee

@heavygee heavygee commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Fork-side cold-review stage for upstream PR tiann#958 (not for merge into fork main).

Summary

Cross-flavor inline image and video in HAPI web: display_image + display_video MCP, shared prompts, ACP image blocks, web <video> on generated-image RPC path.

Test plan

  • bun typecheck
  • Focused CLI/web tests (generatedImages, buildHapiMcpBridge, generatedInlineMedia)
  • Manual PNG inline in HAPI web; MP4 requires session restart after CLI deploy

Issues

Ref tiann#956

@heavygee heavygee added the cold-review-clean Fork-side bot review is satisfactory; safe to promote to upstream PR label Jun 19, 2026
heavygee and others added 13 commits July 2, 2026 11:54
Share display_image prompt across MCP-bridge flavors (Cursor, Gemini,
Kimi, Codex, Claude, OpenCode), auto-approve the tool in
buildHapiMcpBridge, handle ACP image content blocks, and harden
generated-image registration with content sniffing.

Closes tiann#956

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep object URLs stable across refetch, upscale tiny inline images,
fetch generated-image bytes with cache no-store (avoid empty 304 bodies),
and load hapiMcpUrl from per-session API in hapi-display-image tooling.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add display_video alongside display_image, video MIME sniffing with avif
guard, web GeneratedImageCard video player, and hapi-display-image auto-routing.

Co-authored-by: Cursor <cursoragent@cursor.com>
Share display_video prompts across MCP-bridge flavors, auto-approve the
tool, register mp4/webm via path sniffing, render inline video in web on
the existing generated-image RPC path, and restore robust media card fetch.

Co-authored-by: Cursor <cursoragent@cursor.com>
Bun hoists @modelcontextprotocol/sdk to the repo root; importing via
cli/node_modules broke the dogfood script in worktrees.

Co-authored-by: Cursor <cursoragent@cursor.com>
Flush buffered assistant text before async generated_image emit from ACP
image blocks (PR tiann#958 review Major). Add optional source metadata on
generated-image wire messages (ingress, flavor, toolCallId, toolName) for
MCP, ACP, and Codex tool-result paths. Seeds artifact-event follow-up tiann#966.

Co-authored-by: Cursor <cursoragent@cursor.com>
…tale blobs

Queue ACP session updates and await async image registration before later
events; clear GeneratedImageCard blob state when imageId changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Straggler session/update during drainLateBuffers can queue async image
registration; re-await sessionUpdateQueue so generated_image is not emitted
after turn_complete.

Co-authored-by: Cursor <cursoragent@cursor.com>
Match server-side detectImageMimeType so .avif files are not sent to
display_video and rejected as unsupported video.

Co-authored-by: Cursor <cursoragent@cursor.com>
- hapi doctor inline-media: probe bridges, print per-session inline commands
- Expose hapiMcpUrl on session list summaries (stops false "no MCP" scans)
- Helper script: match cursorSessionId prefixes; HAPI_SESSION_ID path-only mode
- ACP bridge prompt: shell fallback + HAPI session id vs agent id rule

Co-authored-by: Cursor <cursoragent@cursor.com>
When env session id is set, treat argv[2] as media path even if argv[3]
is title (drop !imagePath guard that mis-assigned title as imagePath).

Co-authored-by: Cursor <cursoragent@cursor.com>
Drop cache: no-store on generated-image fetch so browser can reuse hub
immutable responses; on 304 re-read via force-cache (tiann#927, PR review).

Co-authored-by: Cursor <cursoragent@cursor.com>
Cursor ACP ignores session/new mcpServers. Write .cursor/mcp.json and
run agent mcp enable hapi instead. Remove HAPI_MCP_BRIDGE_PROMPT from
user turns on ACP remotes; enrich MCP tool descriptions for discovery.

Co-authored-by: Cursor <cursoragent@cursor.com>
@heavygee heavygee force-pushed the feat/cross-flavor-inline-images branch from b8e9dd2 to 7337eae Compare July 2, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cold-review-clean Fork-side bot review is satisfactory; safe to promote to upstream PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant