Commit Graph
221 Commits
Author SHA1 Message Date
Pi Web Agent bd28c93cfe feat: unify Docker entrypoint 2026-06-29 11:27:47 +00:00
Pi Web Agent 4a1136eac2 chore(changesets): consolidate docker release note 2026-06-27 23:09:04 +00:00
Pi Web Agent 2987b6f282 feat(docker): add fail-closed host profiles 2026-06-27 23:05:40 +00:00
Pi Web Agent 3ef3643f64 fix(docker): include compose and persist home 2026-06-25 19:46:24 +00:00
Pi Web Agent fb2134c775 Merge remote-tracking branch 'origin/main' into feat/docker-runtime-host-admin
# Conflicts:
#	README.md
2026-06-25 18:58:44 +00:00
Federico Jaramillo Martinez e46d9ecbf8 feat: add safe manual workspace uploads 2026-06-25 15:16:44 +02:00
Federico Jaramillo Martinez f0b779b062 Merge pull request #32 from gilbertwong96/fix/fish-doctor-version-check
fix: run doctor version checks under fish
2026-06-25 14:47:34 +02:00
Federico Jaramillo Martinez 446f588324 Merge branch 'main' into fix/persist-subsession-links 2026-06-25 11:09:18 +02:00
Federico Jaramillo Martinez b14205e523 feat: add inline Git diff highlights 2026-06-25 10:57:28 +02:00
Gilbert 47c9b66819 fix: run doctor version checks under fish
The doctor "can find npm/pi" checks wrap the version command in a POSIX
subshell, `(cmd --version 2>&1 || true)`. Fish treats `( ... )` as command
substitution syntax and forbids it in command position, so every fish user saw
false-negative failures:

  fish: command substitutions not allowed in command position
  command -v npm && (npm --version 2>&1 || true)

Branch on the detected service shell and emit fish's `begin; ...; end`
grouping for fish, mirroring the existing fish-aware quoting in
serviceShellQuote. Bash and zsh keep the POSIX subshell.

Also guard the `main()` invocation with an ESM main-module check so the CLI
helpers can be imported by tests without side effects, and add a regression
test covering the bash, zsh, and fish command shapes.
2026-06-25 10:54:49 +08:00
Federico Jaramillo Martinez a99696bd09 fix: persist tracked subsession links 2026-06-25 00:20:19 +02:00
Federico Jaramillo Martinez 9980027cee feat: expose prompt helper to workspace panels 2026-06-24 23:59:39 +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 bf36df24fd chore(release): v1.202606.5 2026-06-23 21:37:02 +02:00
Federico Jaramillo Martinez 2bb6e48a8b fix: normalize Windows path suggestions 2026-06-23 20:03:44 +02:00
Federico Jaramillo Martinez c2e2a29847 docs: add PI WEB configuration reference 2026-06-23 19:58:36 +02:00
Federico Jaramillo Martinez 6933d3aa88 fix: guard stale mobile navigation focus 2026-06-23 15:01:05 +02:00
Federico Jaramillo Martinez 4f4c6fa794 fix: proxy remote session reloads 2026-06-23 14:44:24 +02:00
Federico Jaramillo Martinez 9cc20d65fb feat: add external path access allowlist 2026-06-23 12:30:30 +02:00
Pi Web Agent f94424c43b fix: name docker runtime user 2026-06-21 22:51:29 +00:00
Pi Web Agent f8982a9947 feat(docker): migrate images to openSUSE Tumbleweed 2026-06-21 22:17:30 +00:00
Pi Web Agent 784a27a7ac feat(docker): add custom image hooks 2026-06-21 17:41:27 +00:00
Pi Web Agent 92e87ff1e4 fix(docker): run hostexec as container user 2026-06-21 17:40:45 +00:00
Federico Jaramillo Martinez 3e52939aad fix(docker): initialize dev data permissions 2026-06-20 23:45:04 +02:00
Federico Jaramillo Martinez a0d60215ca feat(docker): share dev data with runtime 2026-06-20 23:28:35 +02:00
Federico Jaramillo Martinez b9b03d9858 docs(docker): document runtime and dev usage 2026-06-20 22:24:56 +02:00
Federico Jaramillo Martinez fb36f48fea feat(docker): add development compose setup 2026-06-20 22:18:15 +02:00
Federico Jaramillo Martinez 1fa1726083 feat(docker): add one-liner installer 2026-06-20 22:08:19 +02:00
Federico Jaramillo Martinez 099d770eeb feat(docker): add host command bridge 2026-06-20 21:58:53 +02:00
Federico Jaramillo Martinez 997b821717 feat: add check_subsession and an exploratory read_subsession transcript reader
Split subsession inspection into two tools: check_subsession gives a quick
glance (status + latest assistant output), while read_subsession reads through
a child's transcript with role/content filters, full-content substring search
(including tool-call args), optional per-value maxChars truncation that flags
clipped parts, includeToolArgs, and pagination.

