How cyojkoy/aigithubingest works
AiGithubIngest is a browser extension and standalone web UI that turns a pasted GitHub URL into a filtered, size-bounded repository digest for an AI chat. The main path is paste interception → policy and URL checks → background ingest → GitHub archive parsing → digest delivery as native attachments or pseudo-files. The graph preserves the popup configuration and site-specific upload adapters. Some subsystems are represented by their exact directories because their individual source was not sampled; edges are limited to relationships shown in excerpts, the source index, or README.
Main entry points: paste-handler.ts Paste interception · ingest.ts Ingest orchestrator · pseudo-file-engine.ts Pseudo-file lifecycle · submit-interceptor.ts Send interception
Components 26
Page Capture
- Paste interception
src/content/paste-handler.ts - Site policy
src/core/policy.ts - Page resolution
src/content/policy-resolver.ts - Ingest guard
src/core/ingest-guard.ts
Repository Ingest
- Background worker
src/background/index.ts - Ingest orchestrator
src/core/ingest.ts - GitHub access
src/core/github-engine.ts - URL parser
src/core/parser.ts - File filtering
src/core/file-filter.ts - Tree builder
src/core/tree-builder.ts - Digest formatter
src/core/output-formatter.ts - Token estimator
src/core/token-estimator.ts
Chat Delivery
- Native upload adapters
src/dom/adapters - Editor orchestrator
src/dom/universal-editor.ts - Editor writer
src/dom/editor-writer.ts - Pseudo-file lifecycle
src/pseudo/pseudo-file-engine.ts - Payload registry
src/pseudo/pseudo-file-manager.ts - Metadata cards
src/pseudo/pseudo-file-renderer.ts - Send interception
src/pseudo/submit-interceptor.ts
Settings
- Settings cache
src/content/storage-cache.ts - Popup settings
src/popup - Browser sync storage
- Standalone UI
src/main.ts
Other components
- Chat user
- AI chat page
- GitHub API / Codeload
Connections 35
- Chat user → AI chat page: pastes URL
- AI chat page → Paste interception: fires paste
- Paste interception → Site policy: checks access
src/content/paste-handler.ts - Paste interception → URL parser: parses URL
src/content/paste-handler.ts - Paste interception → Page resolution: resolves editor
src/content/paste-handler.ts - Paste interception → Settings cache: reads config
src/content/paste-handler.ts - Paste interception → Ingest guard: acquires lock
src/content/paste-handler.ts - Paste interception → Background worker: requests ingest
src/background/index.ts - Background worker → Ingest orchestrator: calls ingest
src/background/index.ts - Ingest orchestrator → URL parser: parses repository
src/core/ingest.ts - Ingest orchestrator → GitHub access: resolves branch
src/core/ingest.ts - GitHub access → GitHub API / Codeload: fetches archive
- Ingest orchestrator → GitHub API / Codeload: downloads zipball
- Ingest orchestrator → File filtering: filters files
src/core/ingest.ts - Ingest orchestrator → Tree builder: builds tree
src/core/ingest.ts - Ingest orchestrator → Digest formatter: formats digest
src/core/ingest.ts - Ingest orchestrator → Token estimator: estimates tokens
src/core/ingest.ts - Background worker → Paste interception: returns result
- Paste interception → Digest formatter: splits output
src/content/paste-handler.ts - Paste interception → Pseudo-file lifecycle: mounts pseudo-files
src/content/paste-handler.ts - Pseudo-file lifecycle → Payload registry: registers payloads
src/pseudo/pseudo-file-engine.ts - Pseudo-file lifecycle → Metadata cards: renders cards
src/pseudo/pseudo-file-engine.ts - Pseudo-file lifecycle → Send interception: attaches submit hook
src/pseudo/pseudo-file-engine.ts - Paste interception → Editor orchestrator: uploads real files
src/content/paste-handler.ts - Editor orchestrator → Native upload adapters: dispatches upload
src/dom/universal-editor.ts - Editor orchestrator → Editor writer: writes editor text
src/dom/universal-editor.ts - Send interception → Payload registry: reads payloads
src/pseudo/submit-interceptor.ts - Send interception → Metadata cards: removes cards
src/pseudo/submit-interceptor.ts - Send interception → Editor writer: splices prompt
src/pseudo/submit-interceptor.ts - Popup settings → Browser sync storage: saves settings
src/popup/storage-service.ts - Settings cache → Browser sync storage: loads changes
src/content/storage-cache.ts - Popup settings → Site policy: configures policy
src/popup/site-policy-view.ts - Chat user → Popup settings: configures options
- Chat user → Standalone UI: submits URL
- Standalone UI → Ingest orchestrator: runs ingest
src/main.ts