feat: add workspace-ideas plugin#16
Open
ZoRDoK wants to merge 5 commits into
Open
Conversation
7485390 to
b4dd227
Compare
Adds a bundled "Ideas" workspace panel that lets users capture short
ideas, run each one in a new git worktree + Pi session, and mark them
done. State lives in .pi-web/ideas.json.
Plugin (pi-web-plugins/workspace-ideas):
- Captures ideas, persists them in .pi-web/ideas.json via public
WorkspaceFiles.writeFile.
- Warns if .pi-web/ is not gitignored, offers one-click fix.
- Run starts a Pi session in a fresh idea worktree via
WorkspacePanelSessions.startWithPrompt({ newWorkspace, ideaId }).
- Done archives the idea and keeps a link to its session.
Core changes (minimal seams):
- WorkspaceFiles.writeFile in the public plugin API.
- WorkspacePanelSessions.startWithPrompt seam to start a session in a
new idea worktree without changing focus and refresh host state.
- PUT /api/.../workspaces/:id/file and POST /api/.../idea-workspace
routes (path-escape guarded).
- .gitignore: ignore .pi-web/ in this repo.
Previously `git worktree add` ran with `-C project.path` and no start-point, so the new worktree was always based on the HEAD of the main worktree (usually main) regardless of which workspace the user had selected. Run it with `-C workspace.path` and an explicit `HEAD` start-point so the idea branch forks from the currently selected workspace's branch.
The Fix button silently swallowed write errors and never re-read the gitignore status, so the warning could stay visible after a failed or no-op write. Wrap fixGitignore in try/catch, re-load gitignore state from disk after writing, and show an explicit success or error status.
e47610a to
724695c
Compare
Owner
|
I wonder if you would want to publish your plugin as an npm package instead? I have not looked at the code but seems like if you only use the plugin API, it should be doable. |
Owner
|
And any API changes needed I am more than happy to merge to make PI WEB easier to extend |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a bundled Ideas workspace panel for capturing short ideas and turning each one into a fresh git worktree + Pi session.
Plugin (
pi-web-plugins/workspace-ideas).pi-web/ideas.jsonvia the publicWorkspaceFiles.writeFileAPI..pi-web/is not gitignored, with a one-click fix.WorkspacePanelSessions.startWithPrompt({ newWorkspace, ideaId }), copying the current model and sending the idea text as the first prompt. Focus stays on the panel.Core changes (minimal seams)
WorkspaceFiles.writeFile(path, content)added to the public plugin API.WorkspacePanelSessions.startWithPrompt(prompt, { newWorkspace, ideaId })seam — host handles worktree creation, session start, model copy, and state updates without changing focus.PUT /api/.../workspaces/:id/file(path-escape guarded)POST /api/.../workspaces/:id/idea-workspace(creates a sibling git worktree).gitignore: ignore.pi-web/.Verification
npm run verify(typecheck + lint + tests, 421 passed).The plugin only uses public plugin APIs — the
pluginPublicApiinvariant test still passes.