How to check a change, and where things are. CONTRIBUTING.md says how to send one.
npm test # unit tests, plus an end-to-end test of the MCP channel
npm run typecheck
npm run check-name # how a name does on the sample meeting lines (see docs/choosing-a-name.md)
npm run check-package # what npm would publish: exactly test/fixtures/package-files.txt, each file tracked by git
npm run test:package # packs the package, installs it in a folder of its own, and runs the installed commandnpm test always runs as Alex, with Alex's own spellings and mishearings, for an owner called Sam with no company, an empty profile (test/fixtures/no-profile.md), the default bot page, the speaker probe off, presenting off on every platform (SLIDES_PLATFORMS empty), the channel as Claude Code's (AGENTVOICE_CLIENT empty), no AGENTVOICE_HOME (a clone ignores it anyway) and a new temporary data folder (ALEX_DATA_DIR), whatever .env and your shell say, so your own settings never change what the tests check. test/private-terms.test.ts checks every file git would commit, the README included, for a macOS home folder, a link into a claude.ai account or an email address, and for the terms on your own private list, if you have one: your name, company, hostnames, whatever must never be published. That list is never in the repository: put one term per line (or a /regular expression/, and # comments; a line starting with ! is a whole line that may stay exactly as written, such as !Copyright 2026 Your Company Ltd for the copyright line in LICENSE and NOTICE, while every other line naming your company is still checked) in private-terms.txt in the repository's root folder, which is gitignored, or in a file elsewhere that PRIVATE_TERMS_FILE names. Without one, that part is skipped, with a note saying so. Both checks also cover file names, symbolic link targets, what the index holds when it differs from the work tree, and the text in binary and UTF-16 files (see test/private-terms.ts). test/name-corpus.test.ts reads every line of the name corpus with Alex and checks it gives exactly the recorded results, so any change to the attention, leave or cancel rules shows up there; it also reads them with other names and checks they give the same results. After a change to those rules that is meant to change results, record them again with npm run record-name-corpus and review the diff of test/fixtures/name-corpus.json line by line.
The tests use fakes for Deepgram, ElevenLabs, Claude and Recall. The slides tests make their PDFs at test time (test/fixtures/slides/make-pdf.ts, with one tiny committed JPEG2000 image), and run the real converter on them; test/fixtures/slides/fake-child.ts stands in for it where a test needs a child that hangs, or says something malformed. The real test of those integrations is npm run check with real keys, then a real meeting. For the coding clients, test/fixtures/claude-code/ pins what the channel tells Claude Code; test/agent-floor.test.ts checks that the three meeting-assistants share one body and that the three floors deny the same example files, reading each the way its client does (test/client-floors.ts, and test/toml.ts for Codex's files); and test/codex-config.test.ts, test/opencode-config.test.ts and test/push-opencode.test.ts check each client's config, its setup script (with a stand-in client) and OpenCode's push, against a fake OpenCode service. The real Codex and OpenCode were checked by hand, with a stand-in model (Codex, OpenCode). The two modes are tested apart: a clone, as before (test/clone-mode.test.ts runs a copy of the repository with AGENTVOICE_HOME set, and checks nothing moves), and installed from npm (test/installed-mode.test.ts, test/dispatcher.test.ts, test/init.test.ts, test/setup-files.test.ts, test/setup-cli.test.ts and test/service-units.test.ts run the code from a package laid out as npm install -g makes it, test/layouts.ts, with stand-in claude, codex and opencode). test/command-words.test.ts keeps every message that names a command, .env or a docs page going through src/commands.ts, so a clone's words stay as they were. test/package-files.test.ts checks npm run check-package itself, and test/release-workflow.test.ts checks .github/workflows/release.yml (read with test/yaml.ts) and runs its scripts with a stand-in npm. npm run test:package (test/package/install.test.ts, in CI's package job and in the release) installs the real tarball with npm into a prefix, home and temporary folder of its own, then runs init, start, the channel, slides prepare, check-name, service print and every setup from it, twice (once with AGENTVOICE_HOME), checks that the command never uses tsx's cache folders in the temp folder, and that nothing is written into the installed package. npm run flux-probe measures, with real keys, what Deepgram Flux does with backchannels, noise and the end of a stream, to tune the pausing and stopping constants (see Measuring Deepgram Flux). npm run join -- "<link>" --share-test checks, in a test meeting you host, whether the camera page keeps running while the bot shares a screen (see Testing a screen share).
| Path | What it does |
|---|---|
bin/agentvoice.js |
The agentvoice command npm links (package.json's bin): plain JavaScript, since Node won't strip types under node_modules. It needs Node 24, has tsx keep compiled code in memory only (never in the temp folder), registers tsx in its own process and runs src/cli/agentvoice.ts |
src/home.ts |
The two modes: the package's folder (ROOT in a clone), whether it is installed (it sits in node_modules/@zgentic/agentvoice) or a clone (anything else, npm link included), and the owner's folder: the clone, or ~/.agentvoice or AGENTVOICE_HOME installed. src/env.ts reads .env from the owner's folder |
src/commands.ts |
How a message names a command (npm run join, or agentvoice join), the settings file (.env, or its real place) and a docs page (docs/x.md, or that page of the running version on GitHub), in each mode |
src/cli/agentvoice.ts |
The dispatcher: --version, --help, help <command>, and each command's module, run with its own process.argv. In a clone, init, setup and service refuse and say the clone's way |
src/cli/init.ts |
agentvoice init: the AgentVoice folder from the examples, 0700 and 0600, never overwriting a file |
src/cli/setup.ts, src/setup/ |
agentvoice setup claude-code, codex and opencode: the session folder's rules (folder.ts), writing atomically with a record of what was written and stopping at a file you changed (files.ts), the command the configs start (node-path.ts: Node by a path that outlives an upgrade, Homebrew's opt link, and the package's bin), and each client's files from the package's templates (claude-code.ts, codex.ts, opencode.ts) |
src/cli/service.ts, src/service/units.ts |
agentvoice service install, print and uninstall: the launchd plist and the systemd unit (pure, escaped, read back), and installing, replacing and removing them |
src/cli/check-folders.ts |
What agentvoice check adds installed: the folders, their modes, examples not yet made yours, and a session folder or service set up for another version, Node or folder |
src/server.ts |
HTTP and websocket server: the public and control listeners, the agent page, /audio (its heartbeat, and a page coming back with its secret), /recall/ (the speaker probe's events, with SPEAKER_PROBE on), the share test's page, link and /api/share-test/, a meeting's slides (its deck and share, /api/slides, and the slides page's routes), /bridge, /api/join, the limits on meetings, getting bots out of their calls, and stopping in order |
src/network.ts, src/local-token.ts, src/control-socket.ts |
Who may reach what: the Origin and token checks, the local token, the data folder's permissions, and the control socket |
src/sessions.ts |
Which meeting a request from your session is for (get_transcript, add_to_brief, post_chat, why_not_answered, a late answer, and the slide controls) |
src/pipeline/session.ts |
One conversation: speech to text, deciding when to answer, pausing and stopping when talked over, speaking, and carrying on while the page is away (test/reconnect-session.test.ts) |
src/pipeline/verdicts.ts |
What Alex did with the latest lines of a meeting, and why, for why_not_answered (test/why-not-answered.test.ts): in memory only, gone with the transcript |
src/pipeline/playback.ts |
How much of each line the page had played when Alex was cut off, through pauses and drops (what a page that came back says it never got), so the transcript keeps only what was heard |
src/pipeline/deepgram.ts, tts.ts |
Deepgram Flux and ElevenLabs streaming clients. The Flux stream opens again by itself when Deepgram drops it, and says when it can't hear. With trackAudio (the speaker probe only) it keeps when each piece of audio came in, for three minutes, so audioTime() can say when a word's audio arrived |
src/pipeline/line-cache.ts |
Alex's fixed lines, made once per voice and kept in data/tts-cache, sent as fast as it speaks them |
src/brain/brain.ts |
Claude call for spoken answers and the hand-off to your session |
src/identity.ts |
The assistant's name, its spellings and mishearings, its participant-list name, and the owner and company, from .env; Alex's own lists |
src/profile.ts, profile.example.md |
The owner's profile (PROFILE_FILE, profile.md unless set): its sections, and their defaults |
src/name-check.ts, src/name-corpus.ts |
Whether the names work (checked at start-up), and how a name does on the sample meeting lines (npm run check-name) |
src/cli/check.ts |
npm run check: the names, your settings and profile, the Recall region and the bot page, the consent line and chat notice (with slides too) and the start of the rules, the speaker probe and the platforms presenting is on for, and a tiny real request to each service |
src/brain/attention.ts |
Whether a line is for Alex: spoken to by name, with a question or a request, or only talked about; and which words are only backchannels |
src/brain/text.ts |
The leave and cancel rules: when a line asks Alex to leave (strict, since leaving deletes the meeting's record) or to stop talking ("never mind") |
src/brain/additions.ts |
What your session adds to the brief during a meeting (add_to_brief, and its answers), in memory |
src/cli/slides.ts, src/cli/slides-args.ts, src/slides/actions.ts |
npm run slides: prepare, check, list and delete, and the arguments they take (Presenting slides). None needs a key or the network (test/import-graph.test.ts checks it reaches no network code) |
src/slides/detect.ts |
What a file given to prepare is, by its first bytes (a PDF, PowerPoint with or without macros, OpenDocument, Keynote, an image...), and the line that says how to export a PDF from it |
src/slides/convert.ts, src/slides/render-child.ts, src/slides/child-protocol.ts, src/slides/page-text.ts |
Turning a PDF into a deck: the parent checks the file and runs the converter child with an environment that has no API keys, kills its process group after 3 minutes, reads its JSON lines strictly, and checks the result with the loader; the child renders each page with pdf.js and @napi-rs/canvas into a 1280x720 WebP, and reads its text, title, page label and sticky notes. The child must never import env.ts or config.ts, and only it may load pdf.js or the canvas (test/import-graph.test.ts) |
src/slides/manifest.ts, src/slides/deck.ts, src/slides/sheet.ts |
A prepared deck in data/decks/<id>/: the manifest and its strict schema, the one loader everything uses (no symbolic links inside the decks folder, modes, hashes, image headers, limits), list, delete and the retention sweep, and the contact sheet |
src/slides/script.ts |
The presentation script: the parser, its errors and warnings, the check against a deck and the estimate, the canonical text (no comments) that will be sent at join, the skeleton prepare writes, and the update merge, which never changes a written paragraph |
src/slides/join.ts, src/slides/platforms.ts |
A join with slides: the script checked again against its deck and only the slides it shows read, before any bot is created; SLIDES_PLATFORMS, and the note on the platform's share setting |
src/slides/share.ts, src/slides/page.ts, public/slides.html, public/slides.js |
A meeting's slide share (ShareControl): the slides page shared as the bot's screen, its id and token, its link (/slides-link) and what goes to it (the slide on screen and its neighbours, paced), acks, stuck, contested and camera-suspect stops, the limiter; and the page itself, silent, which blanks itself without its link. src/slides/surface.ts is what the session sees of it. public/slides.d.ts only types slides.js for the tests, and is not served |
src/slides/presenter.ts, src/slides/commands.ts |
Presenting a deck from the script, word for word (test/presenter.test.ts, and test/slides-presentation.test.ts for a whole presentation through the service): the states, holds and how each resumes, the room's commands and the owner's, events for the owner, and what answers know of the slides |
src/cli/slides-control.ts, src/cli/slides-status.ts |
npm run slides -- status and control, through the control socket: loaded on their own, so prepare and check still reach no network code |
src/untrusted.ts |
Strips the tags of the blocks untrusted text goes into (the transcript, questions, brief, and a slide's text), so it can't close its block: the minutes and the brain's slides blocks use it |
src/brief.ts |
The brief's limit (16,000 characters, refused and never cut) and checks, and reading the shared brief. A meeting's own brief lives on its meeting in src/server.ts, in memory only |
src/minutes.ts |
The minutes Claude writes after a meeting |
src/transcript.ts |
The transcript files in data/transcripts, and the retention sweep of transcripts, minutes and the speaker probe's files |
src/bridge.ts, src/channel/server.ts |
The link to the coding session (the MCP channel, the same for Claude Code, Codex and OpenCode), whether Alex will say a reply or it came too late, which sessions can be sent a question (can_push) and passing on one a session can't take (no_taker), and what the service can do (SERVICE_FEATURES, sent first on every link and listed in the control /health) |
src/channel/client-text.ts |
Which client the channel serves (AGENTVOICE_CLIENT), and the parts of its instructions that differ by client: how questions and events arrive, how to start the meeting-assistant, and the file tools. What Claude Code is told is pinned in test/fixtures/claude-code/ |
src/channel/join-rule.ts |
When the session may call join_meeting: on your own request, typed in the session or, in Claude Code with ZOOM_JOIN_TELEGRAM_CHATS, from your own Telegram chats; and slides_control, or a join with slides, on your request in the session or, with those chats, from them, with the deck named in the message and a reply there naming it |
src/channel/sink.ts, src/channel/push-opencode.ts |
Putting an event into the owner's session (push), one sink per client: Claude Code's channel notification, none for Codex, and OpenCode's background service (its registration file, the owner's session, and the event as plain text) |
src/cli/join.ts, src/cli/join-args.ts, src/cli/control-call.ts |
npm run join, and the arguments it takes (--brief <file>, --slides <script> with --from <slide>, --speaker-probe, --share-test with --json <file> and --keep), and the request to the service on its control socket |
src/cli/share-test-run.ts, src/sharetest/ |
The screen-share test (Testing a screen share): the driver the join command runs, with the service, the terminal and the clock passed in (test/share-test-run.test.ts drives it against a fake service); each meeting's shares, its test page's link and its camera page's drops (share-test.ts); the page's checks and policy (page.ts); what both sides say (protocol.ts); the questions (answers.ts), the report and its verdict (report.ts), and what is taken out of everything it prints (scrub.ts) |
src/speakers/events.ts |
Reads Recall's participant events strictly, ignoring fields it doesn't know, and never throws (the speaker probe) |
src/speakers/connection.ts |
Recall's events connection for one meeting: its token, the newest connection wins, the keepalive, the rate cap, and the hand-off to the probe |
src/speakers/attribute.ts |
Who spoke a turn, from when each participant was speaking: pure, so the probe can try many settings, and speaker names can use it later |
src/speakers/probe.ts |
The speaker probe: what is kept of a name (categories and a salted hash), the turn and event timings, and the numbers-only file written as the meeting ends (Measuring who is speaking) |
src/speakers/report.ts, src/cli/speaker-report.ts |
npm run speaker-report: the probe's files pooled by platform, read only |
src/probe/, src/cli/flux-probe.ts |
npm run flux-probe: test clips made in code (flux-audio.ts), streamed to Flux as the service does with every raw message kept (flux-stream.ts), what the session's rules would do with each and the suggestions (flux-analysis.ts, pure), and the report (flux-report.ts). The tests run it against a fake Flux (test/fixtures/fake-flux.ts) |
src/channel/questions.ts, .claude/agents/meeting-assistant.md |
Hands questions to the meeting-assistant agent through next_question, else to the session, else back to the voice service as one nobody can take. The agent's body is the same in .codex/agents/ and .opencode/agents/ |
src/channel/profile-tool.ts |
get_profile: the owner's names, the brief a meeting uses (with its key: its own or the shared one, or none when it can't be had) and the profile, for the agent and the session |
.claude/settings.json, scripts/install-channel.sh |
The files no Claude Code session in this folder may read (your own go in .claude/settings.local.json), and the script that registers the channel for this folder only |
.codex/config.toml, .codex/agents/meeting-assistant.toml, scripts/install-codex.sh |
Codex: the channel, which tools ask first, the floor as a permission profile, the meeting-assistant, and the setup check, which writes nothing (Codex) |
opencode.json, .opencode/agents/meeting-assistant.md, scripts/install-opencode.sh |
OpenCode: the channel, what asks first, the floor as policies, the meeting-assistant's rules, and the script that writes your own .opencode/opencode.json (OpenCode) |
scripts/install-service.sh, scripts/agent-voice.plist, scripts/agent-voice.service |
Keeping the service running in a clone: launchd on macOS, systemd on Linux. Not in the npm package, which has agentvoice service |
src/recall.ts |
Recall.ai bot API, how a bot left its call (read again while it finishes, and after its page drops), and starting and stopping a screen share mid-call (the share test, and a meeting's slides) |
src/consent.ts |
The consent wording Alex says and posts, and the lines of a meeting with slides |
public/share-test.html |
The share test's page, which the bot shares as its screen: silent, one file, checked when the service starts |
public/, src/pages.ts |
The agent page (Alex's camera and microphone in the meeting) and its scripts: agent.js plays Alex's voice, and reconnects to the service by itself when the connection drops (createLink, tested on fake connections and timers); agent.d.ts only types agent.js for the tests, and is not served. The server puts the names in the page, and checks a page of your own (AGENT_PAGE_FILE) |
data/ (~/.agentvoice/data/ installed from npm) |
Transcripts and minutes (deleted after 30 days, and the speaker probe's measurements in speaker-probe/ with them), prepared slide decks (decks/, deleted 30 days after they were last used), the shared brief, the local token, the control socket, the bots not yet seen out of their calls (pending-bots.json), the audio of Alex's fixed lines (tts-cache), and the service's log under launchd or systemd (agent-voice.log). Readable only by you. Never committed. |
docs/ |
These pages, also in the npm package |
test/package/ |
check-package.ts (npm run check-package, and prepublishOnly) and install.test.ts (npm run test:package). Not in the npm package, nor is anything else in test/ but the name corpus |
.github/workflows/ci.yml |
CI: the typecheck and the tests, on Node 24 and 26, on Linux and macOS; and the package job: check-package, the same file list with npm 12, and test:package |
.github/workflows/release.yml |
Publishing to npm from a GitHub release (see Releasing) |
Releases are made by the maintainer.
- A release pull request sets the version in
package.jsonandpackage-lock.json(both of its places) and turns CHANGELOG's## Unreleasedinto the version's section, as 0.2.0's release commit did. - The tag. After merging it, the maintainer tags the merge commit on main
v<version>and pushes the tag (only the maintainer can: a tag ruleset restrictsv*tags). Then, on a fresh clone of the tag, afternpm ci, they runPRIVATE_TERMS_FILE=<their list> npm run check-package -- --release: the private-terms check over every packed file, the one check the workflow can't run, since GitHub has no copy of the list. - The GitHub release. They publish a GitHub release for that tag, marked as a pre-release only for a version with a pre-release part, such as
0.4.0-rc.1, which goes to npm'snexttag rather thanlatest. A mismatch either way fails the workflow. release.ymlthen runs, in three jobs, so that no code of the repository or its dependencies runs where an OIDC token can be had:packchecks that package.json's name, version and repository are the release's, that the tag isv<version>on main and that the release's kind matches the version, then packs the tarball withnpm pack --ignore-scripts, running no code from the repository or its dependencies.testchecks that it has the tarballpackmade (by its hash), then runsnpm ci, the typecheck, the tests,npm run check-package -- --release --tarball(every file in the tarball is the tagged commit's) andnpm run test:packageon that tarball.publishwaits for the maintainer's approval in thenpmenvironment, then, checking out and installing nothing, checks the tarball's hash again and publishes it with npm's trusted publishing (OIDC: no token anywhere) and provenance. The approval is the gate; the checks catch mistakes, not people. A version already on npm skips this job.
- The first version, 0.3.0, is published by hand, with two-factor authentication, from a fresh clone of its tag: the tests and the package checks first, signed in to npm only to publish the tarball (
npm publish <the tarball> --access public), because a trusted publisher can only be set up for a package that exists. Its GitHub release then runsrelease.ymlwith the publish job skipped. The trusted publisher on npmjs.com (GitHub Actions, the repositoryzGenticAI/AgentVoice, the workflowrelease.ymland the environmentnpm) is saved on the day of the first automatic release, since a new one expires unless it publishes within 2 days. The package's publishing access is "Require two-factor authentication and disallow tokens".
Never publish from a working folder: a fresh clone of the tag has only what git tracks.