Filtering and search run on full untruncated content; truncation is an explicit,
caller-owned final projection (no default) so a narrow read never silently hides
a match. Empty page-windows are distinguished from zero-match results.
2026-06-19 23:48:12 +02:00
Federico Jaramillo Martinez 62c2234b85 fix: avoid duplicate skill loading cards 2026-06-19 23:44:58 +02:00
Federico Jaramillo Martinez 27bc924d4c fix: persist subsessions setting 2026-06-18 22:17:56 +02:00
Federico Jaramillo Martinez d93110135b fix: dead-key/IME input in terminal (e.g. Swedish ~) 2026-06-18 12:00:03 +02:00
Federico Jaramillo Martinez 355ebe8cf8 feat(sessions): add tracked subsessions behind a beta flag
Add spawn_subsession / list_subsessions / read_subsession tools that let an
agent start child sessions it stays attached to: the child records its parent
in the session tree, the parent is notified (as a system-authored custom
message that wakes an idle parent and queues behind in-flight work) when the
child stops working, and the parent can inspect children's status and result.

Gated behind a beta flag, off by default, mirroring spawnSessions: enable via
PI_WEB_SUBSESSIONS, the subsessions config key, or the Settings toggle. Also
requires spawnSessions.

Also fix the release skill so the version step resyncs package-lock.json
(npm install --package-lock-only) and the commit step refuses a release where
package.json and package-lock.json versions disagree.
2026-06-17 12:13:23 +02:00
Federico Jaramillo Martinez ebe65b7565 chore(release): v1.202606.4 2026-06-17 01:11:12 +02:00
Federico Jaramillo Martinez 82db7caeac docs: update changeset to drop removed message accent stripe 2026-06-17 01:04:05 +02:00
Federico Jaramillo Martinez 32d11de38c Rename attachment folder from .pi-web/paste to .pi-web/attachments
Attachments can be pasted, dropped, or uploaded, so 'paste' was too
narrow. Rename the default folder and filename prefix accordingly and
update the changeset reference.
2026-06-17 01:02:33 +02:00
Federico Jaramillo Martinez 3930505450 Fix stuck "Catching up…" badge after session goes idle
The stream catch-up mode was represented by two fields that could drift:
the private catchupStreamSessionId guard (which suppresses live transcript
events while the in-flight message prefix is missing) and the public
isReceivingPartialStream flag (which drives the badge). The socket reconnect
path (refreshSelectedSession) set the flag from status without updating the
guard, so a later idle status.update was skipped by the guard check and the
badge never cleared.

Route every mutation of the mode through a single setStreamCatchup helper so
the guard and badge can't disagree, and clear the mode on any non-streaming
status for the selected session.
2026-06-17 00:43:53 +02:00
Federico Jaramillo Martinez dd23b3e054 fix(sessions): dedupe started session when created broadcast races
The session.created global event (added with spawn_session) could arrive
in the initiating tab before the start request's HTTP response resolved.
applyCreatedSession inserted a plain session row (archive/reload actions)
and then startSession unconditionally prepended the cached version (delete
action), leaving two badges with the same id.

Make the optimistic insert idempotent by filtering out any existing entry
with the same id before prepending the cached session, so the locally
cached session always wins regardless of event ordering.
2026-06-16 23:40:47 +02:00
Federico Jaramillo Martinez 95c151233a feat: let agents start new sessions via spawn_session tool
Add a project-scoped spawn_session tool so agents can dispatch new,
independent sessions (ralph loops, long-plan chaining). Spawned sessions
are constrained to a workspace/worktree of the same registered project,
appear in the session list immediately via a new session.created event,
and the capability is on by default with a Settings -> Session daemon
toggle (spawnSessions / PI_WEB_SPAWN_SESSIONS).

Note: adds a session daemon code path, so pi-web-sessiond.service must be
restarted manually for the server side to take effect.
2026-06-16 14:53:37 +02:00
Federico Jaramillo Martinez 61f0b79d63 fix: move session reload action last 2026-06-15 14:15:56 +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 MartinezandClaude 9159da9353 feat(sessions): expose reload as a command-palette action and disable when busy
Add a "Reload Session" core action so reload is keyboard-accessible and can be
assigned a custom shortcut, gated by the same guards as the menu item (writable
session, sessions.reload capability, not currently busy). Disable the Reload
menu entry while the session has active work, mirroring the server guard and the
archived-delete control, so users get a clear reason instead of an error toast.

Co-authored-by: Claude <[email protected]>
2026-06-14 14:49:21 +02:00
Federico Jaramillo Martinez 82db15f894 fix(sessions): guard, gate, and test session reload
Build on the original Reload action with the fixes raised in review:

- Server reload() now refuses to run on archived (read-only) sessions
  and when the session has work in progress, mirroring archive(), so a
  reload can no longer silently abort an in-flight agent run.
- Add a sessions.reload runtime capability; the client gates both the
  reloadSession call and the Reload menu entry on it so the action only
  appears for machines whose Pi-Web runtime supports it.
- reloadSession ignores cached-new and archived sessions.
- Add server (PiSessionService + routes) and client (SessionController)
  tests covering reload success, the active-work guard, archived
  rejection, route forwarding, capability gating, and error mapping.
- Restore alphabetical parser import ordering in clients.ts.
- Add a changeset documenting the feature and the sessiond restart note.

Note: touches a session daemon code path, so pi-web-sessiond.service
must be restarted manually for the server side to take effect.
2026-06-14 14:17:51 +02:00
Federico Jaramillo Martinez ca30c970a7 refactor: source thinking levels from pi and make the gauge dynamic
Depend on @earendil-works/pi-agent-core so the ThinkingLevel union has a single source of truth (re-exported via shared/thinkingLevels). Wire/data fields use string and the parser is lenient, so an unknown level from a newer pi runtime is still listed, selectable, and rendered gracefully instead of throwing. The composer gauge now derives its bar count from the levels available for the current model and fills by rank. Adds compile-time drift guards (satisfies + Exclude check) and unit tests so a changed pi level set fails fast in development.
2026-06-14 13:47:44 +02:00
Federico Jaramillo Martinez 411e61ac75 feat: use icon actions in chat composer bar
Replace Send/Queue/Steer/Stop text buttons with compact icons, move Attach into the message box, and show the thinking level as a fill gauge. Keeps mobile layouts uncrowded while preserving accessible labels and the readable model selector.
2026-06-14 11:03:56 +02:00
Federico Jaramillo Martinez cfb7493384 Improve dark theme user/assistant message distinction
Add per-role left accent stripes and color-coded header labels across
all themes. Lighten the dark theme user-message background, decouple it
from the generic hover color, and brighten the user border so user and
assistant turns are clearly distinguishable.
2026-06-13 21:26:08 +02:00
Federico Jaramillo Martinez 886393a31e fix: scope the attachment sending indicator per session
isSendingPrompt was a single global flag, so an in-flight upload showed
the "Sending…" dock on whatever session/machine the user switched to.

Replace it with sendingPrompts, a Record<sessionId, true> keyed like
sessionStatuses/sessionActivities. The controller sets/clears the entry
for the originating session (captured before the await), the chat dock
reads only the selected session's entry, and the session list now shows
the activity dot for a session that is uploading so progress is visible
after switching away. Machine switches clear the record like other
per-session state; deselecting a session no longer cancels its indicator.
2026-06-13 21:09:31 +02:00
Federico Jaramillo Martinez ecede3ac7c refactor: drive attachment sending state through the chat activity dock
Replace the composer-local "Sending…" indicator with a single, consistent
state surfaced by the existing chat activity dock. The session controller
now owns the full attachment send lifecycle (including the folder-mode
upload + reference rewrite) and toggles an isSendingPrompt flag around it,
which the chat dock renders as "Sending your message…" until the real
server activity supersedes it.

This covers the pre-receipt dead zone (upload, server-side image resize,
first-session open) with one indicator instead of two, and keeps plain
text sends fire-and-forget.
2026-06-13 14:09:04 +02:00