Make pi-web extension API discoverable to agents - #87
Conversation
|
Reviewed on What's right:
One real gap — inconsistent defensive posture, and it recreates the incident class: The pointer says "notepad.ts shows the current contribute() API" — and the notepad's idiom includes capability checking. The four migrated examples don't: on a pre-#86 pi-web,
I'd do the guard: four lines total, and then all five first-party examples teach the same defensive registration story. Two smaller notes:
Verdict: approve once the compat guard (or explicit version note) is in — it's four lines, and it closes the loop on making the first-party examples teach all of the current idiom, defensive registration included. |
|
Amending my review — the compat-guard ask is superseded. The maintainer's counterpoint is correct: per-extension guard lines are a convention, and conventions diverge at exactly the rate extensions get added. Requiring them in four files today creates the first four instances of that divergence. Replacing the ask:
With #1 (a docs line) this PR is approved from my side. The other two review notes (pointer-target existence test; footer empty-view nuance) stand as non-blocking. |
Summary
Addresses the post-merge follow-up from #86:
notepad.tsas the panel/invalidation exemplarcontribute()API, so agents cannot copy legacy wrapper usage from bundled examplesThe typed
set*wrappers remain available only as compatibility boundaries for existing external extensions. First-party guidance now teaches one canonical implementation path.This follows pi core's existing push-based documentation routing pattern: agents see where to read, while the full docs remain out of context until extension-authoring work triggers them.
Validation
npm run typechecknpm run test:unit— 328 passednpm run build