feat: Nous Portal provider with subscription OAuth and catalog filters

Registers the native nous-portal provider for pi. Nous retired
agent-key minting (410 session_key_minting_retired), which is where
both existing community extensions end their login. The inference API
accepts the OAuth access token directly, so toAuth hands it over and
no agent key is ever minted or stored.

- Device-code OAuth (subscription) and API-key login
- Live model discovery delegated to openai-completions streaming
- Offline baseline so pi -p and --list-models stay usable
- /nous-catalog cycles full, free and promo; /nous-free jumps to free
This commit is contained in:
AlexKucera committed 2026-11-25 09:29:52 +01:00
1 parent 40ac2c4b43
commit 690fcdfe22
15 files changed
+1253

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
# Nous Portal as a native pi-ai provider extension
Pi 1.6 exposes two registration forms. We register a complete native `Provider` (built with `createProvider` from `@earendil-works/pi-ai`) rather than the legacy `ProviderConfig` + `oauth` block, because the legacy form's `getApiKey` contract pushes an extension toward minting a session key, and Nous retired that endpoint (HTTP 410 `session_key_minting_retired`, verified 2026-11-25). The native form lets `toAuth` hand the OAuth access token straight to inference, which accepts it (verified 200 on `/v1/models`). Streaming is delegated to the built-in `openai-completions` API; no custom wire protocol.
## Consequences
- Pi owns the locked refresh pattern (`refresh` / `toAuth` split), so concurrent requests cannot double-refresh a rotated token.
- The extension is a single root `index.ts` with no build step, matching the sibling extensions in `~/Projects/scripting/pi-extensions/`.
+3
View File
@@ -0,0 +1,3 @@
# License GPL-3.0-or-later
Default for this author's projects. Copyleft keeps the extension free if it is ever published; "or-later" avoids the GPLv2-only trap.
+3
View File
@@ -0,0 +1,3 @@
# Gitea remote, no CI yet
The repository already had an `origin` on `git.babylondreams.de` (Gitea) when it was initialised, so that is the forge. No CI file: a single-file extension has nothing to build, and the test suite is `node --test` over offline assertions. Add a Gitea Actions workflow when the suite grows or a published npm package needs a release gate.