Skip to content

feat(kroki): deliver safe artifacts and literal fenced source - #346

Merged
devth merged 2 commits into
masterfrom
feat/kroki-artifacts
Nov 11, 2026
Merged

devth merged 2 commits into
masterfrom
feat/kroki-artifacts

Conversation

@devth

@devth devth commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Diagram source can stay literal inside complete Markdown fences, and generated SVG/PDF/text can reach Discord as files rather than unsupported image galleries.

This is the core prerequisite for discovery-first Kroki commands and native agent rendering. The plugin and app changes follow in separate repositories; nothing is merged or deployed by this PR.

Safety and compatibility

  • Download, sandbox and nosniff protections follow the stored MIME, so requesting an SVG through a legacy .png alias cannot bypass them. Existing raster/video previews stay inline.
  • Multiple generated artifact URLs each receive an upload; repeated URLs do not duplicate uploads. Existing frozen inspection and reply controls remain.
  • Literal-fence handling applies to the shared parser, not just Kroki. Executable-looking text inside a complete fence stays data; an ordinary pipeline after it still runs. Unfenced input keeps the existing command grammar.

Related

Validation

  • Full normal core suite: 2,153 Midje checks, no failures.
  • Focused routes, Discord components and parser suites: 234 checks, no failures. Tests include active SVG on legacy aliases and a fence-like prefix inside literal source.
  • Source-composed live Kroki smoke exercised PNG/SVG storage and the hosted SVG route. This is not a published-artifact or natural Discord gateway/client qualification.
  • Manual inline correctness/privacy and simplification review; no independent or cross-model review.
  • No screenshots: there is no running Discord client with the changed adapter; capture would require additional setup/deployment.

Keep raster previews inline and deliver SVG, PDF and text as files. Apply download and sandbox protections from stored MIME, including legacy route aliases, and attach each distinct generated URL.
Diagram source may contain pipes, backticks and executable-looking text. Parse complete fenced blocks as data while preserving outer pipelines and rejecting premature fence-like prefixes as closing markers.
@devth
devth merged commit 0605945 into master Nov 11, 2026
1 check passed
@devth
devth deleted the feat/kroki-artifacts branch November 11, 2026 16:30
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