CL-6499: Gotenberg-backed Markdown-to-PDF rendering - #237
Merged
Merged
Conversation
# Conflicts: # bun.lock
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.
Summary
@corbits/gotenberg-render, a domain package that renders a Markdown Library artifact to PDF through an operator-configured Gotenberg server, and hands the resulting bytes to a caller-supplied sink to persist as a new artifact.resolveGotenbergConfig(env)readsGOTENBERG_URL(arktype-validated at the boundary) and returnsnullwhen unset — the render capability is then simply absent, never a startup error and never a no-op button.renderMarkdownToPdfis a thin client over Gotenberg's Chromiumconvert/markdownroute.renderMarkdownArtifactToPdforchestrates render + persist and reports any failure through@corbits/error-sink, returning a plain-language message ("Couldn't build the PDF. Try again shortly.") plus arefId— never a raw HTTP status.@corbits/artifacts-hub's own routes inject their store.What's still missing (see package README)
Rendering works end to end against any Markdown + a running Gotenberg server. Two gaps remain before a real Scout-produced brief renders with no glue code:
POST /andGET /recentbut noGET /:idto read an artifact's content back.Out of scope per the lane brief:
workflows/diligence-brief/(research orchestration) and any UI wiring — this PR is rendering only.Test plan
bun testinpackages/gotenberg-render— 9/9 passing (markdown artifact renders to PDF bytes; unconfigured endpoint returnsnullrather than erroring; a malformedGOTENBERG_URLthrows; a Gotenberg network/HTTP failure surfaces the friendly message + reports through@corbits/error-sink)bun run typecheckinpackages/gotenberg-renderbun run check(typecheck/lint/test),check:packages,check:licenses— skipped: the owner's machine is out of memory and asked that only package-scopedbun test/typecheckrun this session. LICENSE/package.json/exports shape was matched by hand againstpackages/error-sink.https://github.com/corbitsdev/workbench/pull/new/cl-6499-gotenberg