Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/open-source-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- '.claude-plugin/**'
- 'herdr/**'
- 'opencode/**'
- 'rex/**'
- 'plugins/**'
- 'omarchy/**'
- 'raycast/**'
Expand All @@ -19,6 +20,7 @@ on:
- '.claude-plugin/**'
- 'herdr/**'
- 'opencode/**'
- 'rex/**'
- 'plugins/**'
- 'omarchy/**'
- 'raycast/**'
Expand Down Expand Up @@ -69,8 +71,8 @@ jobs:
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '24'
- name: Test the Herdr mod, the opencode plugin (shared quote code) and the Metrix.Bar dashboard
run: make test-herdr test-opencode test-metrix
- name: Test the Herdr mod, the opencode plugin and the Rex pane (shared quote code) and the Metrix.Bar dashboard
run: make test-herdr test-opencode test-rex test-metrix
- name: Build the opencode plugin
working-directory: opencode
run: npm ci --no-audit --no-fund && npm run build
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/release-rex.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release Pulse for Rex

# Push a tag rex-v<version> (matching rex/package.json) to publish
# rex-pulse-ticker to npm and create a GitHub release.
on:
push:
tags: ["rex-v*"]

permissions:
contents: write # create the GitHub release
id-token: write # npm trusted publishing (OIDC) and provenance

jobs:
publish:
if: github.repository == 'fatwang2/Pulse'
runs-on: ubuntu-latest
timeout-minutes: 10
environment: npm # add required reviewers on this environment to approve each publish
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
persist-credentials: false
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
- name: Check the tag matches package.json
run: |
version="$(node -p "require('./rex/package.json').version")"
if [ "${GITHUB_REF_NAME}" != "rex-v${version}" ]; then
echo "Tag ${GITHUB_REF_NAME} does not match rex/package.json version ${version}" >&2
exit 1
fi
- name: Test
run: make test-herdr test-rex
- name: Publish to npm
# Authenticates with npm trusted publishing (OIDC); no token is stored anywhere.
# Skips a version that is already on npm. No build step: the package is the source.
working-directory: rex
run: |
name="$(node -p "require('./package.json').name")"
version="$(node -p "require('./package.json').version")"
if npm view "${name}@${version}" version >/dev/null 2>&1; then
echo "${name}@${version} is already published; skipping."
else
npm publish --access public --provenance
fi
- name: Create GitHub release
run: gh release create "$GITHUB_REF_NAME" --title "Pulse for Rex ${GITHUB_REF_NAME#rex-v}" --generate-notes --verify-tag
env:
GH_TOKEN: ${{ github.token }}
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Pulse public repository

This repository hosts Pulse for Omarchy, Pulse for Claude Code, Pulse for opencode, Pulse for Herdr, Pulse for Raycast and Pulse for Metrix.Bar. Current
This repository hosts Pulse for Omarchy, Pulse for Claude Code, Pulse for opencode, Pulse for Herdr, Pulse for Rex, Pulse for Raycast and Pulse for Metrix.Bar. Current
commercial Mac and website source belongs in the private Pulse repository.

- Keep `omarchy`, `plugins/claude-code`, `opencode`, `herdr`, `raycast` and `metrix` independent; follow their
- Keep `omarchy`, `plugins/claude-code`, `opencode`, `herdr`, `rex`, `raycast` and `metrix` independent; follow their
scoped AGENTS.md instructions (Raycast's live in docs/raycast.md, since the
Store ships everything in raycast/) and run checks appropriate to the changed edition.
- Do not restore current Mac source, website source, signing material, private
Expand Down
13 changes: 8 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to Pulse

