Making it built in
A built-in module is a part of Pi Pocket itself, for each person who uses this copy. Make a module built in only when it changes Pi Pocket itself (Core or extension).
Write it as a drop-in first
Section titled “Write it as a drop-in first”The running server loads a new file in src/server/extensions/ a moment after you first save it. It is on, for everyone. There is no way to try it there first. So:
- Write the module as a drop-in.
- Check it on a copy of Pi Pocket (self-editing.md).
- Move it into
src/server/extensions/when it works.
Register it
Section titled “Register it”In src/server/reload.ts:
- Give the module its place in
ORDER, and its title inTITLES. - If it must start off, add it to
OFF_BY_DEFAULT. - Add the names of its tools to
BUILT_IN_TOOLS, so that no drop-in takes them, and plan mode trusts no read-only hint a drop-in’s wrap puts on them. No test checks this list: keep it in step by hand.
Name the extension pocket-….
reload.ts is not an extension, so these changes take effect at the next restart.
These pages describe Pi Pocket 0.14.0. Your copy has the pages of its own version in its docs/ folder.