Commit Graph

16 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
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
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
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
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
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
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
Source Open
615d34a829 Preserve detached worker share credentials across restarts (#1154) 2026-03-24 17:32:24 -07:00
Jan Carbonell
8727123052 fix(desktop): remove tray support (#1100)
* fix(desktop): remove redundant macOS tray icon

* chore: drop unrelated lib.rs formatting

* fix(desktop): remove tray support
2026-03-21 22:30:22 -07:00
Omar McAdam
2b91b4d777 refactor: repo folder structure (#1038)
* refactor(repo): move OpenWork apps into apps and ee layout

Rebase the monorepo layout migration onto the latest dev changes so the moved app, desktop, share, and cloud surfaces keep working from their new paths. Carry the latest deeplink, token persistence, build, Vercel, and docs updates forward to avoid stale references and broken deploy tooling.

* chore(repo): drop generated desktop artifacts

Ignore the moved Tauri target and sidecar paths so local cargo checks do not pollute the branch. Remove the accidentally committed outputs from the repo while keeping the layout migration intact.

* fix(release): drop built server cli artifact

Stop tracking the locally built apps/server/cli binary so generated server outputs do not leak into commits. Also update the release workflow to check the published scoped package name for @openwork/server before deciding whether npm publish is needed.

* fix(workspace): add stable CLI bin wrappers

Point the server and router package bins at committed wrapper scripts so workspace installs can create shims before dist outputs exist. Keep the wrappers compatible with built binaries and source checkouts to avoid Vercel install warnings without changing runtime behavior.
2026-03-19 11:41:38 -07:00