internal/

directory
v0.1.0-alpha.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: Apache-2.0

Directories

Path Synopsis
Package agent is the brain of Sweef's sidebar browser agent: a direct Anthropic Messages API client (net/http + own SSE parser), a tool loop with early dispatch of streamed tool calls, cache-aware context management and prompt-injection defences.
Package agent is the brain of Sweef's sidebar browser agent: a direct Anthropic Messages API client (net/http + own SSE parser), a tool loop with early dispatch of streamed tool calls, cache-aware context management and prompt-injection defences.
Package agentbridge connects the Go agent loop (internal/agent) to the GUI (internal/app): Host implements app.AgentHost and its optional capabilities, and Backend implements agent.Backend over the app's live tabs.
Package agentbridge connects the Go agent loop (internal/agent) to the GUI (internal/app): Host implements app.AgentHost and its optional capabilities, and Backend implements agent.Backend over the app's live tabs.
app
Package app is the browser core behind `sweef gui`: it owns the engine tabs (one privileged chrome tab plus one tab per page), the state model, the stores, the compositor and the input router, and talks to a native window only through shell.Window.
Package app is the browser core behind `sweef gui`: it owns the engine tabs (one privileged chrome tab plus one tab per page), the state model, the stores, the compositor and the input router, and talks to a native window only through shell.Window.
cmd/appbench command
Command appbench measures the GUI stack and writes internal/app/BENCH.md.
Command appbench measures the GUI stack and writes internal/app/BENCH.md.
compositor
Package compositor stitches the chrome layer, the page texture and an optional alpha overlay into one RGBA frame.
Package compositor stitches the chrome layer, the page texture and an optional alpha overlay into one RGBA frame.
headless
Package headless is a shell.Window that has no display: it applies each Present(frame, damage) to an in-memory "screen", records timing, and replays scripted input events.
Package headless is a shell.Window that has no display: it applies each Present(frame, damage) to an in-memory "screen", records timing, and replays scripted input events.
omnibox
Package omnibox classifies address-bar input and produces ranked suggestions from history, bookmarks, open tabs and search templates.
Package omnibox classifies address-bar input and produces ranked suggestions from history, bookmarks, open tabs and search templates.
privacy
Package privacy implements Sweef's built-in tracker/ad blocking policy: a compact domain blocklist, first-party/third-party classification, HTTPS upgrade, referrer trimming, GPC/DNT headers and third-party cookie filtering.
Package privacy implements Sweef's built-in tracker/ad blocking policy: a compact domain blocklist, first-party/third-party classification, HTTPS upgrade, referrer trimming, GPC/DNT headers and third-party cookie filtering.
state
Package state is the browser's in-memory model: windows, tabs, per-window active tab, ordering, the closed-tab stack and per-tab navigation history.
Package state is the browser's in-memory model: windows, tabs, per-window active tab, ordering, the closed-tab stack and per-tab navigation history.
store
Package store holds every persistent (or deliberately non-persistent) piece of browser data: history, bookmarks, downloads, settings, session, site permissions, top sites and usage stats.
Package store holds every persistent (or deliberately non-persistent) piece of browser data: history, bookmarks, downloads, settings, session, site permissions, top sites and usage stats.
Package audioout is the audio output layer of the browser: a mixer with a clocked output device behind it.
Package audioout is the audio output layer of the browser: a mixer with a clocked output device behind it.
Package capture defines the device-independent contract between media sources (cameras, microphones, screen and tab capture, synthetic test sources) and the code that consumes them (getUserMedia/getDisplayMedia tracks, WebRTC senders, MediaRecorder).
Package capture defines the device-independent contract between media sources (cameras, microphones, screen and tab capture, synthetic test sources) and the code that consumes them (getUserMedia/getDisplayMedia tracks, WebRTC senders, MediaRecorder).
avf
Package avf is the macOS capture backend (AVFoundation cameras and microphones through purego's Objective-C runtime).
Package avf is the macOS capture backend (AVFoundation cameras and microphones through purego's Objective-C runtime).
cmd/capdemo command
Command capdemo lists the capture devices of this machine and records from one of them, so the hardware paths can be checked without a browser:
Command capdemo lists the capture devices of this machine and records from one of them, so the hardware paths can be checked without a browser:
constraints
Package constraints solves MediaStreamConstraints against what the capture providers can really do.
Package constraints solves MediaStreamConstraints against what the capture providers can really do.
platform
Package platform registers the capture providers of the current operating system.
Package platform registers the capture providers of the current operating system.
policy
Package policy decides whether a document or frame may use camera, microphone and display capture under Permissions-Policy (the response header) and the iframe allow attribute.
Package policy decides whether a document or frame may use camera, microphone and display capture under Permissions-Policy (the response header) and the iframe allow attribute.
pulse
Package pulse is a small pure-Go client for the PulseAudio native protocol over a unix socket.
Package pulse is a small pure-Go client for the PulseAudio native protocol over a unix socket.
screen
Package screen turns "something that can hand over its current pixels" into a capture.VideoSource: the whole browser window or one tab for getDisplayMedia.
Package screen turns "something that can hand over its current pixels" into a capture.VideoSource: the whole browser window or one tab for getDisplayMedia.
synthetic
Package synthetic provides deterministic fake devices for tests, CI and demos: a test-pattern camera, a tone or noise microphone and a placeholder speaker.
Package synthetic provides deterministic fake devices for tests, CI and demos: a test-pattern camera, a tone or noise microphone and a placeholder speaker.
v4l2
Package v4l2 is a pure-Go (no cgo, no libv4l) Video4Linux2 capture provider: it enumerates /dev/video*, lists formats, sizes and frame intervals with the VIDIOC_ENUM_* ioctls, and streams with memory-mapped buffers.
Package v4l2 is a pure-Go (no cgo, no libv4l) Video4Linux2 capture provider: it enumerates /dev/video*, lists formats, sizes and frame intervals with the VIDIOC_ENUM_* ioctls, and streams with memory-mapped buffers.
wincap
Package wincap is the Windows capture backend (Media Foundation cameras, WASAPI microphones).
Package wincap is the Windows capture backend (Media Foundation cameras, WASAPI microphones).
Package dbus is a small pure-Go client of the D-Bus message bus: the wire format (marshalling per the D-Bus specification), the EXTERNAL authentication, method calls, signal delivery and serving method calls.
Package dbus is a small pure-Go client of the D-Bus message bus: the wire format (marshalling per the D-Bus specification), the EXTERNAL authentication, method calls, signal delivery and serving method calls.
Package deps pins modules used by the rendering, canvas, WebGL and media stacks so `go mod tidy` keeps them while those packages are being built.
Package deps pins modules used by the rendering, canvas, WebGL and media stacks so `go mod tidy` keeps them while those packages are being built.
Package engine is Sweef's browser core.
Package engine is Sweef's browser core.
Package font loads fonts, resolves CSS font-family lists and provides the metrics and glyph outlines that layout (advance widths, line boxes) and rasterization (outlines) both need, from one source so they agree.
Package font loads fonts, resolves CSS font-family lists and provides the metrics and glyph outlines that layout (advance widths, line boxes) and rasterization (outlines) both need, from one source so they agree.
fonttest
Package fonttest builds small fonts for tests: a TrueType writer (so no licensed font binary has to be committed), WOFF and WOFF2 encoders and a few ready-made fonts whose glyphs are plain boxes with distinct widths and heights, which makes rendered text easy to recognise and compare.
Package fonttest builds small fonts for tests: a TrueType writer (so no licensed font binary has to be committed), WOFF and WOFF2 encoders and a few ready-made fonts whose glyphs are plain boxes with distinct widths and heights, which makes rendered text easy to recognise and compare.
gl
Package gl is a software implementation of OpenGL ES 2.0/3.0 semantics as exposed by WebGL 1 and 2: GL state machine, texture sampling, a tile based parallel rasterizer and a GLSL ES interpreter (package glsl).
Package gl is a software implementation of OpenGL ES 2.0/3.0 semantics as exposed by WebGL 1 and 2: GL state machine, texture sampling, a tile based parallel rasterizer and a GLSL ES interpreter (package glsl).
glsl
Package glsl implements a GLSL ES 1.00 / 3.00 front end (lexer, preprocessor, parser, type checker) and a closure-compiled executor for software rendering.
Package glsl implements a GLSL ES 1.00 / 3.00 front end (lexer, preprocessor, parser, type checker) and a closure-compiled executor for software rendering.
Package intl holds the data and the few natives behind the ECMAScript Intl API of Sweef's JavaScript engine (QuickJS ships no Intl): the locale tables generated from Unicode CLDR by tools/intlgen, time zone arithmetic on the embedded IANA database, and the Unicode text segmentation rules (grapheme, word, sentence).
Package intl holds the data and the few natives behind the ECMAScript Intl API of Sweef's JavaScript engine (QuickJS ships no Intl): the locale tables generated from Unicode CLDR by tools/intlgen, time zone arithmetic on the embedded IANA database, and the Unicode text segmentation rules (grapheme, word, sentence).
segment
Package segment implements the Unicode text segmentation rules of UAX #29 (grapheme clusters, words, sentences) for Intl.Segmenter.
Package segment implements the Unicode text segmentation rules of UAX #29 (grapheme clusters, words, sentences) for Intl.Segmenter.
Package mcp implements a Model Context Protocol server (2024-11-05 spec, stdio transport) that exposes the Sweef engine as agent tools.
Package mcp implements a Model Context Protocol server (2024-11-05 spec, stdio transport) that exposes the Sweef engine as agent tools.
Package media holds Sweef's pure-Go media stack: container parsers, audio decoders, frame providers and (in subpackage webaudio) the Web Audio DSP graph.
Package media holds Sweef's pure-Go media stack: container parsers, audio decoders, frame providers and (in subpackage webaudio) the Web Audio DSP graph.
av1
Package av1 is a pure-Go AV1 video decoder (AV1 Bitstream & Decoding Process Specification v1.0.0 errata 1).
Package av1 is a pure-Go AV1 video decoder (AV1 Bitstream & Decoding Process Specification v1.0.0 errata 1).
cdm
Package cdm is the key-system layer behind Encrypted Media Extensions: one Go interface that Clear Key, Widevine, PlayReady and FairPlay backends all implement, so the EME JavaScript layer (MediaKeySystemAccess, MediaKeys, MediaKeySession) can drive every key system the same way.
Package cdm is the key-system layer behind Encrypted Media Extensions: one Go interface that Clear Key, Widevine, PlayReady and FairPlay backends all implement, so the EME JavaScript layer (MediaKeySystemAccess, MediaKeys, MediaKeySession) can drive every key system the same way.
cdm/fairplay
Package fairplay is the FairPlay Streaming key system (com.apple.fps) on macOS, backed by AVFoundation's AVContentKeySession, driven from Go through the Objective-C runtime with purego (no cgo).
Package fairplay is the FairPlay Streaming key system (com.apple.fps) on macOS, backed by AVFoundation's AVContentKeySession, driven from Go through the Objective-C runtime with purego (no cgo).
cdm/platform
Package platform assembles the key system registry for the running operating system: Clear Key everywhere, Widevine through the separate CDM host helper wherever a Widevine CDM is installed, PlayReady on Windows and FairPlay on macOS (both unverified and opt-in, see their packages).
Package platform assembles the key system registry for the running operating system: Clear Key everywhere, Widevine through the separate CDM host helper wherever a Widevine CDM is installed, PlayReady on Windows and FairPlay on macOS (both unverified and opt-in, see their packages).
cdm/playready
Package playready is the PlayReady (com.microsoft.playready) key system on Windows, backed by the PlayReady CDM that ships with Windows through Media Foundation's content decryption module interfaces (IMFContentDecryptionModuleFactory / Access / IMFContentDecryptionModule / Session, mfmediaengine.h and mfcontentdecryptionmodule.h of the Windows SDK), called from Go through COM vtables with golang.org/x/sys/windows.
Package playready is the PlayReady (com.microsoft.playready) key system on Windows, backed by the PlayReady CDM that ships with Windows through Media Foundation's content decryption module interfaces (IMFContentDecryptionModuleFactory / Access / IMFContentDecryptionModule / Session, mfmediaengine.h and mfcontentdecryptionmodule.h of the Windows SDK), called from Go through COM vtables with golang.org/x/sys/windows.
cdm/widevinehost
Package widevinehost hosts a Chromium-ABI Content Decryption Module (the Widevine CDM shared library) from pure Go, without cgo.
Package widevinehost hosts a Chromium-ABI Content Decryption Module (the Widevine CDM shared library) from pure Go, without cgo.
h264
Package h264 is a pure-Go H.264/AVC decoder for 8-bit 4:2:0 progressive video: Baseline, Main and High profiles with CAVLC or CABAC, I/P/B slices, multiple reference frames, weighted prediction, 8x8 transform and the in-loop deblocking filter.
Package h264 is a pure-Go H.264/AVC decoder for 8-bit 4:2:0 progressive video: Baseline, Main and High profiles with CAVLC or CABAC, I/P/B slices, multiple reference frames, weighted prediction, 8x8 transform and the in-loop deblocking filter.
hevc
Package hevc is a pure-Go HEVC / H.265 video decoder (ITU-T H.265): Main, Main 10, Main Still Picture, the range extensions (4:0:0 to 4:4:4, 8 to 16 bit samples, extended precision processing, CABAC bypass alignment), the screen content coding extensions (palette mode, current picture referencing, adaptive colour transform, adaptive motion vector resolution) and multilayer streams with inter-layer prediction (MV-HEVC: any layer can be selected with SetOutputLayer, the base layer by default).
Package hevc is a pure-Go HEVC / H.265 video decoder (ITU-T H.265): Main, Main 10, Main Still Picture, the range extensions (4:0:0 to 4:4:4, 8 to 16 bit samples, extended precision processing, CABAC bypass alignment), the screen content coding extensions (palette mode, current picture referencing, adaptive colour transform, adaptive motion vector resolution) and multilayer streams with inter-layer prediction (MV-HEVC: any layer can be selected with SetOutputLayer, the base layer by default).
vp8
Package vp8 is a complete VP8 video decoder (RFC 6386): key frames and inter frames with motion compensation, golden and altref references, segmentation, probability updates and both loop filters.
Package vp8 is a complete VP8 video decoder (RFC 6386): key frames and inter frames with motion compensation, golden and altref references, segmentation, probability updates and both loop filters.
vp8enc
Package vp8enc is a pure Go VP8 video encoder (RFC 6386) for real-time use.
Package vp8enc is a pure Go VP8 video encoder (RFC 6386) for real-time use.
vp9
Package vp9 is a pure-Go VP9 video decoder following the VP9 Bitstream & Decoding Process Specification v0.6: profile 0 (8-bit 4:2:0) with all intra and inter tools (compound prediction, scaled references, segmentation, tiles, loop filter, backward probability adaptation).
Package vp9 is a pure-Go VP9 video decoder following the VP9 Bitstream & Decoding Process Specification v0.6: profile 0 (8-bit 4:2:0) with all intra and inter tools (compound prediction, scaled references, segmentation, tiles, loop filter, backward probability adaptation).
wavefront
Package wavefront is the progress counter that the row-parallel loop filters of the video decoders wait on: row r of a picture may process unit c once row r-1 has finished unit c+1 or so.
Package wavefront is the progress counter that the row-parallel loop filters of the video decoders wait on: row r of a picture may process unit c once row r-1 has finished unit c+1 or so.
webaudio
Package webaudio implements the Web Audio rendering graph in pure Go: nodes, AudioParam automation, channel mixing and the DSP kernels.
Package webaudio implements the Web Audio rendering graph in pure Go: nodes, AudioParam automation, channel mixing and the DSP kernels.
yuv
Package yuv defines the planar picture type shared by the pure-Go video decoders for formats that image.YCbCr cannot hold: sample depths above 8 bits, 4:0:0 and the less common chroma layouts.
Package yuv defines the planar picture type shared by the pure-Go video decoders for formats that image.YCbCr cannot hold: sample depths above 8 bits, 4:0:0 and the less common chroma layouts.
Package mediarec is the engine behind MediaRecorder: it takes live audio chunks and video frames, encodes them (Opus, VP8), packs them into a streamable container (WebM or Ogg) and hands out byte chunks that, concatenated, form a valid file.
Package mediarec is the engine behind MediaRecorder: it takes live audio chunks and video frames, encodes them (Opus, VP8), packs them into a streamable container (WebM or Ogg) and hands out byte chunks that, concatenated, form a valid file.
Package net is Sweef's document + network layer: HTML5 parsing into a stable node tree, CSS selector matching, form modelling, HAR records and route interception.
Package net is Sweef's document + network layer: HTML5 parsing into a stable node tree, CSS selector matching, form modelling, HAR records and route interception.
Package notify delivers web notifications to the operating system and reports what the user did with them.
Package notify delivers web notifications to the operating system and reports what the user did with them.
Package pdf renders structured text lines into a minimal, valid PDF 1.4 document using only the standard library.
Package pdf renders structured text lines into a minimal, valid PDF 1.4 document using only the standard library.
Package protocol implements Sweef's wire format: a length-prefixed, JSON-RPC-2.0 compatible framing that is deliberately close enough to the Chrome DevTools Protocol (CDP) that existing CDP clients can attach with minimal shimming, while staying tiny and streaming-friendly.
Package protocol implements Sweef's wire format: a length-prefixed, JSON-RPC-2.0 compatible framing that is deliberately close enough to the Chrome DevTools Protocol (CDP) that existing CDP clients can attach with minimal shimming, while staying tiny and streaming-friendly.
Package pushd is a small self-hostable Web Push relay.
Package pushd is a small self-hostable Web Push relay.
Package raster is a pure-Go software 2D rasterizer: anti-aliased path filling and stroking, gradients, patterns, compositing, blur, filters, text and a display-list painter (Paint) for internal/render.
Package raster is a pure-Go software 2D rasterizer: anti-aliased path filling and stroking, gradients, patterns, compositing, blur, filters, text and a display-list painter (Paint) for internal/render.
Package render turns an HTML document plus stylesheets into geometry and a display list: CSS cascade and computed values, box-model layout (block, inline, inline-block, flex, grid, table, float, positioned), text shaping with real font metrics, and paint operations.
Package render turns an HTML document plus stylesheets into geometry and a display list: CSS cascade and computed values, box-model layout (block, inline, inline-block, flex, grid, table, float, positioned), text shaping with real font metrics, and paint operations.
Package rpc exposes the engine over JSON-RPC.
Package rpc exposes the engine over JSON-RPC.
Package rtcmedia is the media half of WebRTC for Sweef: it turns raw capture frames and PCM into RTP (VP8 and Opus, with the feedback machinery real services expect) and RTP back into decoded frames and PCM.
Package rtcmedia is the media half of WebRTC for Sweef: it turns raw capture frames and PCM into RTP (VP8 and Opus, with the feedback machinery real services expect) and RTP back into decoded frames and PCM.
audioproc
Package audioproc is the voice processing of a call: acoustic echo cancellation (a partitioned-block frequency domain adaptive filter with delay tracking and a residual echo suppressor), noise suppression (spectral gain with a minimum-statistics noise estimate) and automatic gain control.
Package audioproc is the voice processing of a call: acoustic echo cancellation (a partitioned-block frequency domain adaptive filter with delay tracking and a residual echo suppressor), noise suppression (spectral gain with a minimum-statistics noise estimate) and automatic gain control.
testsrc
Package testsrc provides deterministic synthetic capture sources for tests and for the engine's fake devices: a moving test pattern with a frame counter drawn into the picture, and a sine tone.
Package testsrc provides deterministic synthetic capture sources for tests and for the engine's fake devices: a moving test pattern with a frame counter drawn into the picture, and a sine tone.
Package shell is the thin native-window layer under the Sweef GUI.
Package shell is the thin native-window layer under the Sweef GUI.
auto
Package auto opens the native window shell for the current OS: X11 on Linux, Win32 on Windows, Cocoa on macOS.
Package auto opens the native window shell for the current OS: X11 on Linux, Win32 on Windows, Cocoa on macOS.
cocoa
Package cocoa is the macOS native window shell: pure Go (no CGO) over the Objective-C runtime and CoreGraphics through github.com/ebitengine/purego.
Package cocoa is the macOS native window shell: pure Go (no CGO) over the Objective-C runtime and CoreGraphics through github.com/ebitengine/purego.
evqueue
Package evqueue is the unbounded, coalescing event queue every native shell uses between its OS event loop and the consumer.
Package evqueue is the unbounded, coalescing event queue every native shell uses between its OS event loop and the consumer.
keymap
Package keymap holds the OS-independent tables and helpers the native shells share: X11 keysym, evdev, Windows virtual-key and macOS keyCode translation to DOM KeyboardEvent key/code names, UTF-16 helpers and DPI math.
Package keymap holds the OS-independent tables and helpers the native shells share: X11 keysym, evdev, Windows virtual-key and macOS keyCode translation to DOM KeyboardEvent key/code names, UTF-16 helpers and DPI math.
mainthread
Package mainthread pins the Go program's main goroutine to the process main thread and lets the rest of the program run on goroutines while the OS UI loop owns that thread.
Package mainthread pins the Go program's main goroutine to the process main thread and lets the rest of the program run on goroutines while the OS UI loop owns that thread.
pixconv
Package pixconv converts the premultiplied RGBA frames the compositor produces into the pixel layouts native window systems want.
Package pixconv converts the premultiplied RGBA frames the compositor produces into the pixel layouts native window systems want.
x11
Package x11 is the Linux native window shell: a pure-Go X11 client that speaks the wire protocol directly (no Xlib, no CGO).
Package x11 is the Linux native window shell: a pure-Go X11 client that speaks the wire protocol directly (no Xlib, no CGO).
x11/cmd/shelldemo command
Command shelldemo animates frames into an X11 shell window and prints the achieved Present throughput and latency at a given size, for full-frame and partial-damage updates.
Command shelldemo animates frames into an X11 shell window and prints the achieved Present throughput and latency at a given size, for full-frame and partial-damage updates.
Package style implements the CSS side of Sweef's renderer: parsing of stylesheets, selector matching (via internal/net), the cascade, inheritance and computed values for the properties that affect layout and paint, plus a Chromium-faithful user-agent stylesheet.
Package style implements the CSS side of Sweef's renderer: parsing of stylesheets, selector matching (via internal/net), the cascade, inheritance and computed values for the properties that affect layout and paint, plus a Chromium-faithful user-agent stylesheet.
ui
Package ui embeds Sweef's own browser UI: the chrome page, the overlay, the new tab page, onboarding and the internal pages (settings, history, ...).
Package ui embeds Sweef's own browser UI: the chrome page, the overlay, the new tab page, onboarding and the internal pages (settings, history, ...).
cmd/uipreview command
Command uipreview renders every Sweef UI page through the real engine and writes PNG previews.
Command uipreview renders every Sweef UI page through the real engine and writes PNG previews.
preview
Package preview renders every Sweef UI page through the real Sweef engine (the same Tab and paintPage path that `sweef screenshot` uses) with a mocked window.sweef and sample state.
Package preview renders every Sweef UI page through the real Sweef engine (the same Tab and paintPage path that `sweef screenshot` uses) with a mocked window.sweef and sample state.
Package update implements the verification side of the Sweef auto-updater: a signed release manifest (ed25519), resumable checksum-verified downloads, and a staged binary replacement with rollback.
Package update implements the verification side of the Sweef auto-updater: a signed release manifest (ed25519), resumable checksum-verified downloads, and a staged binary replacement with rollback.
Package webpush holds the client-side building blocks of Web Push that do not depend on any push service: message encryption (RFC 8188 aes128gcm content coding as profiled by RFC 8291) and VAPID application server identification (RFC 8292).
Package webpush holds the client-side building blocks of Web Push that do not depend on any push service: message encryption (RFC 8188 aes128gcm content coding as profiled by RFC 8291) and VAPID application server identification (RFC 8292).
autopush
Package autopush is a client of the open autopush WebSocket protocol (the one Mozilla's push service speaks), implementing webpush.Transport.
Package autopush is a client of the open autopush WebSocket protocol (the one Mozilla's push service speaks), implementing webpush.Transport.
Package zpack holds the compact form of the data that travels inside the Sweef binary: JavaScript preludes, the chrome UI assets, the IANA time zone database.
Package zpack holds the compact form of the data that travels inside the Sweef binary: JavaScript preludes, the chrome UI assets, the IANA time zone database.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL