Skip to content

Development

Alper Sarıtaş edited this page Dec 4, 2026 · 4 revisions

Setup

git clone https://github.com/lprsrts/on-my-own.git
cd on-my-own
npm install --ignore-scripts

Node 26 runs the TypeScript directly, so a checkout needs no build: npm start -- <folder> runs omo from src/. npm run build compiles src/ to dist/ with tsconfig.build.json, which rewrites the .ts import paths to .js. The npm package ships dist/, since Node does not strip types from files under node_modules. npm pack and npm publish build first.

Checks

npm test          # node --test over test/*.test.ts
npm run check     # tsc --noEmit
  • Isolation. Every test file runs with OMO_DIR set to a new temporary folder (test/isolate.ts), so no test can reach your real settings or store.
  • Fixtures. The tests read four Wikipedia articles at fixed revisions (Kirchhoff's circuit laws, Ohm's law, Series and parallel circuits, Voltage), converted to Markdown the same way omo adds a web page (test/faux.ts). They are downloaded on the first run and kept in the system's temporary folder, so that first run needs the network.
  • Passages are found by their words, not their line numbers, so the tests survive revisions of the articles' formatting.
  • No real model is called. test/faux.ts registers pi-ai's faux provider. A test scripts the guide's tool calls (calls(...), offer(...)) and can inspect what the model would have been sent.
  • The TUI is tested against a fake terminal (test/fake-terminal.ts).

Guard tests keep some rules from drifting:

Test Keeps
guard.test.ts No code or dependency uses pi-coding-agent or ripgrep. Nothing in src starts a process except the browser opener and the keychain lookup. No pi-branded string appears in src. The user agent names on-my-own at the package version
standalone.test.ts omo starts and searches on a machine without rg or fd, and writes only in its own folder

Conventions

  • pi's libraries, not pi's app. Use pi-ai, pi-agent-core and pi-tui, pinned to exact versions. Never use pi-coding-agent. Prefer what the libraries already offer over custom code.
  • Words. What the person types is a query. Reading is walking. Only accepted notes are understanding.
  • The guide's instructions (SYSTEM_PROMPT in src/guide.ts) describe the environment and the tools, not a script. They hard-code no counts or categories of source. Limits are the person's to set in config.json.
  • Tests describe behaviour in a sentence, for example test("reading is walking: it opens the next steps for good, and it is not understanding", …).

Continuous integration

Workflow Runs on Does
.github/workflows/ci.yml Pushes to main, pull requests npm run check, npm test and npm run build on Node 26
.github/workflows/release.yml A tag v* Checks the tag matches package.json, runs the checks and tests, packs the package, creates a GitHub release with the tarball and generated notes, and publishes to npm with provenance

Making a release

npm version patch        # or minor, major: bumps package.json and tags v<version>
git push --follow-tags

Publishing to npm needs an NPM_TOKEN repository secret: an npm granular access token with read and write access to packages, allowed to publish without two-factor authentication. Before the first release it must cover all packages, since on-my-own does not exist yet; after it, it can be narrowed to on-my-own.

Brand

The product page and the brand assets live in a separate repository and are served at omo.lprsrts.com, so this repository holds only the program and its tests. The package README and this wiki load the banner from there.

Asset Use
icon.png Four tiles of the field with a path trodden up to a lantern: favicon and app icon
banner.webp The README banner (1280 × 640): the product page in small, acting out one query in omo's window while its trail is trodden through the field
banner.png The banner's last frame, the finished map: the repository's social preview

The page and the brand are drawn in code: a procedural pixel tileset and a field where grass grows and trails are trodden, as omo finds its way through a folder, with omo's terminal window over it. The banner is drawn from the page's own field, so the two always match.

omo names itself on-my-own to providers: its User-Agent is on-my-own/<version>, and providers that credit apps (OpenRouter) are given the name and the product page from package.json's homepage. Pi is credited as the libraries omo is built on, never as the app.

Where to start reading

  1. src/session.ts: what happens on a query, a read and a note.
  2. src/guide.ts: the instructions, and how a task runs.
  3. src/guide-tools.ts: what the guide can do, and how its answers are checked.
  4. src/graph.ts: how the next steps are chosen.

See Architecture for the full module map.

Clone this wiki locally