Skip to content

feat: add workspace-ideas plugin#16

Open
ZoRDoK wants to merge 5 commits into
jmfederico:mainfrom
ZoRDoK:feat/workspace-ideas-plugin
Open

feat: add workspace-ideas plugin#16
ZoRDoK wants to merge 5 commits into
jmfederico:mainfrom
ZoRDoK:feat/workspace-ideas-plugin

Conversation

@ZoRDoK

@ZoRDoK ZoRDoK commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

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)

  • Capture ideas, persisted to .pi-web/ideas.json via the public WorkspaceFiles.writeFile API.
  • Warns if .pi-web/ is not gitignored, with a one-click fix.
  • Run starts a Pi session in a new idea worktree via WorkspacePanelSessions.startWithPrompt({ newWorkspace, ideaId }), copying the current model and sending the idea text as the first prompt. Focus stays on the panel.
  • Done archives the idea and keeps a link to its session.

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.
  • New routes:
    • 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 pluginPublicApi invariant test still passes.

@ZoRDoK ZoRDoK force-pushed the feat/workspace-ideas-plugin branch from 7485390 to b4dd227 Compare June 9, 2026 06:32
ZoRDoK added 4 commits June 13, 2026 00:12
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.
@ZoRDoK ZoRDoK force-pushed the feat/workspace-ideas-plugin branch from e47610a to 724695c Compare June 12, 2026 21:12
@jmfederico

Copy link
Copy Markdown
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.

@jmfederico

Copy link
Copy Markdown
Owner

And any API changes needed I am more than happy to merge to make PI WEB easier to extend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants