Commit Graph
25 Commits
Author SHA1 Message Date
Federico Jaramillo Martinez 3f36394c17 fix: wait for git file suggestion probes before fallback 2026-07-01 09:39:59 +02:00
Federico Jaramillo Martinez e46d9ecbf8 feat: add safe manual workspace uploads 2026-06-25 15:16:44 +02:00
Federico Jaramillo Martinez a0dd9e1cd7 Merge branch 'main' into cleanup/plugin-api-scope 2026-06-24 08:49:49 +02:00
Federico Jaramillo Martinez 2bb6e48a8b fix: normalize Windows path suggestions 2026-06-23 20:03:44 +02:00
Federico Jaramillo Martinez 9cc20d65fb feat: add external path access allowlist 2026-06-23 12:30:30 +02:00
Federico Jaramillo Martinez 3742bcc962 refactor(plugin-api): trim plugin API scope to grounded capabilities
Builds on marcus's plugin-api-completeness work. Narrows the new plugin
surface to capabilities that expose real, otherwise-unreachable pi-web
functionality, and drops invented/duplicative surfaces:

Kept:
- files.writeFile / deleteFile / moveFile (genuine workspace mutation,
  federated, path-safe)
- prompt.insertText / getText / getSelection (editor state access)

Dropped:
- attachments.* (insertFileReference/getAttachedFiles/removeFileReference):
  getAttachedFiles invented a structured-attachment notion pi-web does not
  have and duplicated prompt.getText() + a regex with a false email-safety
  claim; insert/removeFileReference were thin sugar over readFile +
  insertText that plugins can compose themselves.
- prompt.onPaste / onKeyDown: an incomplete two-event hook system shaped
  around a single use case, overlapping the editor's native image-paste
  handling. Deferred until a real editor event/hook surface is designed.
- prompt.focus: redundant and buggier duplicate of the existing
  focusPrompt() (silently no-ops when not on the chat view). Focus stays
  as focusPrompt().

Security fix:
- deleteWorkspaceFile now resolves the parent via realpath + ensureInside
  before lstat/unlink, closing a symlinked-parent-directory escape that
  allowed deleting files outside the workspace (write/move already did
  this). Final path component is still not resolved, so deleting a symlink
  removes the link, not its target. Adds a regression test.

Docs and the registry test mock updated to match the trimmed surface.
2026-06-14 23:16:37 +02:00
marcus 27a3b2b5ed feat: Plugin API Completeness — file mutations, prompt editor, and attachment APIs
- WorkspaceFiles: writeFile, deleteFile, moveFile with path safety
  - writeFile: text/binary, auto-create dirs, overwrite option
  - deleteFile: idempotent, uses lstat (removes symlinks not targets)
  - moveFile: unix mv semantics, overwrite defaults to false
  - All mutations auto-refreshFiles() in File Explorer
  - Symlink escape prevention via realpath(dirname) check

- PluginPromptEditor: insertText, getText, getSelection, onPaste, onKeyDown, focus
  - Uses CM6 EditorView.domEventHandlers() via Compartment (not raw DOM)
  - Handlers registered before mount are preserved and applied on mount
  - First-to-consume-wins ordering for multi-plugin scenarios
  - insertText replaces selection (not inserts after)

- PluginAttachments: insertFileReference, getAttachedFiles, removeFileReference
  - insertFileReference validates file exists before inserting @path
  - Does not auto-focus editor (unlike prompt.insertText)
  - @file regex requires file extension to avoid matching emails

- Server endpoints: PUT /file, DELETE /file, POST /file/move
  - All work for local and federated machines

- Tests: 31 unit tests, 9 integration tests, 5 client tests
- Docs: 3 new sections in plugins.md
2026-06-14 15:03:23 +02:00
Federico Jaramillo Martinez d66eccc5c0 fix: handle spaced file suggestions 2026-06-11 12:09:27 +02:00
Federico Jaramillo Martinez 9c3dafc4d4 fix: close workspace terminals before deletion 2026-06-04 21:31:39 +02:00
Federico Jaramillo Martinez 753b8bbc8a Merge remote-tracking branch 'origin/main' into review/pr-5-machine-federation-fixes
# Conflicts:
#	src/client/src/api/clients.ts
#	src/client/src/components/PiWebApp.ts
#	src/client/src/components/PromptEditor.ts
#	src/server/app.ts
#	src/server/terminalProxyRoutes.ts
#	src/server/workspaces/fileSuggestions.ts
2026-06-02 17:42:16 +02:00
Federico Jaramillo Martinez fdd2cf2390 fix: improve file mention suggestions without ripgrep 2026-05-31 20:04:59 +02:00
Federico Jaramillo Martinez 5e2afc1ffa fix: harden machine federation boundaries 2026-05-28 20:49:25 +02:00
Marc Kassubeck 3270619f24 test: make server tests pass on Windows 2026-05-26 13:04:00 +02:00
Federico Jaramillo Martinez a1e903f8f9 feat: add file browser image previews 2026-05-22 15:36:24 +02:00
Federico Jaramillo Martinez 045f4e247a Handle missing selected workspace files 2026-05-11 10:41:33 +02:00
Federico Jaramillo Martinez 8b355f414b Hide Git panel outside repositories 2026-05-08 15:39:37 +02:00
Federico Jaramillo Martinez e4293bbd9c test: cover workspace file services 2026-05-08 08:44:26 +02:00
Federico Jaramillo Martinez a77012ba83 test: add vitest unit coverage 2026-05-07 23:50:25 +02:00
Federico Jaramillo Martinez d7cb7ed655 refactor: share api dto types 2026-05-07 23:45:13 +02:00
Federico Jaramillo Martinez ef63a7a063 chore: fix lint baseline 2026-05-07 23:43:10 +02:00
Federico Jaramillo Martinez ba8f74bee2 Add workspace side panel with files and git 2026-05-07 23:27:38 +02:00
Federico Jaramillo Martinez 34994705e4 Align web at-space completion with TUI 2026-05-07 23:27:09 +02:00
Federico Jaramillo Martinez eb59f1eb00 Add paged chat history loading 2026-05-07 15:46:08 +02:00
Federico Jaramillo Martinez bb93c0fef1 Add prompt autocomplete and session status 2026-05-07 12:05:28 +02:00
Federico Jaramillo Martinez adf9087e84 Add pi web POC 2026-05-07 11:12:23 +02:00