Markit SDK + Hono Integration Patterns
Markit SDK (markit-ai) Integration Patterns
Constructor: new Markit({ describe, transcribe }) — AI functions set at construction time, NOT per-call. markit.convert(buffer, { extension, filename }) returns { markdown: string; title?: string }.
mupdf: Ships as pre-built WASM — no build-essential or native compilation needed in Docker. Common misconception that it requires native bindings.
Hono SSE: Use streamSSE from hono/streaming. Track clients via Set. stream.writeSSE({ event, data }) for sending. @hono/node-server REQUIRED alongside hono to listen on a port.
Hono multipart: c.req.parseBody({ all: true }) returns File objects. file.arrayBuffer() buffers in memory — no streaming alternative. Bound via bodyLimit() middleware.
Quality audit patterns (18 issues found across 4 parallel agents):
- Unhandled promise rejection in async IIFE error handlers — always wrap broadcast calls
- File descriptor leak:
openSync/closeSyncneeds try/finally - Content-Disposition header injection: sanitize filenames for HTTP headers
serve()return must be captured forserver.close()in graceful shutdown- Frontend regressions: always compare new SPA against original for feature parity
Related
- clawteam-openclaw-multi-agent-swarm-evaluation
- enterprise-capability-expansion-5-pillars-from-digital-employee-analysis
- notebooklm-mcp-integration-pattern
gws-capability-expansion-nova(archived)claude-code-to-nova-20260327-090715(archived)- file-manager-rewrite-python-to-typescript-with-markit-sdk
- graphiti-traefik-sse-buffering-causes-504
- omnigraph-mcp-sessionless-no-header-returned
- claude-sdk-rate-limit-event-unknown-message-type-error
- mdapi-sync-calls-require-asyncio-to-thread-wrapping
- xint-mcp-requires-authorization-bearer-header-in-config