Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HumanSignal

Detect AI-generated posts and comments on LinkedIn — entirely on your device.
No data ever leaves your browser.

MV3 TMR Tests Version


How it works

HumanSignal injects small signal stickers onto LinkedIn posts and comments. Each sticker shows a confidence label — Feels Human, Possibly AI, Likely AI, or Almost Certainly AI — derived from two on-device models running in parallel:

Engine What it does
Rules engine Fast, deterministic scoring based on linguistic patterns (specificity, engagement bait, listicle structure, etc.). Result appears instantly.
TMR detector RoBERTa-Q4 ONNX model fine-tuned for AI text detection. Runs locally in an offscreen worker. Upgrades the sticker label when complete.

Both engines run entirely in the browser. No text is sent to any server.


Development setup

Prerequisites: Node.js 22+, pnpm 11+

git clone https://github.com/z26zheng/HumanSignal.git
cd HumanSignal/human-signal

# Install deps + automatically fetch the bundled TMR model (~202 MB) and ORT wasm
pnpm install

# Start the dev server with hot-reload
pnpm dev

Then load .output/chrome-mv3 as an unpacked extension in chrome://extensions.


Commands

pnpm compile          # TypeScript type-check
pnpm test             # Unit tests (Vitest) — 381 tests
pnpm build            # Production build → .output/chrome-mv3/
pnpm zip              # Package for Chrome Web Store → .output/*.zip
pnpm fetch-assets     # Re-fetch TMR model and ORT wasm manually (runs automatically on install)

Project structure

human-signal/
├── src/
│   ├── entrypoints/        # background SW, content script, popup, offscreen
│   ├── tmr/                # TmrService — RoBERTa ONNX pipeline
│   ├── rules-engine/       # Deterministic text classifier
│   ├── scoring-coordinator/ # Orchestrates rules + TMR, caching, telemetry
│   ├── overlay/            # Signal stickers, popovers, debug pills
│   ├── linkedin-adapter/   # DOM extraction and page-type detection
│   └── shared/             # Types, messaging, storage, event tracing
├── public/
│   ├── icon/               # Extension icons (16–128px)
│   ├── models/             # Bundled TMR model (gitignored, fetched on install)
│   └── ort/                # ORT wasm runtime (gitignored, copied on install)
├── scripts/
│   ├── fetch-assets.ts     # Downloads model + copies ORT wasm
│   └── check-package-size.ts
└── assets/
    └── logo-concepts/      # Brand assets and icon exports

Architecture

LinkedIn page (content script)
    │  DOM extraction → ExtractedItem
    ▼
Background service worker
    │  Rules engine (sync, instant)
    │  TMR queue (async, sequential)
    ▼
Offscreen document
    │  TmrService — @huggingface/transformers + ONNX Runtime Web
    ▼
Background → Content script
    │  ScoringResult (label + confidence + source)
    ▼
Overlay controller → Signal sticker update

Release

The GitHub Actions CD pipeline builds, zips, and uploads to the Chrome Web Store automatically on every push to main, using secrets stored in the repository settings (CWS_EXTENSION_ID, CWS_CLIENT_ID, CWS_CLIENT_SECRET, CWS_REFRESH_TOKEN).

# Manual release
pnpm build && pnpm zip
chrome-webstore-upload upload --source .output/human-signal-1.0.0.0-chrome.zip --auto-publish

Built with WXT · Preact · Transformers.js · ONNX Runtime Web

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages