eachg0 on X: the skills and MCP searches take a repository or package named
outright, but Pi's (Library → Pi packages → Discover) only searched, so a
package found elsewhere couldn't be installed from it.
Now, like the MCP market's `custom` card, GET /api/library/market/pi answers
`direct` (library.PiDirectAt) when the text names a package, and the GUI
draws it first, even when npm's search finds nothing. The forms are Pi
1.5.2's own (parseSource, parseGitUrl, parseNpmSpec), read from the npm
tarball:
- npm: `name`, `name@ver`, `npm:name[@spec]`, `@scope/name[@ver]`, and an
npmjs.com package page (…/v/<ver> becomes the pin);
- git: `git:` with any shorthand (`git:o/r`, `git:github:o/r`,
`git:git@host:path`, `git:host/path`), `https://`, `ssh://`, `git://`,
`git@host:path`, `host.tld/o/r` and `o/r` (GitHub); a GitHub, GitLab or
Bitbucket page loses #readme and /tree/<ref> becomes @ref.
Each is installed as one of Pi's own forms. A bare word is offered only
when the registry has it with the pi-package keyword ("web" exists on npm
without it and stays a search); a form named with npm:, a scope or a git
address is always offered, with the registry's version, publisher and
description when it answers. The registry asked is the one in use
(npmmirror), then npm's own. Local folders aren't offered. piSourceOK
refuses a flag, `..`, a backslash, ?#%, whitespace, a host that isn't
dot-separated labels, a part starting with ~, and a ref or pin that starts
with -. InstallPiPackage takes git sources (it forced npm: before), and a
Pi's packages carry an id (piSourceID), so "In <Pi>" matches a git package
under another ref, too. Placeholder in en, zh, zh-TW, ja, de.
Tests:
- TestPiSourceFor: every form above, canonical output, and the refusals.
- TestPiDirectAt: npmmirror's real /pi-rename/latest bytes
(testdata/npmmirror/pi-rename-latest.json, 2026-11-19), a pin, "web"
without the keyword, a 404, npm: and a scope on a 404, a found one not
offered twice, git forms not asking the registry. No network: registry
fakes only.
- TestPiInstallNamedOutright, and TestPiInstallAndRemove's bad list.
- library-pi-direct.test.cjs: pi-rename typed, offered first, installed
into Pi; its GitHub page installed into WSL Ubuntu by its address; the
placeholder; en zh zh-TW ja de, 980px and 380px, Chromium and WebKit, no
sideways scroll.
Red on the old code: the Go tests don't compile there (piSourceFor,
PiDirectAt undefined); the GUI file is 22/22 red on old assets (the
placeholder, and with that check removed, no direct card, 20/20).
Broken by hand: PiDirectAt returning nil turns TestPiDirectAt red;
piSourceOK refusing git turns TestPiInstallNamedOutright and
TestPiInstallAndRemove red. The first run also found evil..com and
~/pi-tools let through; both are refused now.
Run (mote unless said):
- gofmt -l: nothing.
- go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet
./..., go build: ok at 2b2d4bf54; Windows go vet ./... on xiaomi-gpu and
go vet -tags nogui ./... in WSL magpie-desktop: ok.
- go test -count=1 -timeout 45m ./... at 2b2d4bf54 (base ef997d186): 103
ok, one red, internal/gateway
TestOpenCodeGoOwnFreeModelGetsNothingOfOpenCodes, red alone on
origin/main ed405d1d7 too, #7117.
- GUI: every library-* file plus every file reaching the market or the
library client (99 files, 2565 tests) at 33f4e935c (base be400389b):
2556 pass, 9 red, all on main and filed: library-open-again 1100px
(#6751, red alone on origin/main 0a37c9368 too), library-env Variables
de (#6675, passes alone), win-fonts monospace stack from b2b3d488c's
app.css (#7016).
- At the pushed head (base 0417417e5): vet (darwin, linux nogui, windows)
of internal/library and internal/gui, go build, internal/gui's Budget,
Keys and I18n tests, internal/library whole, and library-pi-direct,
library-pi-market, library-pi-extensions and i18n-keys: all ok (70 of 70 GUI tests).
Not run: the whole GUI suite (both mote and mica held other sessions'
full GUI suites for 3h+; the files this change reaches were run), and the
full Go suite again after the last two rebases; internal/library, which
moved upstream, was run whole at the pushed head. Not tried: a real `pi install` of a git source; the market's
fake pi stands in. Local folders aren't offered.