|
| 1 | +# NEXT.md — handoff for the next LLM |
| 2 | + |
| 3 | +You are continuing an in-progress effort to build out **out-of-tree plugins |
| 4 | +for JavaScript Solid Server (JSS)** and, through them, discover what the |
| 5 | +#206 plugin api is missing. Read this first, then `AGENT.md` (how to build a |
| 6 | +plugin), `NOTES.md` (the findings/seams — the real deliverable), and |
| 7 | +`ISSUES.md` (the plugin-tagged backlog triaged). |
| 8 | + |
| 9 | +## Where things stand |
| 10 | + |
| 11 | +- **24 plugins, ~270 tests, all green** (`npm test`), all pushed to |
| 12 | + `github.com/JavaScriptSolidServer/plugins` (branch `gh-pages`). |
| 13 | +- `compose.test.js` boots all 24 on **one** JSS from pure config; `serve.js` |
| 14 | + is the runnable demo. Both must be updated when you add a plugin. |
| 15 | +- Built so far: 6 ports (relay, webrtc, terminal, tunnel, notifications, |
| 16 | + pay) + 18 features (nip05, corsproxy, capability, webdav, sparql, |
| 17 | + gitscratch, otp, carddav, mastodon, bluesky, caldav, webfinger, |
| 18 | + activitypub, rss, matrix, search, didweb, s3). |
| 19 | +- Capability classes covered: realtime, WebDAV family, fediverse/social/chat |
| 20 | + (5 shims), identity, data/query/search, object storage, proxy, dev, pay. |
| 21 | + |
| 22 | +## The hard rule (don't break it) |
| 23 | + |
| 24 | +1. A plugin's `plugin.js` imports **only** node builtins, this repo's deps |
| 25 | + (`@noble/curves`, `ws`), and `javascript-solid-server/auth.js`. **Never |
| 26 | + `javascript-solid-server/src/...`.** A wall you can't cross without an |
| 27 | + internal *is a finding* — document it, approximate honestly, move on. |
| 28 | +2. **Do NOT modify the JavaScriptSolidServer core repo** (no commits, |
| 29 | + branches, or PRs there). Everything goes in *this* repo. (The maintainer |
| 30 | + set this explicitly. Two core PRs — #590 `api.mountApp`, #591 |
| 31 | + `/idp/refresh` — are already open and awaiting their call; leave them.) |
| 32 | +3. Core is at `~/remote/github.com/JavaScriptSolidServer/JavaScriptSolidServer`, |
| 33 | + pinned to 0.0.215 on `gh-pages`. You may **read** it for reference; keep |
| 34 | + it clean. |
| 35 | + |
| 36 | +## Immediate next step: finish Wave 7 |
| 37 | + |
| 38 | +Four plugins were *planned but not yet built* — this is where to resume: |
| 39 | + |
| 40 | +| Plugin | What | Copy from | |
| 41 | +|---|---|---| |
| 42 | +| `webhooks/` | change-notification webhooks; **must poll** (no `api.events`) → the canonical 5th consumer of that seam, and a real integration primitive | notifications/ (fs.watch), rss/sparql (container walk) | |
| 43 | +| `micropub/` | IndieWeb Micropub server — POST creates a post in the pod | mastodon/ (auth + pod write via loopback) | |
| 44 | +| `webmention/` | IndieWeb Webmention receiver — store incoming mentions in the pod | activitypub/ inbox, capability/ | |
| 45 | +| `backup/` | pod container → `.tar.gz` download (data portability); hand-roll tar headers + `node:zlib` gzip (no deps) | webdav/rss (container walk) | |
| 46 | + |
| 47 | +Dispatch each as its own worker into its own directory (they don't conflict |
| 48 | +— separate subdirs, shared files touched only by you at integration time). |
| 49 | +Verify each with `node --test --test-concurrency=1 <name>/test.js`, then: |
| 50 | + |
| 51 | +## The per-plugin loop (do this for every plugin) |
| 52 | + |
| 53 | +1. Build `<name>/{plugin.js,test.js,README.md}` per `AGENT.md`. README must |
| 54 | + have a `## Findings` section — the findings are the point. |
| 55 | +2. `node --test --test-concurrency=1 <name>/test.js` → green. |
| 56 | +3. `git add <name>/ && git commit && git push` (commit message: what it |
| 57 | + does + its headline finding; **no AI-generated footer/trailer** — the |
| 58 | + maintainer's global rule). |
| 59 | +4. After a wave lands, integrate: add entries to `compose.test.js` and |
| 60 | + `serve.js` (give each an explicit `id`; add any fixed roots to their |
| 61 | + `appPaths`), add a liveness probe to `compose.test.js`, run `npm test`, |
| 62 | + update `README.md` (table + count), `ISSUES.md` (tally), `NOTES.md` |
| 63 | + (fold in new findings, re-rank seams by consumer count), and `AGENT.md` |
| 64 | + (copy-map + count). Commit + push the integration. |
| 65 | + |
| 66 | +## Wave 8+ backlog (unbuilt ideas, roughly by value) |
| 67 | + |
| 68 | +Still genuinely plugin-shaped and distinct: |
| 69 | +- **JMAP** email API over pod messages (HTTP/JSON, unlike stateful IMAP). |
| 70 | +- **oEmbed** provider for pod resources (link unfurling). |
| 71 | +- **feed ingest** — subscribe to external RSS/Atom, store items in the pod |
| 72 | + (the inverse of `rss/`; uses a corsproxy-style fetch). |
| 73 | +- **healthz / Prometheus `/metrics`** and a **plugin status dashboard** |
| 74 | + (ops; the dashboard is a nice meta-demo listing all loaded plugins). |
| 75 | +- **link-shortener**, **WebSub/PubSubHubbub** (needs `api.events`), |
| 76 | + **SPARQL UPDATE** (extends `sparql/`), **CalDAV scheduling/free-busy** |
| 77 | + (extends `caldav/`), **remoteStorage** (another bundled-feature port). |
| 78 | +- **Bluesky/Mastodon/Matrix Phase-2** (federation, `/sync` live push) — |
| 79 | + these are blocked on `api.events` + `api.reservePath`; good once those |
| 80 | + seams exist, otherwise document the wall. |
| 81 | + |
| 82 | +Prefer plugins that open a **new capability class** or add a **new |
| 83 | +independent consumer of an already-named seam** (that strengthens the |
| 84 | +finding). Avoid re-proving something already witnessed many times unless |
| 85 | +it sharpens the case. |
| 86 | + |
| 87 | +## The findings are the deliverable — keep them sharp |
| 88 | + |
| 89 | +`NOTES.md` ranks candidate seams by how many independent plugins demanded |
| 90 | +each. Current top four (keep this current as you add consumers): |
| 91 | + |
| 92 | +1. **`api.authorize(request, path, mode)`** — 3 consumers; the top |
| 93 | + *blocking* seam (authority the requester doesn't drive). |
| 94 | +2. **`api.events.onResourceChange`** — 4 consumers; matrix `/sync` needs |
| 95 | + live push. Every "react to writes" plugin (webhooks, WebSub, indexing) |
| 96 | + will want it — webhooks/ (wave 7) makes it 5. |
| 97 | +3. **`api.reservePath`** — every API-shim owns fixed roots outside its one |
| 98 | + prefix and can't self-exempt; didweb needs a *parameterized* form. |
| 99 | +4. **`api.serverInfo`** — broadest (~10 plugins hand-roll their origin). |
| 100 | + |
| 101 | +Plus: the unconsumed-body-**stream** primitive (#583), `api.mcp.registerTool` |
| 102 | +(blocks the MCP-tool issues #495/#496/#500/#501), can't-set-server-options, |
| 103 | +and response-header hooks. `#564` (the core/plugin line) is answered |
| 104 | +empirically in NOTES: **route-owning → plugin, pipeline-modifying → core**. |
| 105 | + |
| 106 | +## Meta-work worth doing (beyond more plugins) |
| 107 | + |
| 108 | +- **A summary write-up** the maintainer can act on: "the plugin api reaches |
| 109 | + N of ~40 tagged issues; here are the M seams to add next, ranked, each |
| 110 | + with consumers." Half of this exists in `ISSUES.md`/`NOTES.md` already. |
| 111 | +- **Filing the seams as upstream issues** — but only if the maintainer asks |
| 112 | + (core-repo interaction is currently off; see the hard rule). Draft them |
| 113 | + here first if so. |
| 114 | + |
| 115 | +## Footguns (every multi-boot test suite rediscovered these) |
| 116 | + |
| 117 | +- Module-global `DATA_ROOT`: a second `createServer` in one process (even a |
| 118 | + failing one) poisons the first — order validation-failure tests *before* |
| 119 | + the long-lived boot. |
| 120 | +- Ambient `~/.gitconfig` for git-shelling plugins: spawn with |
| 121 | + `GIT_CONFIG_NOSYSTEM=1`, no `HOME`. |
| 122 | +- Generic-basename id: `<name>/plugin.js` all reduce to `plugin` — always |
| 123 | + pass an explicit `id` in compose/serve entries. |
| 124 | +- Dotted prefixes (`/.foo`) fail the WS upgrade — use plain prefixes for |
| 125 | + anything with a socket. (`/.well-known/*` HTTP works, by core's blanket |
| 126 | + exemption — but that's the reserved-path finding, not a guarantee.) |
| 127 | + |
| 128 | +## Open items for the human (don't act without a nudge) |
| 129 | + |
| 130 | +- The repo exists and is public; keep pushing to it. |
| 131 | +- Core PRs #590 / #591 are unmerged — the maintainer's call. |
| 132 | +- Whether to ever file the seam issues upstream — ask first. |
0 commit comments