feat: make the package installable from npm
pi loads a package's extensions through the `pi` manifest or an
`extensions/` directory, so a root index.ts loaded nothing as a
package. Add "pi": { "extensions": ["./index.ts"] }, a files
whitelist that keeps tests and docs out of the tarball, and the
repository links the pi.dev/packages gallery shows.
Add publish.sh for releases: checks, tarball preview, changelog
heading, commit, tag, npm publish, push. No CI (ADR 0003).
Lead the README with pi install npm:pi-nous-portal, document the
release script, and label the package unofficial and
community-maintained. The README also gets a plainer voice.
The publish itself is still pending. Refs #3
This commit is contained in:
1 parent
8829d3142c
commit
1af3a1360e
9 files changed
+155
-19
No files matched your search
@@ -1,27 +1,34 @@
|
||||
# pi-nous-portal
|
||||
|
||||
Nous Portal provider for [pi](https://github.com/earendil-works/pi): subscription OAuth and API key, without agent-key minting.
|
||||
An unofficial, community-maintained provider that lets [pi](https://github.com/earendil-works/pi) sign in to Nous Portal and use its models. Not affiliated with Nous Research.
|
||||
|
||||
## Why this exists
|
||||
|
||||
Nous retired Hermes-style agent-key minting (`POST /api/oauth/agent-key` returns `410 session_key_minting_retired`). Both existing community extensions end their login at that endpoint, so neither can sign in with a Portal subscription. The inference API now accepts the **OAuth access token directly** as a bearer credential, so this extension never mints or stores an agent key.
|
||||
Nous retired Hermes-style agent-key minting. `POST /api/oauth/agent-key` returns `410 session_key_minting_retired`, and both existing community extensions end their login at that endpoint, so neither can sign in with a Portal subscription. The inference API does accept the OAuth access token itself as a bearer credential, so this extension never mints or stores an agent key.
|
||||
|
||||
## Requirements
|
||||
|
||||
- pi 1.6.0 or newer (`@earendil-works/pi-ai` native provider interface)
|
||||
- Node.js 22+
|
||||
- A Nous Portal subscription, or an inference API key from the Portal
|
||||
- pi 1.6.0 or newer, for the `@earendil-works/pi-ai` native provider interface
|
||||
- Node.js 22 or newer
|
||||
- a Nous Portal subscription, or an inference API key from the Portal
|
||||
|
||||
## Getting started
|
||||
## Install
|
||||
|
||||
```bash
|
||||
pi install npm:pi-nous-portal
|
||||
```
|
||||
|
||||
To run from a checkout instead, symlink it into pi's extensions directory:
|
||||
|
||||
```bash
|
||||
# from a checkout
|
||||
ln -s "$PWD" ~/.pi/agent/extensions/nous-portal
|
||||
```
|
||||
|
||||
Then in pi:
|
||||
## Use
|
||||
|
||||
- `/login nous-portal` offers two methods: **Sign in to Nous Portal (subscription)** for the device-code OAuth flow, or **Nous Portal API key** to store an `sk-nous-…` key.
|
||||
In pi:
|
||||
|
||||
- `/login nous-portal` offers two methods: "Sign in to Nous Portal (subscription)" for the device-code OAuth flow, or "Nous Portal API key" to store an `sk-nous-…` key.
|
||||
- The API-key route also reads `$NOUS_API_KEY`.
|
||||
- `/model` lists the live catalog in interactive sessions.
|
||||
|
||||
@@ -42,22 +49,31 @@ The choice is saved in `~/.pi/agent/nous-portal-catalog` and survives restarts.
|
||||
|
||||
### Offline baseline
|
||||
|
||||
`pi -p` and `pi --list-models` never fetch live catalogs (pi hard-codes `allowModelNetwork: false` there), so the provider ships a small static baseline so it is always usable. Interactive pi overlays the live list on the baseline by model id; a baseline id that disappears from the live catalog stays listed, with its frozen baseline price and context, until the next release.
|
||||
`pi -p` and `pi --list-models` never fetch live catalogs, because pi hard-codes `allowModelNetwork: false` there. The provider ships a small static baseline so those modes still list something. Interactive pi overlays the live list on the baseline by model id. A baseline id that disappears from the live catalog stays listed, with its frozen baseline price and context, until the next release.
|
||||
|
||||
## Known limits
|
||||
|
||||
- `upstage/solar-mini4:free` is left out of the baseline on purpose: it alone requires a `tags` body field that the other free models reject with a 500, so no single request shape serves all of them.
|
||||
- Subscription quota is per day. When the "Today" gauge is exhausted, inference returns `503 ChatGPT subscription inference is temporarily unavailable`. Purchased credits keep the API-key route working.
|
||||
- Requests to the portal's OAuth endpoints send a browser-like `User-Agent`, `Origin` and `Referer` (only to `portal.nousresearch.com`, never to inference). This gets past the Vercel browser checkpoint that otherwise rejects CLI clients. It is a robustness and terms-of-use risk, not a security one: if Nous tightens the checkpoint or treats the client as evasion, login can break or the account can be flagged.
|
||||
- `upstage/solar-mini4:free` is left out of the baseline. It alone requires a `tags` body field that the other free models reject with a 500, so no single request shape serves all of them.
|
||||
- Subscription quota is per day. When the "Today" gauge is empty, inference returns `503 ChatGPT subscription inference is temporarily unavailable`. Purchased credits keep the API-key route working.
|
||||
- Requests to the portal's OAuth endpoints send a browser-like `User-Agent`, `Origin` and `Referer`, and only to `portal.nousresearch.com`, never to inference. This gets past the Vercel browser checkpoint that otherwise rejects CLI clients. It is a terms-of-use risk, not a security one. If Nous tightens the checkpoint or treats the client as evasion, login can break or the account can be flagged.
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
npm install --legacy-peer-deps --no-package-lock # typescript + jiti only; pi injects @earendil-works/* at load time
|
||||
npm run check # tsc --noEmit + node --test
|
||||
npm run check # tsc --noEmit + node --test
|
||||
```
|
||||
|
||||
Typechecking needs a local pi install: `tsconfig.json` `paths` point `@earendil-works/pi-ai` and `pi-coding-agent` at the type declarations under `~/.pi/agent/install/releases/<version>/`. Update those three paths when pi is upgraded. The extension itself runs against any pi with the native provider interface; only `tsc` is pinned.
|
||||
Typechecking needs a local pi install. The `paths` in `tsconfig.json` point `@earendil-works/pi-ai` and `pi-coding-agent` at the type declarations under `~/.pi/agent/install/releases/<version>/`, so update those three paths when pi is upgraded. The extension itself runs on any pi with the native provider interface. Only `tsc` is pinned.
|
||||
|
||||
## Releasing
|
||||
|
||||
```bash
|
||||
./publish.sh # release the version in package.json
|
||||
./publish.sh patch # bump first; minor and major work too
|
||||
```
|
||||
|
||||
The script runs the checks, shows the tarball contents, moves the `Unreleased` section of the changelog under the new version, commits, tags, publishes to npm, and pushes. npm asks for your 2FA code during the publish. You need `npm login` with publish rights to the package first.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Reference in new issue
Block a user