Scaffold the penpot extension directory and register it in the repo manifest #186
Labels
No labels
bug
chore
documentation
enhancement
feature
ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
david/pi-extensions-and-skills#186
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Create the initial scaffold for a new pi extension,
penpot, atextensions/penpot/in this repository — a minimal but loadable entry point, ansrc/directory for the modules later issues fill in, and a placeholderREADME.md— and register it in the rootpackage.jsonpi.extensionsmanifest so pi loads it.Background
This is a brand-new extension (TypeScript) that will expose a
penpot_*tool family for creating designs against Penpot's access-token RPC API (POST/GET <PENPOT_URL>/api/rpc/command/<command>, headerAuthorization: Token <token>). Nothing penpot-related exists in this repo yet — this step builds from scratch and is a prerequisite for every later penpot issue.Repo conventions this step must follow:
extensions/<name>/, registered by path in the rootpackage.jsonunder"pi": { "extensions": [...] }.export default function (pi: ExtensionAPI): void { ... }. Bothextensions/learn-repo/index.tsandextensions/victorialogs/index.tsshow this shape.extensions/learn-repo/is the closest structural precedent: it has no per-extensionpackage.json, notsconfig.json, and no bundler — it is a plain module tree tested by the rootnpm testscript withnode --test(Node 24 strips TypeScript types natively;.tsimports use explicit extensions). Follow that pattern rather than the bun-basedextensions/mongodb//extensions/victorialogs/packages.package.jsonalready hastypeboxas a dependency, so no new dependency is needed. This extension's own runtime deps are Node built-ins (fetch,FormData,Blob,node:test).This step deliberately registers no tools —
penpot_whoamiarrives in a later step of the same milestone. The entry point must still be valid and load cleanly so that/reloadin pi does not error.Documentation Required
A separate process downloads these into the listed folders before this issue is implemented. Check the folders for the actual reference material before starting.
docs/reference/pi-coding-agent/ExtensionAPItype, the default-exported factory,pi.registerTool, and how extensions are discovered from a package manifest. This is the primary reference for the entry-point shape."pi": { "extensions": [...], "skills": [...] }fields that must be updated here.ExtensionAPIimport.docs/reference/typebox/Type.Object,Type.String,Type.OptionalandType.Static<typeof T>. Needed here only to confirm the dependency is available from the root manifest; the schemas themselves arrive in later issues.Implementation Details
Create the following under
extensions/penpot/:src/index.ts— the extension entry point. A default-exported factory matching the sibling extensions:Keep the registration site so later steps only add
pi.registerTool(...)calls. Do not readPENPOT_URL/PENPOT_TOKENor perform any network call at load time — later steps resolve configuration lazily per call so a misconfigured environment never breaks extension loading.README.md— a minimal placeholder (title plus a one-line description such as "Penpot design-creation tools for pi — create colour/typography assets, compose screens and instance library components over the Penpot RPC API."). Full content (tool reference, env vars, safety model) is written in a later documentation step.src/— the directory the later modules (env.ts,errors.ts,client.ts,changes.ts,svg.ts,binfile.ts) will live in. It is fine for it to contain onlyindex.tsat this stage.Then register the entry point in the root
package.json:Do not touch
"skills"(a later milestone addsskills/penpot/), do not add the new test files toscripts.testyet (they do not exist — a later step registers them), and do not reorder or reformat the existing extension entries beyond appending.Acceptance Criteria
extensions/penpot/src/index.tsexists and default-exports a factory that accepts anExtensionAPIargument and registers nothing.package.jsonpi.extensionsarray contains"extensions/penpot/src/index.ts", appended without altering existing entries.extensions/penpot/src/exists as a directory.extensions/penpot/README.mdexists with at least a title and a one-line description of the extension.node --testat the repo root andnpm teststill pass unchanged (no regressions from the manifest edit).package.json/tsconfig.jsonis introduced.Test Plan
Validate the manifest is still valid JSON and the new path is present:
Confirm the entry point is syntactically loadable and registers nothing:
Run the existing suite to confirm no regression:
In pi, run
/reloadand confirm no extension-load error is reported forpenpot(no penpot tools are expected to appear yet).pi-loop opened and merged a pull request for this issue: #219