packages/plugins/examples/plugin-file-browser-example/README.md
Example Paperclip plugin that demonstrates:
This is a repo-local example plugin for development. It should not be assumed to ship in a generic production build unless it is explicitly included.
| Slot | Type | Description |
|---|---|---|
| Files (sidebar) | projectSidebarItem | Optional link under each project → project detail + tab. |
| Files (tab) | detailTab | Responsive tree/editor layout with save support. |
Show Files in Sidebar — toggles the project sidebar link on or off. Defaults to off.Comment File Links — controls whether comment annotations and the comment context-menu action are shown.ui.sidebar.register — project sidebar itemui.detailTab.register — project detail tabprojects.read — resolve projectproject.workspaces.read — list workspaces and read paths for file accessworkspaces — ctx.projects.listWorkspaces(projectId, companyId) (ordered, primary first).fileList — { projectId, workspaceId, directoryPath? } → list directory entries for the workspace root or a subdirectory (Node fs).fileContent — { projectId, workspaceId, filePath } → read file content using workspace-relative paths (Node fs).writeFile — { projectId, workspaceId, filePath, content } → write the current editor buffer back to disk.From the repo root, build the plugin and install it by local path:
pnpm --filter @paperclipai/plugin-file-browser-example build
pnpm paperclipai plugin install ./packages/plugins/examples/plugin-file-browser-example
To uninstall:
pnpm paperclipai plugin uninstall paperclip-file-browser-example --force
Local development notes:
entrypoints.worker (e.g. ./dist/worker.js). Run pnpm build in the plugin directory before installing so the worker file exists.packages/plugins/examples/... existing on the host.package_path, the plugin may show status error (worker not found). Uninstall and install again so the server persists the path and can activate the plugin.paperclip-plugin-dev-server for UI hot-reload with devUiUrl in plugin config.src/manifest.ts — manifest with projectSidebarItem and detailTab (entityTypes ["project"]).src/worker.ts — data handlers for workspaces, file list, file content.src/ui/index.tsx — FilesLink (sidebar) and FilesTab (workspace path selector + two-panel file tree/editor).