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
3 changes: 3 additions & 0 deletions .github/workflows/open-source-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ jobs:
node-version: '24'
- name: Test the Herdr mod and the opencode plugin (shared quote code)
run: make test-herdr test-opencode
- name: Build the opencode plugin
working-directory: opencode
run: npm ci --no-audit --no-fund && npm run build

raycast:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release-opencode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ jobs:
fi
- name: Test
run: make test-herdr test-opencode
- name: Install build tools
# Babel and Solid's preset compile src/ to dist/ (npm runs the build on prepack).
working-directory: opencode
run: npm ci --no-audit --no-fund
- name: Publish to npm
# Authenticates with npm trusted publishing (OIDC); no token is stored anywhere.
# Skips a version that is already on npm.
Expand Down
2 changes: 2 additions & 0 deletions opencode/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
11 changes: 8 additions & 3 deletions opencode/AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# Pulse for opencode

- An opencode TUI plugin (npm package `opencode-pulse-ticker`, entry
`exports["./tui"]` = `src/tui.tsx`) for both opencode lines. opencode compiles
the TSX with its own Solid runtime, so ship source, no build step and no
runtime dependencies. `src/tui.tsx` exports `{ id, tui, setup }`: v1
`exports["./tui"]` = `src/tui.tsx`) for both opencode lines. Source is TSX in
`src/`; `npm run build` (`scripts/build.mjs`, run on prepack) compiles it to
`dist/` with Solid's universal transform for `@opentui/solid`, which is what
the package exports. opencode v2 does not compile TSX under `node_modules`,
so the published package must be JavaScript; `solid-js` and `@opentui/solid`
stay imports that opencode provides. No runtime dependencies. Test the packed
package from a `node_modules` path, not only a checkout: a local directory is
compiled by opencode and hides build problems. `src/tui.tsx` exports `{ id, tui, setup }`: v1
(`opencode-ai` 1.15+) calls `tui` (`src/v1.tsx`: `@opencode-ai/plugin/tui`
`slots`, `keymap.registerLayer`, `kv`, `lifecycle`, `ui`), v2 (`@opencode/cli`
2.x) calls `setup` (`src/v2.tsx`: `@opencode/plugin/tui` `ui.slot`,
Expand Down
8 changes: 5 additions & 3 deletions opencode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@ Want the same watchlist in your menu bar, with charts and positions?

## Development

In opencode v2, link your checkout into a project's `.opencode/plugins/`
(`ln -s /path/to/Pulse/opencode .opencode/plugins/pulse`); v2 reloads it on
save. In v1, point `tui.json` at it and restart opencode after each change:
Run `npm install` and `npm run build` in `opencode/`; the package loads
`dist/`, compiled from `src/`. In opencode v2, link your checkout into a
project's `.opencode/plugins/` (`ln -s /path/to/Pulse/opencode
.opencode/plugins/pulse`). In v1, point `tui.json` at it. Rebuild and restart
opencode after each change:

```json
{ "plugin": ["/path/to/Pulse/opencode"] }
Expand Down
Loading
Loading