{"id":50595830,"url":"https://github.com/rogerchappel/bargekit","last_synced_at":"2026-06-05T14:01:30.370Z","repository":{"id":362374011,"uuid":"1226249620","full_name":"rogerchappel/bargekit","owner":"rogerchappel","description":"Local-first VAD, barge-in, and turn-taking primitives for interruptible voice agents.","archived":false,"fork":false,"pushed_at":"2026-06-03T22:15:06.000Z","size":71,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-04T00:09:09.873Z","etag":null,"topics":["agents","barge-in","duplex","echo-guard","local-first","microphone","speech-detection","turn-taking","vad","voice-agent","voice-ui"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rogerchappel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-01T06:37:15.000Z","updated_at":"2026-05-03T08:48:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rogerchappel/bargekit","commit_stats":null,"previous_names":["rogerchappel/bargekit"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/rogerchappel/bargekit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogerchappel%2Fbargekit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogerchappel%2Fbargekit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogerchappel%2Fbargekit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogerchappel%2Fbargekit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rogerchappel","download_url":"https://codeload.github.com/rogerchappel/bargekit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogerchappel%2Fbargekit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33944671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agents","barge-in","duplex","echo-guard","local-first","microphone","speech-detection","turn-taking","vad","voice-agent","voice-ui"],"created_at":"2026-06-05T14:01:28.988Z","updated_at":"2026-06-05T14:01:30.364Z","avatar_url":"https://github.com/rogerchappel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bargekit\n\nBargeKit is a local-first turn-taking SDK for voice agents — the tiny harbor pilot that keeps agent audio from smashing into the dock.\n\nIt focuses on the messy parts that make voice products feel natural instead of brittle:\n\n- voice activity detection gates\n- barge-in / interruption requests\n- half-duplex and mute state\n- output duck/cancel hooks for playback stacks such as VoicePath\n- AgentPulse-friendly events for UI and telemetry\n- browser microphone sampling with explicit opt-in only\n- synthetic fixtures for repeatable tuning and regression tests\n\n## Status\n\nV1 is a working foundation aimed at demos, local prototypes, and integration spikes.\n\nWhat it does well right now:\n\n- deterministic level-driven state engine\n- synthetic verification for speech, noise, echo-ish paths, and interruption timing\n- browser microphone adapter with explicit permission flow\n- static demo UI for live mic and synthetic playback modes\n\nWhat it does **not** promise yet:\n\n- enterprise-grade echo cancellation\n- STT or TTS\n- covert/background recording\n- perfect cross-device tuning out of the box\n\n## Install\n\n```sh\nnpm install @bargekit/core\n```\n\n## Quick start\n\n```js\nimport { createBargeKit, createOutputDuckingController } from '@bargekit/core';\n\nconst barge = createBargeKit({\n  mode: 'vad',\n  speechThreshold: 0.58,\n  noiseFloorThreshold: 0.18,\n  minSpeechMs: 120,\n  silenceMs: 450,\n  debounceMs: 80,\n  bargeIn: {\n    enabled: true,\n    whileAgentSpeaking: true,\n    cancelOutput: true,\n    duckOutput: true\n  }\n});\n\nconst ducking = createOutputDuckingController({\n  onInterrupt: () =\u003e voicepath.interrupt(),\n  onDuck: () =\u003e voicepath.duck()\n});\n\nducking.attach(barge);\n\nbarge.on('bargekit.user_speech.started', (event) =\u003e {\n  console.log('user started speaking', event);\n});\n\nbarge.on('bargekit.barge_in.requested', () =\u003e {\n  console.log('interrupt the agent now');\n});\n\nbarge.start();\nbarge.setAgentSpeaking(true);\nbarge.ingestLevel({ timestamp: Date.now(), level: 0.81 });\n```\n\n## Packages / modules\n\nEverything currently ships from one package with a few focused entry surfaces:\n\n- `src/core.js` — deterministic state engine\n- `src/fixtures.js` — synthetic audio fixtures + tuning reports\n- `src/web.js` — browser microphone/analyser adapter\n- `src/integrations.js` — VoicePath duck/cancel hooks + AgentPulse bridge\n- `demo/` — local static demo UI\n\n## CLI\n\n```sh\nbargekit fixtures --json\nbargekit tune --fixture tests/fixtures/long_utterance.json --json\nbargekit smoke --fixture tests/fixtures/interruption_timing.json --json\nbargekit demo\n```\n\nThe CLI uses synthetic/local fixture data only; it does not open a microphone.\n\n## Demo\n\nRun a local static server from the repo root, then open `demo/`.\n\n```sh\npython3 -m http.server 4173\n```\n\nThen visit \u003chttp://localhost:4173/demo/\u003e.\n\nDemo features:\n\n- live microphone mode with explicit permission request\n- synthetic fixture playback mode\n- preset profiles for laptop speakers, headset, and quiet-room tuning\n- push-to-talk, VAD, wake-hook, and half-duplex modes\n- visible interruption / ducking event log\n\n## Privacy and platform posture\n\n- Audio stays local by default.\n- The web adapter only accesses the microphone after an explicit user action.\n- There are no hidden network calls in the core, web adapter, or demo.\n- Browser/device echo behavior varies. BargeKit exposes policy hooks and state honestly; it does not claim to solve acoustic echo cancellation universally.\n\nMore detail: [docs/PRIVACY_PLATFORM_GUIDE.md](docs/PRIVACY_PLATFORM_GUIDE.md)\n\n## Tuning workflow\n\nUse the synthetic fixtures first, then validate with real hardware paths.\n\nBuilt-in fixture coverage:\n\n- quiet room baseline\n- keyboard noise\n- short utterance\n- long utterance\n- speaker echo pressure\n- interruption timing\n\nBuilt-in presets:\n\n- `laptop_speakers`\n- `wired_headset`\n- `quiet_room`\n\n## VoicePath + AgentPulse integration\n\n- Subscribe to `bargekit.output.cancel_requested` or `bargekit.output.duck_requested` to interrupt playback.\n- Use `createOutputDuckingController()` to avoid resuming stale agent turns.\n- Use `createAgentPulseBridge()` to translate speech/mute/noise/duplex events into an AgentPulse-style stream.\n- `reduceAgentGlowState()` turns those events into a simple listening/speaking/interrupted UI reducer.\n\n## Verification\n\n```sh\nnpm run check\nnpm test\nnpm run typecheck\nnpm run build\nbash scripts/validate.sh\n```\n\n## Documentation\n\n- [Turn-taking state machine contract](docs/TURN_TAKING_STATE_MACHINE.md)\n- [Privacy + platform guide](docs/PRIVACY_PLATFORM_GUIDE.md)\n- [Real-world quality pass](docs/REAL_WORLD_QUALITY_PASS.md)\n- [Safety posture](SAFETY.md)\n- [CLI reference](docs/CLI.md)\n- [Examples](examples/README.md)\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## Security\n\nSee [SECURITY.md](SECURITY.md).\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frogerchappel%2Fbargekit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frogerchappel%2Fbargekit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frogerchappel%2Fbargekit/lists"}