Commit Graph
289 Commits
Author SHA1 Message Date
pastilhasandClaude Opus 4.8 6ce75db150 task runner: keepalive ping so long silent tasks don't get killed
a script task that goes silent for a while (e.g. ffmpeg's faststart pass rewrites
a huge file for minutes with no output) would hit Bun's default 120s websocket
idle timeout → close(ws) → killTree killed the task mid-run, corrupting the
output. now the executor pings the socket every 30s while a task runs, resetting
the idle timer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 22:09:43 +00:00
pastilhasandClaude Opus 4.8 a82ce9ecb0 drop inherited architecture docs that no longer match the code
AUTOMATION_CONTEXT.md and SIDECAR.md described the multi-tenant scope
model, the seed/ tree, the marketplace, and a single sidecar owning the
queue — all superseded. Fix the stale doc pointers in opencode.json and
CLAUDE.md, and point at TODO.md as the source of truth on direction.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 20:25:44 +01:00
pastilhasandClaude Opus 4.8 23b7df5fa9 task runner: kill the whole process tree on Stop
proc.kill() only signalled the direct child (bash), leaving a running ffmpeg
grandchild orphaned and still encoding. now killTree() walks /proc, SIGTERMs the
whole subtree (bash + ffmpeg), then SIGKILLs any straggler after 2s.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 15:05:23 +00:00
pastilhasandClaude Opus 4.8 e68c8edc23 task runner: "convert all, keep every track" option for mixed-layout folders
when a folder has mixed audio/subtitle layouts, the mismatch banner now offers a
toggle: convert the matching group (pick tracks, skip the rest) OR convert every
video keeping all audio + all subtitles (no picking, nothing skipped). the second
mode hides the pickers and clears the track-selection inputs so run.sh keeps
everything. only shown for tasks with track pickers (Convert Video).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 13:16:11 +00:00
pastilhasandClaude Opus 4.8 068cbfe32b file browser: run a task on a multi-selection
selecting several files/folders and running a task now runs it on the whole
selection instead of just the right-clicked item. reuses the folder + include
mechanism: the run targets the current folder scoped to the selected files
(and everything under selected folders). track-picker tasks scope their probe
to the selection too.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 08:38:39 +00:00
pastilhasandClaude Opus 4.8 821e7ab6c4 video player: fill the frame in fullscreen
the video used max-w/max-h so a low-res source stayed at native size surrounded
by black. switch to w-full h-full object-contain so it scales up to fill the
player (windowed and fullscreen) while preserving aspect ratio.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 07:13:11 +00:00
pastilhasandClaude Opus 4.8 a2ca5b0fcd task runner: subtitle_edit input type for the subtitle editor
renders each subtitle as a keep checkbox + editable label field, seeded from the
file's current tracks. reuses the existing probe / folder-grouping / include
plumbing, so it works on a single file or a whole season.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 06:04:20 +00:00
pastilhasandClaude Opus 4.8 ae1ccdec33 task runner: batch track selection for folders
converting a folder now recursively probes every video and groups episodes by
track layout (audio language+channels, subtitle language). the pickers are
driven off the largest matching group; episodes with a different layout are
listed as skipped and converted separately. adds a /probe-folder endpoint and
passes the majority file list to run.sh as INPUT_INCLUDE.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 05:21:01 +00:00
pastilhasandClaude Opus 4.8 0f2b71562a task runner: probe video files and let you pick which audio/subtitle tracks to keep
convert video's task modal now probes a single file on open, lists its audio
and subtitle tracks as inline checkboxes, and passes the selection to the
script. audio defaults to all kept, subtitles to none; a "none" sentinel keeps
empty (folder mode) meaning keep-all.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 04:47:09 +00:00
pastilhasandClaude Opus 4.8 8c9bb9a68e video player: server-side audio track selector
Add /file-browser/audio-tracks (list) and raw?audio=N (serve the video with
a chosen audio track via a cached -c copy remux, byte-range seekable). The
player shows an always-visible selector outside the controls; switching
reloads the source and restores the playhead. Works in Chromium, which
doesn't expose the audioTracks API.

Temp remux file keeps the real extension (a .tmp suffix breaks ffmpeg's
muxer selection); concurrent requests for a track share one remux.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 04:04:47 +00:00
pastilhasandClaude Opus 4.8 921413ca4d lower the task-completion chime volume to a quarter
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 02:48:01 +00:00
pastilhasandClaude Opus 4.8 06bd8a5821 video player: subtitle track support with a selector
Add /file-browser/subtitles (list text subtitle tracks) and /subtitle-vtt
(extract one as WebVTT on demand); the VideoRenderer fetches the list,
renders <track> elements, and shows a CC selector to switch/turn off subs.
Track labels prefer title, then handler_name (mp4), then a real language,
falling back to Track N — so untagged tracks aren't shown as "und".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 02:38:52 +00:00
pastilhasandClaude Opus 4.8 b9eb78c919 add header rescan button to apply officer-items changes without restart
New POST /api/rescan re-runs the boot item setup (ensureItemDirs +
ensureToolLoader) and returns live item counts; the header button calls it
and invalidates the item query caches so the UI refetches from disk.

Also fix ensure-tool-loader to write into OFFICER_ITEMS_DIR/extensions (the
runtime read path) instead of the now-unread DATA_PATH/extensions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 01:31:51 +00:00
pastilhasandClaude Opus 4.8 86a547b216 comment out the web inspector and bug report header buttons
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 01:23:23 +00:00
pastilhasandClaude Opus 4.8 f3492512ba unify agent items into a flat file-based store, drop the marketplace
Replace the marketplace service dependency and the native/global/user
scope tiers with a single external directory ($OFFICER_ITEMS_DIR) holding
skills, tools, tasks, processes and extensions as plain files.

- tasks move from Postgres to TASK.md files (new file-backed task layer);
  task editing now works, which the DB path never supported
- skills/tools/processes collapse into one shared file router (single dir)
- remove the marketplace client (sync-marketplace/sync-version) and the
  boot-time sync; pi-bridge/pi-manager/sandbox point at the flat store
- drop the dead tasks + vestigial skills/tools/processes/extensions +
  item_chats tables (migration 0004)
- one-time migration script exports DB tasks and consolidates disk items

Migration verified: all 6 tasks round-trip through the runtime parser
identically to their DB rows (pipeline steps, triggers, script impls and
agentic bodies all intact).

NOTE: not yet functionally tested end-to-end — every item (each task mode,
tool, skill, extension) still needs to be run/exercised in the app before
this is trusted. To be done manually.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 00:39:17 +00:00
pastilhasandClaude Opus 4.8 5fd3d4faac file browser opens at home instead of restoring the last path
Navigation is now session-local state that always starts at home. The
unscoped browser still mirrors its folder into files/currentPath so the
Create Dashboard flow keeps defaulting a new dashboard's cwd to it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 23:46:15 +00:00
pastilhasandClaude Opus 4.8 82d0e9afd6 remove ffmpeg video transcode, back to native-only playback
Drop the /transcode (and dead /transcode-audio) routes and the frontend
mkv/avi transcode wiring. Only browser-native formats (mp4, webm, mov,
m4v, ogv) are classified as video now; other containers fall through to
the generic file view.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 23:37:14 +00:00
pastilhasandClaude Opus 4.8 510254cbd4 note the x11vnc orphan/duplicate risk in TODO
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-16 19:17:00 +00:00
pastilhasandClaude Opus 4.8 1ed12cd3ba resolve a relative task cwd against the user's home before spawning
the file browser sends msg.cwd relative to the user's home and it went straight to
Bun.spawn, which resolves it against the server's cwd. when that directory does not
exist posix_spawn reports ENOENT naming the binary rather than the directory, so
"Convert Audio" failed with the misleading "posix_spawn 'bash'".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-16 00:38:12 +00:00
pastilhasandClaude Opus 4.8 7d8341d3ba note the leftover officer-vnc.service unit in TODO
the hand-installed systemd unit kept a parallel xfce session on :1 alive and
respawned it on every kill, independently of the platform. obsolete now that the
desktop panel mirrors :0; disabled, but the unit file is still on disk.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 22:23:33 +00:00
pastilhasandClaude Opus 4.8 106e5bd17d mirror the physical display over vnc instead of spawning a virtual desktop per user
- vnc-manager now runs x11vnc against :0 rather than vncserver on a fresh display,
  so the browser shows the same session as the tv instead of a parallel one
- x11vnc reads :0's cookie from the logged-in user's own .Xauthority, so no root is
  needed; mirroring only works while someone is logged in (the greeter's cookie
  belongs to lightdm)
- -scale 0.5 halves the 4k framebuffer to 1080p for the stream, -shared -forever
  keeps it up across browser disconnects, -localhost keeps it behind the ws bridge
- readiness is now the listening port, not exit code: x11vnc stays in the
  foreground where vncserver daemonized and exited
- drops findFreeDisplay and per-email session tracking; there is exactly one :0
- the parallel desktops this replaces caused real breakage: a ghost logind session
  that broke lightdm login, and a brave profile lock held on :2

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 22:10:15 +00:00
pastilhasandClaude Opus 4.8 3fc7bcb32f always run pi as the service user, drop the sudo -u branch
- the sandbox already drops privileges to the OS user (id -un), so pi-bridge was
  the only code path that switched to a per-user unix account
- the four accounts it targeted (andrepadez, john-wick, fedra, miguelbenoliel)
  are vestigial: created by scripts/provision-existing-users.sh, with no home
  dirs, no files, no processes. the only live account is pastilhas@officer.dev,
  which maps to the service user, so isServiceUser was always true and the
  sudo -u branch could never fire
- add TODO.md tracking the leftover username plumbing, the useradd script, known
  bugs (task-executor relative cwd, bootstrap pi EEXIST), and the ufw 9010 rule

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 21:57:49 +00:00
pastilhasandClaude Opus 4.8 d723fcb23e extract shared whisper transcribe helper, use in file-browser and pi stt routes
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 13:17:15 +00:00
pastilhasandClaude Opus 4.7 e0bfc3d961 serve static assets from local public/ instead of static.officer.dev, simplify gmail history 404/410 handling
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-30 17:07:55 +00:00
pastilhasandClaude Opus 4.7 3540d53a00 gmail proxy tool with token refresh, claude pro bearer auth, pi --list-models stderr fallback, tool object input type
- add getValidGoogleAccessToken helper and use it in email-cron, email account auth resolver, and the new gmail proxy
- POST /api/integrations/google/gmail-proxy forwards arbitrary gmail rest calls server-side, with auto-refreshed oauth
- pi-manager and claude user-instance inject OFFICER_API_URL + per-session JWT so tools can call back as the user
- claude anthropic proxy uses Authorization: Bearer + preserves any anthropic-beta headers (pro oauth tokens are rejected via x-api-key, and overwriting the beta header broke context_management)
- pi --list-models: fall back to stderr when stdout is empty (pi v0.73.1 writes the table to stderr)
- mcp tool server + pi tool loader: accept type: object inputs so json bodies stay structured

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-30 17:07:51 +00:00
pastilhas 8a583da19b email crons 2026-05-16 07:59:37 +00:00
pastilhasandClaude Opus 4.6 039ea7ae71 remove stale native tasks on marketplace sync
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 17:55:14 +00:00
pastilhasandClaude Opus 4.6 b3f1d10bc1 inline email resync instead of job queue, refresh list on completion
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 17:07:06 +00:00
pastilhasandClaude Opus 4.6 ea8113e61d pipeline: add activity timeout and waiting indicator for local models
Agentic steps now have a 5-minute inactivity timeout (non-Claude-Code
models only) so stalled local LLM requests fail with a clear error
instead of hanging forever. A "Waiting for model" indicator is emitted
every 10s and shown in the pipeline UI stats bar, clearing as soon as
the model starts responding.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 10:56:39 +00:00
pastilhasandClaude Opus 4.6 92da03fcff pipeline executor improvements, proxy refresh, task runner step list
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 07:25:11 +00:00
pastilhasandClaude Opus 4.6 0f1e1f35f1 redesign automation page with simple list + detail panels
Replace 8-category layout with flat task list and detail view using
WorkspaceView. Searchable list with mode badges, run/delete actions,
create dialog. Remove 13 unused component files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 07:24:57 +00:00
pastilhasandClaude Opus 4.6 24ac7ac796 replace gmail resync with Gmail REST API, remove mbsync dependency
First sync still uses IMAP with app password. Subsequent syncs use
Gmail API history.list + messages.get with OAuth for faster, more
reliable incremental sync. Dispatch gmail-sync handler for gmail
accounts instead of generic email-sync. Show sync button for synced
accounts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 07:24:44 +00:00
pastilhasandClaude Opus 4.6 ee1b816d66 move tasks to marketplace, sync native tasks on bootstrap
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 13:57:40 +00:00
pastilhasandClaude Opus 4.6 ef6402a827 fix pipeline stop, jobs link navigation, and seed quote stripping
- Fix stop: abort poll now rejects the promise after killing the agent process
- Fix jobs link: close modal before navigating, use react-router navigate
- Fix seed parser: strip quotes from step input values (delete_source: "true")

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 05:32:35 +00:00
pastilhasandClaude Opus 4.6 53c78c76cb add tag-album and clean-playlist-files tasks, script step support, stop fix, rename fix
- New tag-album task: renames tracks to NNN format, sets ID3 tags via mutagen
- New clean-playlist-files task: deletes .cue, .m3u, .nfo and similar junk files
- Pipeline executor now supports script-mode steps (runs directly, no agent)
- Build discography pipeline: convert-audio → clean-playlist-files → prepare → fetch → tag
- Fix stop button: abort signal now kills running agent processes
- Fix job manager: broadcast stopped/error events to WebSocket viewers
- Fix file browser rename: delay focus to avoid context menu close race, left-align input

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 04:10:14 +00:00
pastilhasandClaude Opus 4.6 5e38343f44 add pipeline job management with /jobs pages and per-step output viewer
- Pipeline jobs now persist to DB with progress tracking and cost accumulation
- Jobs survive WebSocket disconnects with in-memory event buffer replay
- New /jobs list page with search, status badges, and cost display
- New /jobs/:id detail page with live WebSocket attachment and REST fallback
- Two-column layout using WorkspaceLayout for resizable steps/output panels
- Streaming messages tagged with stepIndex/iterationLabel for per-step output grouping
- TaskRunnerModal links to job detail page once job is created
- Dock entry added for Jobs page

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 08:48:50 +00:00
pastilhasandClaude Opus 4.6 22c60d4a57 add pipeline task system, agentic music tasks, copy buttons, and pi-bridge cleanup
- Pipeline mode: new task mode that chains agentic tasks sequentially with
  foreach/subdirectory iteration and skip_if conditions
- Pipeline executor backend (WebSocket at /api/tasks/pipeline/ws) with
  support for both Pi and Claude Code models
- Frontend PipelineRunner component with step progress, streaming output,
  and aggregate cost tracking
- New agentic tasks: prepare-discography, fetch-album-info, build-discography
  (pipeline combining both)
- Seed parser extended to handle pipeline steps in frontmatter config
- CopyButton component added to assistant bubbles, error bubbles, and
  tool input/output sections
- Removed obsolete SearXNG/Apify/browser relay code from pi-bridge

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:20:20 +00:00
pastilhasandClaude Opus 4.6 3993c7d1c7 document options input type and UI rendering in SCRIPTS.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:45:00 +00:00
pastilhasandClaude Opus 4.6 2caccc183c generalize convert-to-mp3 into convert-audio with selectable target format
- rename task to convert-audio, support mp3/flac/wav/ogg/aac/opus targets
- add options input type with selectable pill buttons in UI
- extend seed script parser to handle YAML list properties (options)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:42:44 +00:00
pastilhasandClaude Opus 4.6 729ffb930b add task input form and improve script runner output
- fetch task input definitions from API and render configurable inputs
- boolean inputs render as No/Yes toggle (e.g. delete_source)
- auto-filled inputs (file_path) are hidden from the form
- wrap script output in dark pre/code block with copy button
- fix ffmpeg -nostdin for batch directory processing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:35:48 +00:00
pastilhasandClaude Opus 4.6 d4530a9667 add script task templates and refactor convert-to-mp3 to use template pattern
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:14:11 +00:00
pastilhasandClaude Opus 4.6 f32f427972 script-mode task execution — database-backed tasks with direct script runner
Tasks now live in the database (mode: script or agentic). Script-mode tasks
bypass the agent entirely — the implementation is materialized to a temp file
and executed directly, with stdout/stderr streamed to the UI via WebSocket.

Includes convert-to-mp3 as the first native script task.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:07:59 +00:00
pastilhasandClaude Opus 4.6 1159978187 add targets field to filter tools per agent harness (pi/claude/all)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 09:39:38 +00:00
pastilhasandClaude Opus 4.6 f2019a26b6 fix starship env_var syntax for USER prompt
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 08:09:01 +00:00
pastilhasandClaude Opus 4.6 69f6ba94c5 use USER env var in starship prompt instead of system user
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 08:07:11 +00:00
pastilhasandClaude Opus 4.6 3eb4bd820f show member username in terminal prompt instead of email
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 08:05:49 +00:00
pastilhasandClaude Opus 4.6 84d5cf5048 fix sandbox HOME resolution — capture at module load before user-instance overrides it
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 07:50:33 +00:00
pastilhasandClaude Opus 4.6 11d95a25ab mount all of ~/.local in sandbox for claude binary resolution
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 07:43:27 +00:00
pastilhasandClaude Opus 4.6 8377da8a77 fix sandbox tool/extension/skill discovery for members
Sandbox now mounts global content at short /officer/* paths to avoid
bwrap intermediate directory traversal issues. Pi uses NODE_PATH for
extension dependency resolution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 07:13:19 +00:00
pastilhasandClaude Opus 4.6 8264e7b995 fix super admin claude: host cwd, host mcp config paths
Capture HOST_HOME before user-instance overrides process.env.HOME so
Super Admin spawns claude in /home/pastilhas. Generate separate MCP
configs for sandbox (sandbox paths) and host (real filesystem paths),
pick based on role at spawn time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 01:29:14 +00:00