Commit Graph

85 Commits

Author SHA1 Message Date
ben
47db4e39e3 feat(desktop): migration engine for Tauri → Electron (draft, do not merge) (#1523)
* feat(desktop): migration engine for Tauri → Electron handoff

Implements the infrastructure needed to move users from Tauri to Electron
without losing state or Launchpad/Dock presence. Zero user impact on its
own — this becomes live only when paired with a final Tauri release that
calls the snapshot writer and installs Electron.

What lands here:

- Unify app identity with Tauri. electron-builder appId goes from
  com.differentai.openwork.electron → com.differentai.openwork so macOS
  reuses the same bundle identifier (no duplicate Dock icon, no new
  Gatekeeper prompt, same TCC permissions).
- Unify userData path. Electron's app.setPath("userData", ...) now points
  at the exact folder Tauri uses (~/Library/Application Support/com.differentai.openwork
  on macOS, %APPDATA%/com.differentai.openwork on Windows, ~/.config/
  com.differentai.openwork on Linux). An OPENWORK_ELECTRON_USERDATA env
  var override is available for dogfooders who want isolation.
- Filename compat. On first launch, Electron copies Tauri's
  openwork-workspaces.json → workspace-state.json (leaves the legacy
  file in place for rollback safety).
- electron-updater wiring. New deps + IPC handlers
  (openwork:updater:check / download / installAndRestart). Packaged-only.
  Publish config points at the same GitHub release as Tauri.
- Migration snapshot plumbing.
  * Tauri Rust command `write_migration_snapshot` serializes an
    allowlist of localStorage keys to app_data_dir/migration-snapshot.v1.json.
  * `apps/app/src/app/lib/migration.ts` has matching
    writeMigrationSnapshotFromTauri() / ingestMigrationSnapshotOnElectronBoot().
  * Scope: workspace list + selection only
    (openwork.react.activeWorkspace, .sessionByWorkspace,
     openwork.server.list/active/urlOverride/token). Everything else is
    cheap to redo.
  * Electron main exposes openwork:migration:read / ack IPC; preload
    bridges them under window.__OPENWORK_ELECTRON__.migration.
  * desktop-runtime-boot.ts ingests the snapshot once on first launch,
    hydrates empty localStorage keys, then acks.
- Updated prds/electron-migration-plan.md with the localStorage scope
  decision and the remaining work (last Tauri release ships the UI
  prompt + installer downloader).

Verified: `pnpm --filter @openwork/app typecheck` ✓,
`pnpm --filter @openwork/desktop build:electron` ✓, `cargo check`
against src-tauri ✓.

* fix(desktop): emit relative asset paths for Electron packaged builds

Packaged Electron loads index.html via file:// (Contents/Resources/app-dist/
index.html inside the .app bundle), but Vite was building with the default
base: '/' which resolves /assets/*.js to the filesystem root. Result: a
working dev experience (Vite dev server on localhost:5173) and a broken
packaged .app that renders an empty <div id="root"></div>.

The Tauri shell doesn't hit this because Tauri serves the built HTML
through its own tauri:// protocol which rewrites paths. Electron's
file:// loader has no such rewriter.

Fix: electron-build.mjs sets OPENWORK_ELECTRON_BUILD=1 when invoking
vite build, and vite.config.ts flips base to './' only when that env
var is set. Dev server and Tauri builds unchanged.

Discovered while manually exercising the Electron prod-build migration
flow (packaged app launch, snapshot ingest, idempotency, updater IPC).
Latent since PR #1522 landed the packaged build path; never caught
because dogfood ran via dev:electron which uses the Vite dev server.

---------

Co-authored-by: Benjamin Shafii <benjamin@openworklabs.com>
2026-04-22 16:50:51 -07:00
ben
1dbc9f713c feat(desktop): electron 1:1 port alongside Tauri + fix workspace-create visibility (#1522)
* feat(desktop): electron 1:1 port alongside Tauri, fix workspace-create visibility

Adds an Electron shell that mirrors the Tauri desktop runtime (bridge,
dialogs, deep links, runtime supervision for openwork-server / opencode /
opencode-router / orchestrator, packaging via electron-builder). Tauri
dev/build scripts remain the default; Electron runs via dev:electron and
package:electron.

Also fixes the "workspace I just created is invisible until I restart the
app" bug: the React routes only wrote to desktop-side state, so the running
openwork-server never learned about the new workspace and the sidebar (which
is populated from the server list) dropped it. The create flow now also
calls openworkClient.createLocalWorkspace so POST /workspaces/local
registers the workspace at runtime.

Other small fixes included:
- Clears the "OpenWork server Disconnected" flash caused by React 18
  StrictMode double-invoking the connection stores' start/dispose pair.
- Real app icon wired into Electron (dock + BrowserWindow + builder).
- Fix a latent rm-import bug in runtime.mjs that silently skipped
  orchestrator auth cleanup.
- Locale copy updated to say "OpenWork desktop app" instead of "Tauri app".
- Adds description/author to apps/desktop/package.json to silence
  electron-builder warnings.

* docs(prds): Tauri → Electron migration plan

Describes how we'll cut every current Tauri user over to the Electron
build via the existing Tauri updater (one last migration release that
downloads + launches the Electron installer), how we unify app identity
so Electron reads the same userData Tauri wrote (zero-copy data
migration), and how ongoing auto-updates switch to electron-updater
publishing to the same GitHub releases.

---------

Co-authored-by: Benjamin Shafii <benjamin@openworklabs.com>
2026-04-22 15:34:54 -07:00
src-opn
e97a11d452 chore: bump version to 0.11.212 2026-04-20 18:48:25 -07:00
src-opn
ccdb46d111 chore: bump version to 0.11.211 2026-04-20 18:45:24 -07:00
src-opn
872c21764c chore: bump version to 0.11.210 2026-04-20 11:49:19 -07:00
src-opn
f0e4f6db18 chore: bump version to 0.11.209 2026-04-20 10:58:35 -07:00
src-opn
3ac290fab7 chore: bump version to 0.11.208 2026-04-20 09:42:56 -07:00
Source Open
da9a4f24e9 feat(desktop): persist desktop bootstrap and org restrictions (#1479)
* feat(den-api): expose desktop config from env

* feat(desktop): persist den bootstrap config across updates

* feat(den): manage desktop restrictions per organization

* fix(app): stabilize cloud org selection

* docs(desktop): add bootstrap config PRD

---------

Co-authored-by: src-opn <src-opn@users.noreply.github.com>
2026-04-19 15:59:03 -07:00
Jan Carbonell
ebcca56dda Fix/mac app closing onclose (#1489) (#1490)
* refactor(app): remove hide_main_window function and update macOS window close behavior

Eliminate the hide_main_window function to streamline window management. Update the macOS behavior to exit the application when the main window is closed, aligning it with the behavior on Windows and Linux.

* surface openwork as main focused window onDock click
2026-04-19 08:02:50 -07:00
Jan Carbonell
08603fbbb6 Revert "Fix/mac app closing onclose (#1489)"
This reverts commit 143e382726.
2026-04-19 07:48:10 -07:00
Jan Carbonell
143e382726 Fix/mac app closing onclose (#1489)
* refactor(app): remove hide_main_window function and update macOS window close behavior

Eliminate the hide_main_window function to streamline window management. Update the macOS behavior to exit the application when the main window is closed, aligning it with the behavior on Windows and Linux.

* surface openwork as main focused window onDock click
2026-04-18 22:12:58 -07:00
ben
800602f4e3 feat: add microsandbox sandbox flow and feature flag toggle (#1446)
* add pre-baked microsandbox image

Bake openwork, openwork-server, and the pinned opencode binary into a single Docker image so micro-sandbox remote-connect smoke tests can boot quickly and be verified with curl and container health checks.

* add Rust microsandbox example

Add a standalone microsandbox SDK example that boots the OpenWork image, validates remote-connect endpoints, and streams sandbox logs so backend-only sandbox behavior can be exercised without Docker.

* exclude Rust example build output

Keep the standalone microsandbox example in git, but drop generated Cargo target artifacts so the branch only contains source, docs, and lockfile.

* test

* add microsandbox feature flag for sandbox creation

Made-with: Cursor

* refactor sandbox mode isolation

Made-with: Cursor
2026-04-15 15:10:52 -07:00
src-opn
7346d009bf chore: bump version to 0.11.207 2026-04-13 14:48:35 -07:00
src-opn
135290004b chore: bump version to 0.11.206 2026-04-08 13:20:34 -07:00
src-opn
6b26f7765f chore: bump version to 0.11.205 2026-04-07 17:55:49 -07:00
src-opn
eee4a847de chore: bump version to 0.11.204 2026-04-07 17:41:38 -07:00
Source Open
bc2708e4a9 fix(desktop): keep sticky local server ports stable (#1386)
Co-authored-by: src-opn <src-opn@users.noreply.github.com>
2026-04-07 12:30:41 -07:00
src-opn
d5459798b2 chore: bump version to 0.11.203 2026-04-07 10:49:19 -07:00
ben
dfb7f1b2dc fix(startup): move boot orchestration to TS and cut desktop sync stalls (#1366)
Shift startup/loading control to TS with explicit boot phases, cached->live sidebar transitions, and startup trace markers while reducing Rust-side blocking in workspace and orchestrator status paths to improve macOS responsiveness during boot and workspace switching.

Made-with: Cursor
2026-04-06 07:44:34 -07:00
ben
9365e7d397 feat(app): add incremental React session path (#1362)
* feat(server): add workspace session read APIs

Expose workspace-scoped session list, detail, message, and snapshot reads so the client can fetch session data without depending on activation choreography.

* feat(app): route mounted session reads through OpenWork APIs

Use the new workspace-scoped session read endpoints for mounted OpenWork clients so the current frontend stops depending on direct session proxy reads for list, detail, message, and todo loading.

* feat(app): add React read-only session transcript

Introduce a feature-gated React island for the session transcript so we can replace the session surface incrementally while keeping the Solid shell intact.

* feat(app): add React session composer surface

Extend the feature-gated React session island to own its draft, prompt send, stop flow, and snapshot polling so the session body can evolve independently from the Solid composer.

* feat(app): add React session transition model

Keep the React session surface stable during session switches by tracking rendered vs intended session state and exposing a developer debug panel for render-source and transition inspection.

* docs(prd): add React migration plan to repo

Copy the incremental React adoption PRD into the OpenWork repo so the migration plan lives next to the implementation and PR branch.

* docs(prd): sync full React migration plan

Replace the shortened repo copy with the full incremental React adoption PRD so the implementation branch and product plan stay in sync.

* feat(desktop): add React session launch modes

Add dedicated Tauri dev and debug-build entrypoints for the React session path and honor a build-time React session flag before local storage so the alternate shell is easy to launch and reproduce.

* fix(app): fall back to legacy mounted session reads

Keep the new app working against older OpenWork servers by falling back to the original mounted OpenCode session reads when the workspace-scoped session read APIs are unavailable.
2026-04-05 16:46:06 -07:00
src-opn
ff981742bb chore: bump version to 0.11.202 2026-04-04 13:13:29 -07:00
Source Open
52f282b94d fix(i18n): restore missing page translations (#1345)
* fix(i18n): restore missing page translations

* fix(i18n): correct settings locale labels

* fix(dev): avoid reusing another checkout's Vite server

---------

Co-authored-by: src-opn <src-opn@users.noreply.github.com>
2026-04-04 13:12:09 -07:00
Benjamin Shafii
15725dfb31 chore: bump version to 0.11.201 2026-04-03 18:28:44 -07:00
Benjamin Shafii
5cc7bbdd87 chore: bump version to 0.11.200 2026-04-03 07:51:45 -07:00
Benjamin Shafii
4a3e43e597 chore: bump version to 0.11.199 2026-04-01 18:48:35 -07:00
Benjamin Shafii
0d93d5d7a7 Revert "feat(session): render streamed file mentions as cards"
This reverts commit ed20f1c4b3.
2026-03-31 18:14:32 -07:00
Benjamin Shafii
25a508d7bd feat(session): render streamed file mentions as cards
Break assistant text into stable blocks so streaming stays responsive and tool-created files surface as openable transcript cards instead of getting buried in prose.
2026-03-31 18:14:31 -07:00
ben
ca971b1dd3 chore: remove opkg CLI integration and dead code (#1268)
- Delete src/opkg.rs (opkg_install + fallback chain) and commands/opkg.rs
- Relocate import_skill from commands/opkg.rs to commands/skills.rs (actively used)
- Remove opkg_install from Tauri handler registration in lib.rs
- Delete dead opkgInstall() from tauri.ts (zero callers)
- Remove apply_augmented_path/augmented_path_env from paths.rs (only consumer was opkg)
- Strip opkg mentions from i18n locale strings (en, zh, ja, vi, pt-BR)
- Remove OpenPackage Notes sections from README.md, README_ZH.md, README_ZH_hk.md
- Update ARCHITECTURE.md: rename OpenPackage Registry to Skill Registry
- Clean up PRD references in openwork-server-ownership-minimal-tauri.md
2026-03-31 18:07:38 -07:00
Benjamin Shafii
761796fd33 chore: bump version to 0.11.198 2026-03-30 22:30:04 -07:00
Benjamin Shafii
020d763667 chore: bump version to 0.11.197 2026-03-30 21:50:48 -07:00
Benjamin Shafii
a6c01ff3e5 Revert "fix(app): stop auto-creating the Welcome workspace (#1253)"
This reverts commit d9855e69e8.
2026-03-30 21:07:23 -07:00
ben
d9855e69e8 fix(app): stop auto-creating the Welcome workspace (#1253) 2026-03-30 21:00:07 -07:00
Benjamin Shafii
53b8964dc3 Merge branch 'dev' of https://github.com/different-ai/openwork into dev 2026-03-30 19:52:21 -07:00
Benjamin Shafii
03097775ef more windows arm stuff 2026-03-30 19:51:50 -07:00
Source Open
41ff05cdb8 fix(security): keep orchestrator secrets off argv and logs (#1242)
Co-authored-by: src-opn <src-opn@users.noreply.github.com>
2026-03-30 17:23:14 -07:00
Benjamin Shafii
663e357b00 chore: bump version to 0.11.196 2026-03-30 13:56:06 -07:00
Benjamin Shafii
b210cbc638 fix images 2026-03-29 21:30:54 -07:00
Benjamin Shafii
396f9f441b chore: remove unreferenced png artifacts 2026-03-29 21:10:25 -07:00
ben
32a27cf3a3 phase 5: remove migration repair flow (#1215) 2026-03-29 17:26:13 -07:00
ben
9ed87703a5 refactor(session): remove dead obsidian mirror path (#1210) 2026-03-29 13:07:36 -07:00
Source Open
874191d8f8 fix welcome workspace bootstrap flow (#1205)
* fix welcome workspace bootstrap flow

* fix workspace modal dark theme

* fix(automations): prefer server scheduler when connected

* fix(automations): keep context key stable across server startup

* fix(sidebar): refresh selected workspace sessions after switch

* refactor(sidebar): move workspace session loading into store

* refactor(sidebar): reload sessions per workspace fingerprint

* refactor(sidebar): refresh workspace lists after session mutations

---------

Co-authored-by: src-opn <src-opn@users.noreply.github.com>
Co-authored-by: Benjamin Shafii <ben@prologe.io>
2026-03-28 15:50:20 -07:00
src-opn
9d5b14b4f4 chore: bump version to 0.11.195 2026-03-27 14:29:11 -07:00
src-opn
41d93e2ece chore: bump version to 0.11.194 2026-03-26 13:15:32 -07:00
Benjamin Shafii
da74ba9a75 chore: bump version to 0.11.193 2026-03-25 21:53:12 -07:00
Jan Carbonell
ea226be40a fix starter bootstrap server initialization (#1168) 2026-03-25 18:23:34 -07:00
Source Open
36106898e3 Isolate managed OpenCode state and reset paths (#1171)
* Isolate OpenCode dev state and clarify destructive reset

Route dev-mode OpenCode state into a dedicated openwork-dev-data home so local development never touches the default user path. Move the destructive reset to Debug and make it wipe only the current mode's OpenWork and OpenCode state with an explicit irreversible warning.

* Unify managed OpenCode state paths

Keep the supported desktop/orchestrator flow on a single OpenCode state root per mode instead of creating per-workspace directories. This makes dev and production resets target the right shared paths without changing the standard non-dev OpenCode data locations.

---------

Co-authored-by: src-opn <src-opn@users.noreply.github.com>
2026-03-25 17:53:12 -07:00
Benjamin Shafii
5f30ad2a87 chore: bump version to 0.11.192 2026-03-25 14:56:33 -07:00
Source Open
d6ee2fb7d9 Fix workspace switching semantics and sticky local worker ports (#1166)
* fix(app): decouple workspace selection from runtime state

Keep desktop workspace selection independent from backend activation so switching workers only reconnects when an action actually needs that runtime. Persist per-workspace local OpenWork server ports so long-lived local links stay stable without relying on a predictable default port.

* fix(app): resolve rebased workspace runtime references

* fix(test): auth opencode serve regression scripts

* docs(app): clarify workspace runtime and port behavior

---------

Co-authored-by: Omar McAdam <omar@OpenWork-Studio.localdomain>
Co-authored-by: Omar McAdam <omar@OpenWork-Studio.local>
2026-03-25 13:42:09 -07:00
Omar McAdam
6c9700ce85 chore: bump version to 0.11.191 2026-03-24 17:34:29 -07:00
Source Open
615d34a829 Preserve detached worker share credentials across restarts (#1154) 2026-03-24 17:32:24 -07:00