This repository holds six independent open-source editions of Pulse and the
This repository holds seven independent open-source editions of Pulse and the
documentation for Pulse MCP. Current commercial Mac and website development
takes place elsewhere; historical Mac build instructions are linked from
[the history guide](docs/history/README.md).
Expand All @@ -12,6 +12,7 @@ takes place elsewhere; historical Mac build instructions are linked from
| Claude Code | `plugins/claude-code` | Claude Code 2.1.287+, with Mods enabled | `make test-claude` |
| opencode | `opencode` | Node.js 22+; opencode 1.15+ or 2.x for runtime checks | `make test-opencode`, then `npm run build` in `opencode/` |
| Herdr | `herdr` | Node.js 22+; Herdr for runtime checks | `make test-herdr` |
| Rex | `rex` | Node.js 22+; Rex for runtime checks | `make test-rex` |
| Metrix.Bar | `metrix` | Node.js 22+; Metrix.Bar with its local API for runtime checks | `make test-metrix` |
| Omarchy | `omarchy` | Node.js 22+ for reducer tests; Omarchy 4 / Qt for runtime checks | `make test-omarchy` |
| Raycast | `raycast` | Node.js 22+; Raycast for runtime checks | `make test-raycast` |
Expand Down Expand Up @@ -52,8 +53,9 @@ What the checks cover:
- **Claude Code** tests use its native Mods harness with mocked host APIs and
make no model calls. For type checking, follow its README's
declaration-generation instructions.
- **opencode** and **Herdr** test their shared quote and watchlist code with
`node --test`; the opencode copy must match Herdr's, and a test checks it.
- **opencode**, **Herdr** and **Rex** test their shared quote and watchlist code
with `node --test`; the opencode and Rex copies must match Herdr's, and tests
check it. Rex also tests that every line it draws fits its pane.
- **Metrix.Bar** tests check that `metrix/index.json` matches `pulse.bar` (its
SHA-256 and version), the declared hosts, and the Worker's symbol, search and
formatting rules. Rebuild the index after every change to `pulse.bar`; see
Expand All @@ -75,6 +77,7 @@ change works, try it there:
| Claude Code | Load the plugin in Claude Code, and in Claude Desktop's Code tab if the change touches the panel |
| opencode | Install the packed package in a real opencode v1 and v2, not only from a checkout |
| Herdr | `herdr-app check` on the mod, then run it in Herdr; each `preview.png` is a real screenshot |
| Rex | `rex config check` on an `init.lua` that loads `rex/lua/pulse.lua`, then `rex do <that file> --action pulse_open` and a look at the pane and its layer |
| Metrix.Bar | `POST /v0/validate` and `POST /v0/check` with fixtures and steps, then the installed dashboard |
| Omarchy | The bar and panel in an Omarchy 4 session |
| Raycast | `npm run dev` in `raycast/`, then the command in Raycast |
Expand All @@ -88,15 +91,15 @@ acceptance.
Each edition is released on its own; versions and changelogs stay separate.
Existing `v0.*` tags belong to the historical Mac app and must not be reused
for open-source releases. Release steps are in each edition's AGENTS.md; for
example, opencode publishes to npm from an `opencode-v*` tag, Raycast is
example, opencode and Rex publish to npm from `opencode-v*` and `rex-v*` tags, Raycast is
submitted to the Store only from the owner's Mac, and Metrix.Bar users receive
whatever `metrix/index.json` on `main` describes. See also the
[transition notes](docs/repository-transition.md).

## Issues and changes

Name the edition when you report an issue: **Claude Code**, **opencode**,
**Herdr**, **Metrix.Bar**, **Omarchy**, **Raycast**, **Pulse MCP**, **current
**Herdr**, **Rex**, **Metrix.Bar**, **Omarchy**, **Raycast**, **Pulse MCP**, **current
commercial Mac** or **historical Mac**. Include the relevant application and
host versions and the steps to reproduce. Remove credentials and private
financial information from logs and screenshots. Report security issues
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: test test-claude test-omarchy test-herdr test-opencode test-raycast test-metrix validate
.PHONY: test test-claude test-omarchy test-herdr test-opencode test-rex test-raycast test-metrix validate

test: test-claude test-omarchy test-herdr test-opencode test-raycast test-metrix
test: test-claude test-omarchy test-herdr test-opencode test-rex test-raycast test-metrix

