summaryrefslogtreecommitdiff
path: root/link/pi.sh
AgeCommit message (Collapse)Author
2026-10-05pi: extensions as a directory of links, so a machine can have its ownIgor Soarez
~/.pi/agent/extensions was a link to the repo's directory, so anything that installs a pi extension wrote into this checkout -- herdr's pi integration did, on one machine. It is now a real directory with the repo's tracked extensions linked in one by one, and a file a machine adds there stays that machine's. pi follows the links, and skips a dangling one silently, so an extension deleted from the repo leaves a harmless stale link. The old directory link is removed first: linking into it would write through to the repo and turn its files into links to themselves. Only tracked files are linked, so a machine's leftovers in the repo's directory are not linked back. The filed version put this loop in link.sh; it lives in link/pi.sh, since link.sh holds one-line links only and a part also obeys ~/.config/dot/skip. From change request 3f6b05.
2026-09-25link/pi.sh: the generators move into files, and parse under bash 3.2 againIgor Soarez
57e49dd made link/pi.sh unparseable on macOS. bash 3.2 does not skip heredoc content when it scans for the end of a command substitution, so the three apostrophes in a comment inside the new heredoc read as an unterminated quote and the script stopped parsing at end of file. ./link.sh on a Mac aborted partway: settings still generated, models.json stayed the symlink the commit meant to replace, and everything after that point never ran. Linux was fine, and so was every check I ran -- `bash` on a Mac with Homebrew is 5.x, which parses it happily. Reported from the machine it broke. Rewording the comment would fix it and leave the trap armed for the next edit, so the two python programs move into link/pi-settings.py and link/pi-models.py instead, called by path. The text is unchanged; there is no longer a heredoc inside $( ) to trip over, and both files now compile-check on their own. Verified under /bin/bash 3.2: first apply replaces both symlinks, a package removed by hand still survives a relink, fragments merge for settings and for models, and repeat runs report unchanged.
2026-09-25pi: providers can come from ~/.config/pi/models.d, like settings already doIgor Soarez
models.json was a plain symlink to the tracked file, which left a machine whose models are served from somewhere other than a vendor's own API with nowhere to say so. pi reads providers from exactly one path -- join(getAgentDir(), "models.json") -- and a `providers` block in a settings fragment is inert, because the settings schema has no such key. So on such a machine pi cannot be used at all, and the endpoint is not something this repo may name. link/pi.sh now generates models.json the way it already generates settings.json: the repo's file, then every ~/.config/pi/models.d/*.json. No three-way merge here -- pi never writes this file, keeping runtime state in the sibling models-store.json -- so a hand-edit of ~/.pi/agent/models.json no longer survives a relink. Put it in a fragment. It reports which provider came from which fragment, added or replaced, so a local file shadowing a provider the repo ships cannot do it quietly. Proposed as a change request from the machine that needs it; verified here against pi 0.84.2 before applying.
2026-09-17dotfilesIgor Soarez
Shell, editor and terminal configuration, the tools that go with them, and szecret, an age-based secret manager whose store lives elsewhere. History restarts here. What came before was not written to be read by anyone else, and carried machine names, addresses and an encrypted secret store; it is kept privately instead. What is left is meant to be safe on any machine, including one whose owner is not me: see CLAUDE.md for the rule it is written to.