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
@@ -0,0 +1,66 @@
|
||||
# Issue #3: Publish pi-nous-portal 0.1.0 to npm
|
||||
|
||||
> **Date:** 2026-11-25
|
||||
> **Type:** issue
|
||||
> **Reference:** https://git.babylondreams.de/AlexKucera/nous-portal/issues/3
|
||||
|
||||
## Goal
|
||||
|
||||
Make the extension installable with `pi install npm:pi-nous-portal` and listed on https://pi.dev/packages, with a repeatable local release. Grew out of the research in #2.
|
||||
|
||||
## What Was Done
|
||||
|
||||
- Researched the gallery. It lists only npm packages that carry the `pi-package` keyword, and a git source installs but never lists. Posted that as the resolution of #2 and closed it.
|
||||
- Settled the publishing decisions with Alexander: npm, unscoped `pi-nous-portal`, Gitea as `repository`, labelled unofficial, semver with a `v0.1.0` tag, a local `publish.sh` instead of CI. Recorded on #3.
|
||||
- `package.json`: added `"pi": { "extensions": ["./index.ts"] }`, `repository`, `homepage`, `bugs`, `"files": ["index.ts", "CHANGELOG.md"]`, and "Unofficial, community-maintained" in `description`.
|
||||
- `publish.sh`: guards (clean tree, `main`, `npm whoami`), `npm run check`, `npm pack --dry-run`, changelog heading rename, commit, tag, `npm publish`, `git push --follow-tags`.
|
||||
- `README.md`: the install section now leads with `pi install npm:pi-nous-portal`, a new Releasing section, and an edit pass for a plainer voice at Alexander's request.
|
||||
- `CHANGELOG.md`: entry under Unreleased.
|
||||
- `AGENTS.md`, `docs/AGENTS.md`, `docs/adr/0003-forge-and-ci.md`: release steps and the manifest rule recorded.
|
||||
|
||||
Verified before stopping: `npm run check` (25 tests pass), `shellcheck`, `npm pack --dry-run` (5 files: `CHANGELOG.md`, `LICENSE`, `README.md`, `index.ts`, `package.json`), the dirty-tree guard stops the script with exit 1, the changelog rename turns `## [Unreleased]` into `## [0.1.0] - 2026-11-25` on a copy, and `npm version patch --no-git-tag-version` bumps a copy to 0.1.1.
|
||||
|
||||
## Decisions & Rationale
|
||||
|
||||
| Decision | Rationale |
|
||||
|----------|-----------|
|
||||
| Publish to npm, not a git source | The gallery indexes npm only. The issue asked "npm or git", and only npm reaches the destination. |
|
||||
| Keep the unscoped name `pi-nous-portal` | Already in `package.json`, unused on npm, and it matches most gallery entries. A scope would have needed an npm org. |
|
||||
| `publish.sh` over CI | Alexander asked for a script, not a pipeline. The instance has Actions enabled but no runner, and npm's trusted publishers exclude Gitea Actions, so CI would also have needed a bypass-2FA token. |
|
||||
| A `pi.extensions` manifest instead of moving `index.ts` | Moving the file would touch `tsconfig.json`, the tests that load `index.ts`, and the symlink install. One manifest entry leaves all three alone. |
|
||||
| Label the package unofficial | It carries Nous in its name and ships the public `hermes-cli` client id. The label keeps it from reading as a Nous product. |
|
||||
| No new ADR | The release setup is reversible, and the no-CI decision is already `0003-forge-and-ci.md`, which gained one sentence. |
|
||||
|
||||
## Gotchas & Fixes
|
||||
|
||||
| Problem | Root Cause | Fix |
|
||||
|---------|------------|-----|
|
||||
| A package install of the old tree would load no extension | pi 1.6.0's `collectDefaultResources` (`core/package-manager.js`) reads `manifest[resourceType]` or scans `<packageRoot>/extensions/`. A root `index.ts` is only found by the legacy `~/.pi/agent/extensions/` loader, which is why the symlink install works. | Add `"pi": { "extensions": ["./index.ts"] }`. |
|
||||
| The gallery would have shown no repo link | `package.json` had no `repository` field. | Added `repository`, `homepage` and `bugs`. |
|
||||
| `tests/`, `docs/` and `tsconfig.json` would have shipped | No `files` whitelist, so npm fell back to `.gitignore`. | `"files": ["index.ts", "CHANGELOG.md"]`. |
|
||||
| I read "automated publishing" as CI and wrote a runner-and-token plan | An assumption that was never asked for. | Alexander corrected it. #3 now describes `publish.sh`. |
|
||||
| `package.json` ended up with two `description` keys | The edit tool auto-relocated the line anchor to the wrong line and inserted instead of replacing. | Replaced both lines with one. `JSON.parse` takes the last key, so `npm pack` had hidden it. |
|
||||
|
||||
## Files Changed
|
||||
|
||||
| File | Change Summary |
|
||||
|------|---------------|
|
||||
| `publish.sh` | New release script |
|
||||
| `package.json` | `pi` manifest, `files`, repo links, description |
|
||||
| `README.md` | Install and Releasing sections, edit pass |
|
||||
| `CHANGELOG.md` | Unreleased entry for the npm package |
|
||||
| `AGENTS.md` | Release command, manifest rule, release convention, log window |
|
||||
| `docs/AGENTS.md` | ADR 0003 one-liner mentions `publish.sh` |
|
||||
| `docs/adr/0003-forge-and-ci.md` | One sentence on the local release gate |
|
||||
| `docs/devlog/INDEX.md` | Row for this log |
|
||||
|
||||
## Open Items & Next Steps
|
||||
|
||||
- [ ] Run `./publish.sh`. It prompts for the npm 2FA code. Not run in this session.
|
||||
- [ ] After the publish, check `pi -e npm:pi-nous-portal` in a throwaway agent dir, then `/login nous-portal`.
|
||||
- [ ] Confirm the package shows up on https://pi.dev/packages.
|
||||
- [ ] Close #3 once the listing is live.
|
||||
|
||||
---
|
||||
|
||||
*Log written by write-log skill*
|
||||
@@ -5,6 +5,7 @@ Complete history of session logs in this directory, newest first. One-line summa
|
||||
<!-- write-log: full-index -->
|
||||
| Date | Type | File | Summary |
|
||||
|------|------|------|---------|
|
||||
| 2026-11-25 | issue | [20261125-issue03-publish-pi-nous-portal-to-npm_log.md](20261125-issue03-publish-pi-nous-portal-to-npm_log.md) | npm package made publishable (manifest, `files`, repo links, `publish.sh`) and README edited, publish still pending |
|
||||
| 2026-11-25 | generic | [20261125-finish-audit-architecture-review-unit_log.md](20261125-finish-audit-architecture-review-unit_log.md) | Two-round finish audit of the carrier move and clock seam: two code nits and a test-hang guard fixed, then a docs-only round |
|
||||
| 2026-11-25 | generic | [20261125-architecture-review-tier-property-and-login-clock_log.md](20261125-architecture-review-tier-property-and-login-clock_log.md) | Architecture review: tier moves from a request header to a model property, `login` gains a clock seam, poll loop now tested |
|
||||
| 2026-11-25 | generic | [20261125-fresh-context-audit-rounds-1-5_log.md](20261125-fresh-context-audit-rounds-1-5_log.md) | Five-round fresh-context audit of the Nous Portal provider: two P1s surfaced in round 3, clean in round 5 |
|
||||
Reference in new issue
Block a user