test-claude:
claude plugin validate plugins/claude-code
Expand All @@ -16,6 +16,9 @@ test-herdr:
test-opencode:
node --test opencode/tests/*.test.mjs

test-rex:
node --test rex/tests/*.test.mjs

test-metrix:
node --test metrix/tests/*.test.mjs

Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ server built into Pulse for Mac.
| **Pulse for Claude Code** | Claude Code, Claude Desktop's Code tab | Prices above the prompt, `/pulse` panel to manage tickers | Open source, MIT | [Guide](plugins/claude-code/README.md) |
| **Pulse for opencode** | opencode | Sidebar watchlist with today's line and a detail view, quote band | Open source, MIT, on npm | [Guide](opencode/README.md) |
| **Pulse for Herdr** | Herdr | Watchlist docked beside your agents, with a detail view | Open source, MIT | [Guide](herdr/README.md) |
| **Pulse for Rex** | Rex | Watchlist in a pane beside your agents, with the selected ticker's chart and a detail layer | Open source, MIT | [Guide](rex/README.md) |
| **Pulse for Metrix.Bar** | Metrix.Bar menu bar | Ticker in the menu bar, watchlist with search and a detail view | Open source, MIT | [Guide](metrix/README.md) |
| **Pulse for Omarchy** | Omarchy 4 bar (Linux) | Prices in the bar, named watchlists, search, charts | Open source, MIT | [Guide](omarchy/README.md) |
| **Pulse for Raycast** | Raycast | Search any symbol by ticker or name, with its price and today's chart | Open source, MIT, in Raycast Store review | [Guide](raycast/README.md) |
Expand Down Expand Up @@ -118,6 +119,22 @@ Read ~/.config/herdr-app/AGENTS.md, then add this layout: https://github.com/fat

See the [Herdr guide](herdr/README.md) for the mod on its own, usage and privacy.

## Pulse for Rex

A [Rex](https://www.superlogical.com/rex) pane: a stock and crypto watchlist
beside your agents, with the selected ticker's day below the list, and a floating layer with its chart, open, high, low and
previous close. Opened from Rex's command palette.

<img src="rex/preview.png" alt="Pulse for Rex: the watchlist with the selected ticker's day below it" width="720">

```sh
npm install --global rex-pulse-ticker
pulse-rex install
```

Then press **cmd+shift+p** in Rex and run **Pulse: Open Watchlist**. See the
[Rex guide](rex/README.md) for usage and privacy.

## Pulse for Metrix.Bar

A [Metrix.Bar](https://metrix.bar) dashboard: your first ticker in the menu
Expand Down
40 changes: 40 additions & 0 deletions rex/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Pulse for Rex

- A Node CLI (npm package `rex-pulse-ticker`, bin `pulse-rex`) plus
`lua/pulse.lua`, which Rex's `init.lua` loads. Rex lets config draw no UI, so
the watchlist is a terminal program in a pane; the Lua only registers
`rex.action`s and runs `pulse-rex`. No runtime dependencies.
- `src/quotes.js` and `src/watchlist.js` are copies of the Herdr mod's
(`herdr/pulse/mods/pulse/`): only the header comment and `PULSE_URLS` differ,
and a test checks it. Change all copies together. Keep them, `src/format.js`
and `src/store.js` free of Rex calls so `node --test` can run them.
- `src/format.js` is pure: state in, lines out. Every line must fit its pane
width (a test draws many sizes); measure with `cells`, cut with `fit`.
- `pulse-rex install` only adds or replaces the block between
`-- >>> pulse >>>` and `-- <<< pulse <<<` in Rex's `init.lua`, runs
`rex config check`, and restores the file when the check fails. Never touch
the rest of the file, and never rewrite it on start or on use.
- Pane width: Rex sizes splits by fraction and the app evens out a new split
after it shows, so `pulse_open` passes `--beside` and `--ratio` and the pane
calls `session.resize_pane` itself after it starts.
- The only hosts are `query1.finance.yahoo.com` and `data-api.binance.vision`.
The only program is `rex` (layers, resizing, config check and reload). Pulse
for Mac links are OSC 8 hyperlinks; Pulse never opens a browser itself. Keep
README and code in step on hosts, programs, storage and behavior.
- Promote Pulse for Mac only, modestly (the footer link, the detail's card,
the README); name no other edition. Links carry `utm_source=rex`.
- Respect Yahoo cooldowns; never show cached data as fresh or unknown delay as
real time. Crypto never waits on Yahoo.
- `preview.png` must be a screenshot of the real pane running in Rex.
- Test in a real Rex before release: `rex config check` on an `init.lua` that
loads the Lua, `rex do <that file> --action pulse_open`, and a look at the
pane, the layer and the band.
- Releases: bump `version` in `package.json` (the User-Agent reads it), merge
to main, then push the tag `rex-v<version>`. `.github/workflows/release-rex.yml`
checks the tag, tests, publishes `rex-pulse-ticker` to npm with provenance
through npm trusted publishing (repository `fatwang2/Pulse`, workflow
`release-rex.yml`, environment `npm`; no token is stored) and creates a
GitHub release. A version npm already has is skipped.
- `pulse-rex install` writes node and the package through a version manager's
stable link when there is one (`…/node/current/bin/node`), so upgrading node
doesn't break Rex's config.
21 changes: 21 additions & 0 deletions rex/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 fatwang2

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
95 changes: 95 additions & 0 deletions rex/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Pulse for Rex

A stock and crypto watchlist in a [Rex](https://www.superlogical.com/rex) pane
beside your agents, from the makers of
[Pulse for Mac](https://www.pulseticker.app/?utm_source=rex&utm_medium=readme).
Each ticker shows its price and its change. The selected ticker's day fills
the rest of the pane: a chart, the open, high, low and
previous close, and where the numbers come from. Press Enter for the same day
in a floating layer. Stocks and indices come from Yahoo Finance, crypto pairs
(`BTC/USDT`) from Binance's public Spot data. Squeezed to six rows or fewer,
the pane draws a one-line quote band instead.

![Pulse for Rex: the watchlist with the selected ticker's day below it](preview.png)

## Install

Needs Node.js 18.17 or later and Rex's `rex` command on your `PATH`.

```sh
npm install --global rex-pulse-ticker
pulse-rex install
```

`pulse-rex install` adds one marked block to the end of Rex's `init.lua`
(`~/.config/rex/init.lua`, or where `REX_CONFIG` points), checks it with
`rex config check`, and reloads Rex's config. If the check fails, the file is
put back as it was. `pulse-rex uninstall` removes the block.

Then press **cmd+shift+p** in Rex and type **Pulse**:

| Action | Name | What it does |
| --- | --- | --- |
| Pulse: Open Watchlist | `pulse_open` | Opens the watchlist about 48 columns wide beside the focused pane, or focuses the one already open in this window |
| Pulse: Add Ticker… | `pulse_add` | A small prompt for a ticker; `rex do pulse_add symbol=0700.HK` adds one directly |
| Pulse: Refresh Quotes | `pulse_refresh` | One round now in every open Pulse pane |
| Pulse: Pause or Resume | `pulse_pause` | Stops automatic refresh, or starts it again |

No keys are bound by default. To bind one, add a line after the Pulse block in
`init.lua`, such as `rex.bind("cmd+shift+u", "pulse_open")`, or pass `keys` to
`setup`: `keys = { open = "cmd+shift+u" }`. `width = 56` makes the pane wider.

Without the palette, `pulse-rex` runs the watchlist in any terminal.

## Use

- It starts with `AAPL`, `NVDA`, `^GSPC` and `BTC/USDT`.
- `↑` `↓` (or `j` `k`, or the mouse wheel) select a ticker; a click selects
one, a second click opens it.
- `Enter` opens the selected ticker's day in a floating layer; `Esc` closes it.
- `a` adds a ticker: `AAPL`, `0700.HK`, `^GSPC`, `BTC/USDT`. `x` removes the
selected one.
- `r` refreshes now; `p` pauses or resumes automatic refresh; `q` closes the pane.
- From a shell: `pulse-rex add NVDA`, `pulse-rex remove NVDA`,
`pulse-rex pause`, `pulse-rex resume`, `pulse-rex refresh`, `pulse-rex list`.
Open panes pick changes up within a second.

Quotes refresh 60 seconds after each round. Stock prices are Yahoo's
regular-session quotes; exchange delays vary and are shown when Yahoo reports
them. Crypto changes and lines are 24-hour. A quote from an earlier day
carries its date. Early in a session, today's line only reaches as far as the
day has gone.

Want quotes in your menu bar, with charts and positions? That's
[Pulse for Mac](https://www.pulseticker.app/?utm_source=rex&utm_medium=readme).

## Privacy

The watchlist is saved in `~/.config/pulse-rex/watchlist.json` (or under
`XDG_CONFIG_HOME`). Watching a ticker sends it to Yahoo Finance; watching a
pair sends it to Binance. Pulse contacts no other host and has no account or
analytics. The Pulse for Mac links are terminal hyperlinks to
`https://www.pulseticker.app/`, tagged `utm_source=rex&utm_medium=plugin`;
your terminal opens them only when you click one. The only program Pulse runs
is `rex`, to open its layers and set its pane's width. See the
[Pulse privacy policy](https://www.pulseticker.app/privacy).

## How it fits into Rex

Rex has no plugin UI of its own, so Pulse is a terminal program in a pane, and
`lua/pulse.lua` is the glue Rex's config loads: four `rex.action`s that open
the pane with `rex.session.new_split` and change the saved list by running
`pulse-rex`. The pane sizes itself with `session.resize_pane` once Rex shows
it, and opens the detail with `session.new_layer`.

## Development

```sh
node --test rex/tests/*.test.mjs
```

The tests cover drawing (every line fits its pane at every size, the chart,
the band, wide characters), keys, the shared watchlist file, the `init.lua`
block, and that `quotes.js` and `watchlist.js` match the Herdr mod's. The
Lua needs Rex itself: write an `init.lua` that `dofile`s `rex/lua/pulse.lua`
and run `rex config check` on it.
Loading
Loading