Development
Requires Node.js 24 and Git. Tauri also needs a Rust toolchain (and libwebkit2gtk-4.1-dev on Linux); Deno Desktop comes from npm. The terminal’s node-pty ships prebuilt for Windows and macOS; on Linux npm install compiles it, which needs Python, make and a C++ compiler.
Run from source
Section titled “Run from source”npm installnpm startnpm start runs the client with hot reload and the Electron app. Restart it after changing anything outside src/client/. Open this folder in Genbeya: its wiki is this documentation and its task board is the real backlog.
The web demo
Section titled “The web demo”npm run start:demo serves the Demo at http://127.0.0.1:5173/ with the managers running in the page; it rebuilds on every change. To see the static build as genbeya.fyi serves it:
npm run build:demonode scripts/serve-demo.mjs 4200Then open http://127.0.0.1:4200/try/. Reloading the page starts the demo over.
The VS Code extension
Section titled “The VS Code extension”Open this folder in VS Code and press F5 (Run the VS Code extension): it builds the VS Code extension into dist/vscode and opens this repository in a second VS Code window with it. After a change, run npm run build:vscode and reload that window (Developer: Reload Window).
Scripts
Section titled “Scripts”| Command | What it does |
|---|---|
npm start | Client with hot reload plus the Electron app. Restart it after changing the backend or the shell |
npm run start:demo | The web demo with rebuilds on change, in your browser |
npm run check | Type-check backend, shells and client |
npm run lint | ESLint, including the layer rules of the Architecture |
npm run format | Prettier |
npm test | Backend and client unit tests |
npm run e2e | Build, then end-to-end tests against the Electron app |
npm run e2e:demo | Build the web demo, then its end-to-end tests in Chromium |
npm run build | Production client and Electron shell |
npm run build:demo | The web demo as static files, in dist/demo/browser |
npm run icons | App icons of all three shells and the favicon, rendered from the logo in branding/ |
npm run package | Electron installer for the current OS, in release/ |
npm run package:tauri | Tauri installers, in src/shells/tauri/src-tauri/target/release/bundle/ |
npm run package:deno | Deno Desktop installers (.msi, .dmg, or .AppImage and .deb), in release-deno/ |
npm run build:vscode | The VS Code extension, unpacked in dist/vscode |
npm run test:vscode | Build the VS Code extension, then its smoke test inside VS Code |
npm run package:vscode | The VS Code extension as Genbeya-<version>-vscode.vsix, in release-vscode/ |
npm run build:kit | The Kit, the renderer and editor for other apps’ web views, in dist/kit |
npm run e2e:kit | Build the kit, then its end-to-end tests in Chromium |
npm run package:kit | The kit as genbeya-kit-<version>.zip, in release-kit/ |
Code is written test first. Specs sit next to the code they test.
- Backend (
npm run test:backend, Vitest): engines with plain data; resource access and managers against disposable repositories in.test-work/, including a content branch synced through a bare remote with some areas on it and the others in the checkout, and a WSL repository when theUbuntudistribution exists.backend.spec.tsdrives the managers through the RPC envelope, as a shell does. Both platforms pass the same machine contract (src/testing/machine-contract.ts); on Node it includes pseudo-terminals with the user’s real shell. Managers that start terminals get fake ones (src/testing/terminals.ts). - Client (
npm run test:client, Vitest throughng test): components with a fake platform (src/client/app/testing/fake-platform.ts), engines of the client such as fuzzy search and the commit graph, and the Markdown pipeline. - End to end (
npm run e2e, Playwright): the packaged Electron app with a fresh profile and a fresh repository per test, opened through the--openlaunch argument. Covers wiki, tasks, version control, sharing, the shell, the terminal and the onboarding, and browsing WSL folders when theUbuntudistribution exists. A test can launch the app again on the same profile (launch), e.g. with agenbeya://link. Unpackaged builds do not register forgenbeya://links, so development never takes them over from the installed app. Profiles start as a user who has seen the tour and this version’s news, so neither gets in the way;test.use({ preferences: null })starts like a first start, and other values set what the profile’sstate.jsonholds. - VS Code extension (
npm run test:vscode):src/shells/vscode/test/smoke.tsruns inside VS Code’s extension host on a sample repository in a temporary folder: the extension opens it, shows its pages and tasks, and saves through its content file system. VS Code is downloaded to.vscode-test/; setVSCODE_EXECUTABLEto an installedCode.exe(orcodebinary) to use that instead. The views’ pure parts have unit tests next to them. - Web demo (
npm run e2e:demo, Playwright in Chromium,playwright.demo.config.ts): the built demo served under/try/byscripts/serve-demo.mjs, a fresh page per test; every test also fails when the page requests anything from another origin. Install the browser once withnpx playwright install chromium. The demo’s managers have unit tests of their own insrc/managers/demo/andsrc/access/memory/. - Kit (
npm run e2e:kit, Playwright in Chromium,playwright.kit.config.ts): the built kit served under/kit/by the same server, with a test host in the page that records what the kit posts; every message is checked against the protocol, and no request may leave the origin. The protocol’s checks have unit tests insrc/shells/kit/protocol.spec.ts.
Branches and releases
Section titled “Branches and releases”main is what is released; develop collects the work that is approved but not released yet. Both are protected: changes reach them only through pull requests.
- Branch off
developfor each feature or fix (feature/…,fix/…), and open a pull request intodevelop. CI builds and tests it; merging needs an approving review. - Repeat until
developholds what the next release should have. - To release, bump the version on
develop(node scripts/version.mjs bump patch, through a pull request like any change), then open a pull request fromdevelopintomain. Merging it builds the release, publishes it, publishes the VS Code extension to the Visual Studio Marketplace and Open VSX and rebuilds the website. An important hotfix reachesmainthe same way. - The website rebuilds by itself: after every push to
main, the release job sendsgenbeya/websiteagenbeya-releaseevent (with the secretWEBSITE_DISPATCH_TOKEN, a fine-grained token for that repository with Contents: read and write), and its deploy workflow buildsmainwith the download list, the documentation and the demo from the app’s latest release. Changes to the website itself go through its owndevelopandmain.
Never commit to main or develop directly, and keep main and develop in step: after a release, develop already holds everything main has.
Continuous integration
Section titled “Continuous integration”.github/workflows/build.yml runs on every push and pull request to main and develop, and on pushes to experiment/** branches. On Windows, macOS and Linux it runs lint, unit and end-to-end tests (.github/actions/verify) and the Tauri shell’s Rust tests, then packages Electron, Tauri and Deno Desktop. On Linux it also builds the web demo, tests it in Chromium and uploads it as genbeya-web-demo.zip. It also tests the VS Code extension and uploads its .vsix as Genbeya-<version>-vscode.vsix; a release publishes that file to the Visual Studio Marketplace and to Open VSX, both through trusted publishing: the Marketplace’s genbeya publisher has a Trusted Publishing policy for build.yml in this repository, without an environment (vsce publish --oidc, vsce 4.1 or newer), and Open VSX trusts the same workflow for the genbeya namespace (trusted publishers). So the release job needs id-token: write and no secret. A Marketplace release that names a version the store has already fails; it publishes one version once. It tests the Kit too and uploads it as genbeya-kit-<version>.zip, with its size in the step summary; a release attaches the zip. The stores show src/shells/vscode/README.md and CHANGELOG.md; add the extension’s changes to the latter with each release that has some.
- The version is
package.json’s, and the same in its lockfile,tauri.conf.json,Cargo.tomlandCargo.lock:node scripts/version.mjs bump patch(orminor,major) orset 1.0.0changes all of them, and CI fails when they disagree (node scripts/version.mjs check). Bump the patch for fixes, the minor version for new features. Installers replace an installed older version, so every release needs a higher version. - Deno Desktop’s MSIs take their version from a generated
dist/deno/deno.json;scripts/msi-major-upgrade.ps1adds the upgrade rules they lack, and refuses to install over a newer version. Installing an MSI of the same version again repairs it instead of upgrading. scripts/collect-installers.mjscopies every installer intoout/installers/, renamed toGenbeya-<version>-<variant>-<os>-<arch>[-setup].<ext>(for exampleGenbeya-0.1.0-tauri-windows-x64-setup.exe), so the variants never clash. Run it locally after packaging;--dry-runonly prints the names.scripts/report-sizes.mjslists their sizes in the job summary.- Each run uploads one artifact per variant and platform, such as
Genbeya-tauri-macOS. - A push to
mainwhose version has no release yet publishes all installers, the VS Code extension andgenbeya-web-demo.zipas one GitHub release taggedv<version>, with the text of.github/release-notes.mdabove the generated notes; pushes whose version is released already, and everything ondevelop, are built and tested only. To release, see Branches and releases. A release is marked latest only when no publishedv*release is newer.
macOS builds Electron for Apple silicon and Intel; Tauri and Deno Desktop only for the runner’s Apple silicon.
What’s new and the tour
Section titled “What’s new and the tour”The app’s version comes from package.json at build time (src/client/app/core/app-version.ts). When the version is newer than the one the user saw last, Genbeya shows the news of every release line in between, once. First-time users get the tour instead.
To announce a change, add an item to the entry of its release line in src/client/app/features/onboarding/changelog.ts, newest release first:
{ version: "0.1", items: [ { title: "Stash", body: "Set changes aside and bring them back later, from **Changes**.", // Optional: "Show me" in the dialog points at the element, after going to the route. target: '[data-tour="commit-box"]', route: "/changes", }, ],},Entries are keyed by major.minor, the release line: a new entry only shows once package.json (and tauri.conf.json and Cargo.toml for Tauri) carries that minor version, and only to users updating from an older one. The changelog starts empty, in release line 0.0; while it has no entry, nobody sees What’s new, and Show what’s new says there is nothing yet. Keep items to a sentence or two of Markdown.
The tour’s steps are in src/client/app/features/onboarding/tour-steps.ts. A step names its element by selector, usually a data-tour attribute on it, and optionally the route it is on; steps whose element is missing are skipped. The tour itself (src/client/app/ui/tour/) knows nothing about the app.
Conventions
Section titled “Conventions”- Calls only go down the layers; ESLint enforces it. Managers do not call each other; engines do no I/O.
- Every manager method validates its own input.
- Client state lives in signals. The repository is in
core/session.ts, navigation in the router; views own everything else. - Operations go through
session.run, which reports errors and refreshes the snapshot afterwards. Apply a save’s result before the refresh, so the editor is clean when the snapshot arrives. - Styles use the tokens in
src/client/styles/tokens.css. - Line endings are LF (
.gitattributes);npm run formatbefore committing.
Documentation
Section titled “Documentation”docs/ is Genbeya’s own wiki, and Open the documentation (in Settings → Help, the command palette and on the start screen) opens it on GitHub, so it has to make sense to people who never cloned the repository. Write it as the rest of the wiki: short, concrete, second person, present tense, with the labels the app shows in bold.
- Prefer live examples:
[[GENBEYA-12]]next to its source shows readers what a reference does. Point them at tasks, pages and files that exist, so nothing renders as missing by accident. - Screenshots live in
docs/images/: the Electron app at its end-to-end window size (1000 × 680), light theme, the sample project as subject, reduced to 256 colours so each stays well under 150 KB. Link them relatively (../images/search.png). - Announce user-facing changes in What’s new as well (see above).
License
Section titled “License”Genbeya is licensed under the Functional Source License (FSL-1.1-ALv2): anyone may use, change and share it, but not offer it, or something substantially similar built from it, as a competing commercial product or service; each version becomes Apache 2.0 two years after its release. The license fields of package.json and Cargo.toml say so too.
What Genbeya writes into users’ repositories — the agent files, the sample project, new settings files and task templates — is under the MIT No Attribution License (MIT-0), and so is that text in the source files it comes from. Those files start with a comment saying so, and LICENSE-MIT-0.md lists them. When you add a file that writes text into users’ repositories, or move such text to another file, give it the same comment and update the list.