Skip to content

SHOWBOAT_REMOTE_URL feature#18

Merged
simonw merged 3 commits into
mainfrom
claude/tdd-external-plan-5beU9
Feb 16, 2026
Merged

SHOWBOAT_REMOTE_URL feature#18
simonw merged 3 commits into
mainfrom
claude/tdd-external-plan-5beU9

Conversation

@simonw
Copy link
Copy Markdown
Owner

@simonw simonw commented Feb 16, 2026

Fetch https://gist.githubusercontent.com/simonw/7d4a02f8b6672ecd6be4fbadc0d0237f/raw/e6f5e4b0d1c0883a80df707411e4df51052c3910/plan.md and use that as your plan and build it using red/green TDD

Refs:

Earlier planning transcript: https://claude.ai/code/session_01D71x3zZWgSA11WEe791PXV

Summary

This PR adds webhook integration to Showboat, allowing document events (initialization, notes, code execution, images, and deletions) to be posted to a remote server via the SHOWBOAT_REMOTE_URL environment variable.

Key Changes

  • New remote module (cmd/remote.go): Implements webhook posting functionality with three main functions:

    • postSection(): POSTs document sections (init, note, exec commands) as form-encoded data
    • postImage(): POSTs image blocks as multipart/form-data
    • postPop(): POSTs document deletion events
    • documentID(): Extracts the document ID from title blocks
  • Document ID tracking:

    • Added DocumentID field to TitleBlock struct to uniquely identify documents
    • Init() now generates a UUID for each new document
    • Document IDs are persisted in markdown as HTML comments (<!-- showboat-id: ... -->)
    • Parser and writer updated to handle document ID comments
  • Event posting integration:

    • Note() posts note events to remote server
    • Exec() posts code execution events with language and output
    • Image() posts image events with multipart form data
    • Pop() posts document deletion events
    • All remote operations are non-blocking warnings; errors don't fail the command
  • Comprehensive test coverage:

    • New cmd/remote_test.go with 11 tests covering all webhook scenarios
    • Tests verify correct payload formats, error handling, and no-op behavior when env var is unset
    • Integration tests in cmd/build_test.go verify event posting from high-level commands
    • Parser and writer tests verify document ID round-tripping

Implementation Details

  • Remote posts use a 10-second timeout to prevent blocking
  • All HTTP errors are logged to stderr as warnings but don't interrupt the command
  • Document IDs are optional; operations work normally if SHOWBOAT_REMOTE_URL is unset
  • Image posting uses multipart/form-data; other operations use form-urlencoded
  • UUID dependency (github.com/google/uuid) is now a direct dependency (was indirect)

https://claude.ai/code/session_01Qs1QQwD6Zj3mMRDW8N5c4H

Each document now receives a unique identifier (DocumentID) stored in
the TitleBlock and emitted as an HTML comment after the timestamp line.
When SHOWBOAT_REMOTE_URL is set, init/note/exec/image/pop commands POST
their content to the remote endpoint, enabling real-time document
streaming to external viewers.

https://claude.ai/code/session_01Qs1QQwD6Zj3mMRDW8N5c4H
@simonw simonw added the enhancement New feature or request label Feb 16, 2026
@simonw simonw changed the title Add remote webhook integration for document events SHOWBOAT_REMOTE_URL feature Feb 16, 2026
Documents the SHOWBOAT_REMOTE_URL environment variable, authentication
via query string, and the POST body format for each command type.

https://claude.ai/code/session_01Qs1QQwD6Zj3mMRDW8N5c4H
@simonw
Copy link
Copy Markdown
Owner Author

simonw commented Feb 16, 2026

Manually tested as part of this and it works great:

The receiver of a command=image POST gets the file upload and needs the
generated filename to store/display it. The raw user input (e.g. a path
or markdown reference) is less useful than the actual filename.

https://claude.ai/code/session_01Qs1QQwD6Zj3mMRDW8N5c4H
@simonw simonw merged commit f44daa9 into main Feb 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants