Commit Graph
1294 Commits
Author SHA1 Message Date
Chris Scott 46ca623989 chore(ocm-cli): bump to 0.5.0 and document the /ocm-goal removal 2026-10-30 01:08:26 -04:00
Chris Scott 5db74e3fa7 fix(goals): validate the goal RPC output before returning it 2026-10-30 01:03:14 -04:00
Chris Scott cbe92c92ad refactor(goals): replace the Manager session-goal API with OpenCode built-in /goal 2026-10-29 12:38:39 -04:00
Chris Scott c8647c1eec Merge pull request #472 from chriswritescode-dev/docs/readme-screenshots
docs(readme): refresh the hero screenshot and add a desktop one
2026-10-25 21:58:50 -04:00
Chris Scott 469d65de79 docs(readme): refresh the hero screenshot and add a desktop one 2026-10-25 21:57:03 -04:00
Chris Scott da5a9ebabf fix(frontend): collapse the linked-server project header when a tool panel is docked v1.1.0 2026-10-25 19:27:05 -04:00
Chris Scott 50d920fe6c chore(release): bump manager to 1.1.0 and ocm-cli to 0.4.1 2026-10-25 18:32:07 -04:00
Chris Scott 34e1df8944 Merge pull request #471 from chriswritescode-dev/feat/sessions-tool-panel
feat(sessions): move the session picker into the desktop right tool panel
2026-10-25 18:12:29 -04:00
Chris Scott 48d9bed4cc fix(sessions): route remote session deletion through the picker navigation
Replace the picker's onDeleteActiveSession callback override with a
deleteActiveSessionPath destination that goes through the shared open()
helper. Deleting the open remote session from the floating panel no longer
races a history-back close against the project navigation, and the docked
panel stays open on the remote project page like local deletion does.
2026-10-25 17:48:50 -04:00
Chris Scott d26ab578f0 feat(sessions): move the session picker into the desktop right tool panel
Replace the tool rail's Activity tool with a Sessions tool that renders the
full session picker (Activity, This project and Projects tabs, linked-server
selector, add repository), shared with the mobile sheet via RouteSessionPicker.

- A docked panel stays open and follows navigation (picker navigation mode
  'panel'); the floating overlay closes on select (mode 'replace').
- The session page's sessions shortcut and /sessions open the panel; the
  collapsed sidebar opens it when a tool rail is mounted and falls back to
  the modal dialog otherwise.
- useToolPanelToggle is the single panel toggle for the rail, shortcuts and
  sidebar.
- Remove ActivityList, the fixed activity panel width and the window label.
2026-10-25 17:16:36 -04:00
Chris Scott 82c46bbdb2 Merge pull request #469 from chriswritescode-dev/feat/schedules-sandbox
feat(schedules): run scheduled jobs in a per-job sandbox microVM
2026-10-25 16:44:02 -04:00
Chris Scott 66b45b8f02 Merge pull request #468 from chriswritescode-dev/fix/remove-compact-activity-list
refactor(activity): remove the compact activity list from the mobile More drawer
2026-10-25 16:43:58 -04:00
Chris Scott 7ec3845cd7 Merge pull request #467 from chriswritescode-dev/fix/schedules-panel-full-height
fix(schedules): fill available panel height with jobs table
2026-10-25 16:43:56 -04:00
Chris Scott 7ec2bded75 Merge pull request #466 from chriswritescode-dev/fix/permission-phrase-wording
fix(notifications): phrase permission labels without losing acronyms
2026-10-25 16:43:52 -04:00
Chris Scott b46dd27e5b fix(schedules): retry run sandbox removal after the session sandbox is turned off mid-run 2026-10-25 16:39:28 -04:00
Chris Scott 060159f10b fix(schedules): validate sandbox only when updated and tear down by the run session's sandbox state 2026-10-25 16:28:40 -04:00
Chris Scott 070cb2f729 feat(schedules): run scheduled jobs in a per-job sandbox microVM 2026-10-25 14:49:38 -04:00
Chris Scott 87a8a21a8d refactor(activity): remove the compact activity list from the mobile More drawer 2026-10-25 13:48:10 -04:00
Chris Scott f12546e416 fix(schedules): fill available panel height with jobs table 2026-10-25 13:44:10 -04:00
Chris Scott 8747cfece9 fix(notifications): phrase permission labels without losing acronyms
The always-allow summary interpolated the raw action id ("always allow
shell") while every other surface shows the label ("Run Command"), and
the permission dialog lowercased the whole label, turning "Fetch URL"
into "fetch url". getPermissionPhrase lowercases each word of the label
unless it is all caps, and both the scope summary and the dialog
question use it.
2026-10-25 11:20:21 -04:00
Chris Scott 11a2661cc6 Merge pull request #461 from chriswritescode-dev/feat/device-pairing
feat(device-pairing): pair phones and browsers with a QR code
2026-10-24 19:38:17 -04:00
Chris Scott a769d3fd34 fix(notifications): reject push registrations from revoked sessions
POST /subscribe re-checks the registering auth session inside the same synchronous transaction as the upsert, so a request accepted before a logout cannot restore a revoked session_id over a newer registration. A stale request gets 401, which the session sync already tolerates.
2026-10-24 19:26:21 -04:00
Chris Scott 6e398c4d40 fix(device-pairing): clean up push subscriptions on admin reset and share URL helpers
The admin password reset finds the admin case-insensitively and deletes the push subscriptions of the sessions it ends. The app re-sends its push subscription once per signed-in session so revoke reaches re-signed-in devices, and the upsert keeps the stored device name. Plain-HTTP and URL parsing checks are shared helpers.
2026-10-24 19:26:21 -04:00
Chris Scott cbe4f7ed9e refactor(auth): reset the admin and count users through the Better Auth adapter
The admin password reset and the first-user check read and wrote the
Better Auth tables with raw SQL, so session delete hooks never ran on the
reset path.

- the admin is found with findUserByEmail and its credential account is
  updated by id with the configured password hasher
- sessions are removed with deleteUserSessions, which runs the session
  delete hooks
- a missing credential account logs a warning instead of updating nothing
- /api/auth-info/config counts users through the adapter
2026-10-24 19:26:21 -04:00
Chris Scott b9d8d18124 fix(device-pairing): refuse to mint pairing codes from an address that cannot pair
A loopback origin in production or plain HTTP on a public address still
minted a code and showed a browser QR no other device could use.

- one availability rule decides untrusted, loopback and public plain-HTTP
  origins; POST /api/device-pairing/links checks it before minting
- GET /api/device-pairing/availability reports the rule for the page origin
  without minting
- Connect a device disables "Show QR code" and explains the fix when the
  address cannot pair
- private-network plain HTTP keeps the browser QR; the app QR still needs
  the toggle
2026-10-24 19:26:21 -04:00
Chris Scott 106e8f51fc fix(frontend): show a message when the QR renderer fails to load
A rejected dynamic import left the pairing dialog blank forever. The
renderer now loads through async/await with a catch and renders an error
instead of nothing when the chunk cannot be fetched.
2026-10-24 19:26:21 -04:00
Chris Scott f8e4cfe136 feat(device-pairing): pair phones and browsers with a QR code
Settings -> Account gets "Connect a device", a paired-devices list, and a
remote access headers editor, so the mobile app and other browsers can sign
in without typing a password and pass a reverse proxy such as Cloudflare
Access.

- one-time pairing codes (3 min TTL) minted by a Better Auth plugin and
  redeemed into a new session that records the device name
- POST /api/device-pairing/links builds the ocm://link app link with the
  stored headers as h= parameters and a browser /pair link; plain-HTTP and
  loopback origins are blocked or warned about
- remote access headers are stored encrypted, returned by name only, and
  validated (8 headers, 512-char values, 1800 encoded characters, reserved
  transport names blocked); a Cloudflare Access service token preset fills
  CF-Access-Client-Id and CF-Access-Client-Secret
- login offers "Sign in with QR code" and /pair redeems a scanned code,
  returning to the login redirect target
- revoking a device deletes its session, closes its live connections and
  removes its push subscriptions; the current session cannot be revoked
2026-10-24 19:26:21 -04:00
Chris Scott 5b0e629182 Merge pull request #432 from chriswritescode-dev/feat/repo-secrets
feat(secrets): repository secrets and variables for agent shells and terminals
2026-10-24 19:25:22 -04:00
Chris Scott a1a3a36da5 Merge pull request #463 from chriswritescode-dev/feat/persist-query-cache
feat(frontend): persist the query cache and restore the signed-in session offline
2026-10-24 19:24:38 -04:00
Chris Scott 52b38053b9 fix(frontend): show servers unavailable when the initial server fetch is paused offline
A paused initial fetch kept showsInitialLoading true, so the remote project page showed a spinner until connectivity returned. The hook now exposes isPaused and excludes paused fetches from initial loading; the project page, project list and sidebar show an offline card with Retry instead of a missing-server state, while cached server data still wins.
2026-10-24 19:24:26 -04:00
Chris Scott a1f1212082 fix(frontend): stop empty persist retries, survive disabled storage and show remote project loading
The drop-oldest retryer returns undefined once no query is left, ending the sync persister's retry loop. A throwing localStorage getter yields no persister instead of a crash. useSessionsAcrossDirectories reports isPending under the same condition it enables the query. RemoteProject renders a loader while the server list restores instead of a blank body.
2026-10-24 19:24:26 -04:00
Chris Scott ae461a7b16 fix(frontend): persist only allowlisted changes and make sign-out teardown strict 2026-10-24 19:24:26 -04:00
Chris Scott b0a1640565 fix(frontend): harden the persisted query cache
Persist only data that survives a JSON round trip, bound both the age and
the size of what is written, and stop a restore from being read as a
missing or empty list.

- Drop the repository git status rule: its `Map` data serializes to `{}`,
  so a restored cache made `gitStatuses.get` throw. Round-trip every
  remaining rule through the real persister to catch class-backed data.
- Persist only the unfiltered session list and give just that list the 24h
  gcTime; a search key keeps the default and is collected when unused.
- Set the 24h gcTime in the vcs info query options instead of a prefix
  default, so vcs status and diff keep their normal gcTime.
- Drop the oldest half of the persisted queries per retry pass instead of
  one per pass, sorting once per save, and cap infinite queries to their
  first page before the write.
- Build the session-pin and active-work rules from the shared keys.
2026-10-24 19:24:26 -04:00
Chris Scott b6c21de0bb feat(frontend): persist the query cache and restore the signed-in session offline
Allowlisted query data is persisted to localStorage for 24h, scoped to the origin and user and cleared on sign-out. The last validated user is remembered so a cold start opens with cached lists when the session check fails on the network, while a 401 or signed-out response still signs out. Lists keep cached data when a refetch fails.
2026-10-24 19:24:26 -04:00
Chris Scott 881529728d Merge pull request #462 from chriswritescode-dev/feat/mobile-sessions-sheet
feat(frontend): match the mobile app's sessions sheet and session header
2026-10-24 19:24:22 -04:00
Chris Scott 92c2d49e5c fix(backend): classify clone auth failures before not-found and isolate server tests from host PIDs
Clone error mapping matched a bare '404' anywhere in git's stderr, so an authentication failure on a URL whose port contained 404 was reported as repository not found. 401 and 404 are now matched as HTTP statuses and authentication is checked first. The single-server tests stub process.kill so they never probe or signal real host processes; PID 1234 existing on a Linux runner made them fail.
2026-10-24 19:15:00 -04:00
Chris Scott 80e7f78a9b test(frontend): wait for the picker's open focus before pressing Enter on the scope tab
The dialog moves focus to the search input on the next animation frame after opening. The test focused the sessions tab before that frame, so Enter sometimes landed on the search input and the scope never toggled. It now waits for the open focus, asserts the tab has focus, and checks the persisted scope.
2026-10-24 19:15:00 -04:00
Chris Scott 4d227e32da docs: allow declaration-attached doc comments in the code style rules 2026-10-24 14:31:20 -04:00
Chris Scott 21c60edd09 fix(secrets): collapse legacy scope duplicates on rollback and verify repo worktrees
Rolling back the scope-index migration now keeps the newest of a colliding global and Assistant-repo secret, matching the legacy last-write-wins upsert, so the legacy unique index can be recreated. The repo-env fallback now returns a registered repo only when the directory shares its Git metadata, so a separate clone of the same origin no longer receives the registered repo's secrets; external worktrees still resolve. The migration uses a named export.
2026-10-24 11:06:30 -04:00
Chris Scott e3557f8eec fix(secrets): separate global from assistant-repo scope and require an exact repo root
Global secrets used COALESCE(repo_id, 0), the same key as the Assistant repo (id 0), so same-named values overwrote each other. A new migration rebuilds idx_secrets_scope with a -1 sentinel shared with the upsert target, so databases that already applied the secrets migration upgrade cleanly. Repo env resolution now requires an exact registered git root, so an unregistered nested repository no longer receives its ancestor's secrets.
2026-10-24 10:37:45 -04:00
Chris Scott adb251081f fix(frontend): resolve the deepest owning remote project and refresh VCS info after branch changes
findRemoteProjectForDirectory now returns the longest matching canonical path, so nested linked-server projects attribute sessions to the innermost project. Switching, creating and renaming a local branch invalidate that directory's VCS info query, so branch labels refresh immediately.
2026-10-24 10:37:41 -04:00
Chris Scott 4b7652451b fix: order linked-server projects by session activity and stop waking idle projects
OpenCode stamps project time.active whenever a location boots, and directory-scoped requests boot it, so the Manager's reconnect made every idle linked-server project look recently active. Remote projects are now ordered and labelled by their newest session's update time (one global session list per server), falling back to time.updated. Pending permission, form and shell lists, and the backend replay, only run for linked-server directories with running sessions, tracked pending work or the viewed route. The hard-coded status dot on remote project cards is removed.
2026-10-24 00:32:13 -04:00
Chris Scott de4a9bcf1a fix(frontend): stretch the session picker tabs across the full width 2026-10-24 00:14:38 -04:00
Chris Scott 3e51280894 fix(secrets): forward only planned variables into the sandbox and cache repo env resolution
The sandbox shim forwards only the plan's pinned names, so turning sandbox Git credentials off withholds tokens. Sandboxed shells resolve repo env once, terminals on linked servers get no local env, mapping keys cannot override git credentials, masks are kept per directory, and directory resolution is cached. A legacy gh-env alias keeps adopted OpenCode processes working for one release.
2026-10-23 23:47:44 -04:00
Chris Scott bd746574e8 fix(frontend): scope linked-server pickers to the canonical project and stabilize the model pill
Sheet, desktop rail and session-page dialog resolve the same canonical remote project, reuse the page's session cache and hold the all-directories search while it resolves. Deleting the open session keeps ?repoTab=. Context usage keeps its identity between streaming flushes so ModelQuickSelect skips re-renders, the location prefetch waits for repo data, and dialog and bottom sheet share one return-focus hook. Picker route parsing, remote project query options and the local new-session button are shared.
2026-10-23 23:01:19 -04:00
Chris Scott a0d1d91f18 fix(secrets): target the scope index in the secrets upsert
A bare ON CONFLICT DO UPDATE fires on any unique constraint violation; naming idx_secrets_scope keeps a future constraint from silently redirecting the update.
2026-10-23 22:59:57 -04:00
Chris Scott e46cf516c5 test(e2e): cover repository secret injection, masking and the Secrets panel
Against a real Manager and OpenCode server, with the shared mock
OpenAI-compatible provider:

- mapped values are absent from OpenCode shells while .ocm/project.json is
  untrusted and present once it is trusted;
- repo terminals receive them;
- an agent shell tool call that prints the secret is recorded as ***;
- the Secrets panel lists secrets by name without revealing values.

The shared mock provider can now script tool-call turns (setResponder) and
bind an ephemeral port (startMockProvider() exposes port), so specs no
longer have to reserve a fixed port.
2026-10-23 22:59:57 -04:00
Chris Scott 2884e68a69 feat(secrets): secrets and variables UI and env mapping in trust review
Add a Secrets manager for global values (Settings > Secrets and variables) and
repo values (Secrets tool panel and dialog), with environment scoping,
write-only secrets and copyable ${{ }} references. The trust review for
.ocm/project.json lists the environment and each mapped variable with the
expression it resolves from.
2026-10-23 22:59:57 -04:00
Chris Scott e0331b43bf feat(secrets): repository secrets and variables injected into agent shells and terminals
Add a GitHub Actions-style store for secrets and variables so tests can read
credentials from the environment without .env files in the repo.

- secrets table keyed by kind, repo (NULL for global) and environment;
  secrets are encrypted with encryptSecret and write-only, variables are plain
  text. Names follow GitHub's rules and reject Manager-reserved names.
- Global (/api/secrets, /api/variables) and repo
  (/api/repos/:id/secrets|variables) routes.
- The trusted .ocm/project.json gains environment and env fields that map
  names to ${{ secrets.X }} / ${{ vars.X }} expressions. Both are part of the
  trust hash; files without them hash as before, so existing trust survives.
- RepoEnvService.resolveForDirectory resolves the repo and approved mapping
  for any directory, including worktrees outside the repo folder, with
  environment > repo > global precedence. It never throws.
- /api/internal/shell-env replaces /git-credentials/gh-env and feeds the
  ocm-gh-env plugin, the sandbox shell plan and TerminalService.create.
- The plugin masks injected secret values as *** in completed tool results.
- The sandbox shell plan is now the only source of the guest environment: the
  plugin pins OCM_SANDBOX_FORWARD_ENV and the shim forwards only those names.
2026-10-23 22:59:57 -04:00
Chris Scott b431c121a2 test(e2e): start the E2E backend with only the variables the suite defines
The E2E backend inherited the caller's environment and Bun auto-loaded .env
files from the repo root, so local credentials and host variables could leak
into the run. server.sh now launches the backend with env -i, passing PATH and
only the keys from createServerEnv (E2E_SERVER_ENV_KEYS), runs bun with
--no-env-file, and starts it from a scratch directory with a frontend symlink
so no .env file is in reach.
2026-10-23 22:44:22 -04:00