Commit Graph

39 Commits

Author SHA1 Message Date
Source Open
8c3f32e3b2 fix(den): proxy legacy org-scoped routes (#1502)
* fix(den): support legacy org invitation routes

Restore the old org-scoped invitation paths and rehydrate sessions to a user's first organization when activeOrg is missing so older clients keep working. Include the shared types workspace in Den Docker images so the local verification stack can still build.

* fix(den): proxy legacy org-scoped routes

Route legacy '/v1/orgs/:orgId/*' requests into the new unscoped '/v1/*' handlers while preserving the current '/v1/orgs/...' endpoints. Pass the org id through middleware so old clients keep the intended workspace context and add coverage for the generic proxy behavior.

* refactor(den): trim invitation route churn

Drop the leftover invitation-specific handler extraction now that legacy org-scoped forwarding is handled generically in the org router. Keep the proxy behavior intact while returning the invitation routes closer to their original shape.

---------

Co-authored-by: src-opn <src-opn@users.noreply.github.com>
2026-04-20 11:46:00 -07:00
ben
0002a8e030 fix(den-api): surface invite email failures instead of silently dropping (#1483)
* fix(den-api): surface invitation email send failures instead of swallowing

Loops failures in sendDenOrganizationInvitationEmail and
sendDenVerificationEmail were being caught and logged at warn level,
so the HTTP handlers still returned 201 'Invitation created' even when
no email ever left the process. Ben observed this with two live
invitations: the DB row was pending, the UI showed it, but one of two
recipients never received the email and clicking resend re-ran the same
silent-failure path.

Root cause (from an explore audit):
- email.ts:129,132 swallowed non-2xx Loops responses and fetch throws.
- invitations.ts awaited the send and unconditionally returned 2xx.
- There is no 'skip email if user already exists' branch anywhere;
  the Slack hypothesis was wrong. The failure mode is provider-side and
  was invisible because of the swallow.

Changes:
- Introduce DenEmailSendError with a stable reason tagged union
  (loops_not_configured | loops_rejected | loops_network).
- sendDenOrganizationInvitationEmail and sendDenVerificationEmail now
  throw DenEmailSendError on failure. Dev-mode short-circuit is
  preserved (still logs the payload and returns cleanly).
- POST /v1/orgs/:orgId/invitations catches DenEmailSendError, logs via
  console.error with a stable [auth][invite_email_failed] prefix
  (greppable across deployments), and returns 502
  invitation_email_failed with a human-readable message and the
  invitationId so the UI can correlate and offer a retry. The row is
  left pending intentionally so the next submit becomes a real resend.
- Document the 502 response in the OpenAPI describeRoute.

Operator note: if LOOPS_TRANSACTIONAL_ID_DEN_VERIFY_EMAIL is unset the
signup OTP endpoint will now return a real error instead of silently
stranding the user at the OTP screen forever. This is intentional; the
previous behavior was a latent signup-breaking bug.

* fix(den-api): tolerate missing apps/desktop/package.json in Docker build

PR #1476 introduced a build step that reads apps/desktop/package.json to
bake in a default latest-app-version, but packaging/docker/Dockerfile.den
does not ship the Tauri desktop sources. As a result, the den-dev Docker
stack fails to build after the PR landed. Gracefully fall back to 0.0.0
(matching the runtime default) when the file is absent, and allow a
DEN_API_LATEST_APP_VERSION env override so deployers can still pin a
real value.

* test(den-api): add smoke script for invite email failure paths

scripts/smoke-email-failures.mjs exercises the DenEmailSendError paths
against the built dist/ of den-api. Ships with instructions so a
reviewer can rerun it inside the docker-compose den-dev container with
a single command.

Also parameterises OPENWORK_DEV_MODE in the den compose service so the
failure paths can be reached from outside the container when needed
(defaults to 1; override with OPENWORK_DEV_MODE=0 at compose time).
2026-04-17 17:06:52 -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
Source Open
0589897b2f feat(den): add org-managed llm provider library (#1343)
* feat(den): add org-managed llm provider library

Let Den admins curate shared providers and models with encrypted credentials, then let the app connect through the existing add-provider flow. This keeps org-wide model access consistent without requiring per-user OAuth setup.

* docs(den): prefer longer db encryption keys

* fix(den): pass db encryption key through local dev

---------

Co-authored-by: src-opn <src-opn@users.noreply.github.com>
2026-04-06 10:17:21 -07:00
Source Open
780bbaa9f9 fix(den): parse skill frontmatter when saving skills (#1308)
* fix(den): parse skill frontmatter when saving skills

Keep the full SKILL.md payload in the database, derive title and description from frontmatter, and require a frontmatter name in the API. Also include shared packages in the Den web Docker image so the upload flow can be verified end to end.

* fix(den-web): transpile shared utils package

Include @openwork-ee/utils in Next's transpilePackages list so the client skill editor resolves the shared frontmatter helpers during production builds.

* fix(den-web): keep skill parsing local to the app

Move the client-side skill markdown parser into the Den web app so production builds do not depend on resolving a workspace package boundary from a client component.

* refactor(den): share skill frontmatter parsing via utils

Make Den web and Den API both depend on @openwork-ee/utils for skill frontmatter parsing, refresh the workspace lockfile, and keep the Den web build wiring explicit for CI and Docker.

* fix(den-web): build Den from the monorepo root on Vercel

Keep the shared utils package setup, but make Vercel install and build from the repo root so workspace dependencies like @openwork-ee/utils are always available when Den web deploys from its app subdirectory.

* docs(den-web): keep Vercel workspace settings in the dashboard

Remove the app-level Vercel command override from the repo and document the monorepo install/build settings for the dashboard instead.

---------

Co-authored-by: src-opn <src-opn@users.noreply.github.com>
2026-04-03 11:44:02 -07:00
Benjamin Shafii
d6480b8b2d add stuff 2026-04-02 11:38:55 -07:00
Source Open
4caf178048 feat(den): add skill hubs and restore den-db migrations (#1285)
* feat(den-db): add skill hub schema and own migrations

* feat(den-api): add skill hub org routes

* fix(den-db): restore drizzle migration workflow

Move the Docker Den service onto den-api and repair den-db's Drizzle metadata so skill hub migrations generate incrementally from the package.

* refactor(den-db): drop legacy org table aliases

---------

Co-authored-by: src-opn <src-opn@users.noreply.github.com>
2026-04-01 15:23:39 -07:00
Source Open
a3d6b17a19 fix(share): lock bundle fetches to the configured publisher (#1241)
Keep server-side share publish and fetch traffic on the configured OpenWork publisher so bundle links cannot steer host requests to arbitrary targets. Add a warning-backed client-side fallback for manual imports from untrusted bundle URLs.

Co-authored-by: src-opn <src-opn@users.noreply.github.com>
2026-03-30 17:38:31 -07:00
ben
783774d295 fix(den): trust 0.0.0.0 local auth origin (#1192) 2026-03-27 10:36:25 -07:00
Benjamin Shafii
3e2cd73523 new dev 2026-03-26 11:26:16 -07:00
Source Open
21d3b443a7 Add Den organizations, org permissions, and template sharing surfaces (#1172)
* Add Den org auth model and template APIs

Wire Better Auth organizations with TypeId-backed schema and migrations, enforce owner/admin org permissions, and add org-scoped template create/list/delete endpoints. Simplify the Den org dashboard UX and update Docker dev packaging paths for the ee apps/packages layout.

* Add manual-safe org migration SQL

Provide a Vitess-compatible version of the organization migration without statement-breakpoint markers or unsupported IF NOT EXISTS column syntax so operators can run it directly in SQL consoles.

---------

Co-authored-by: src-opn <src-opn@users.noreply.github.com>
2026-03-25 18:30:50 -07:00
Source Open
8c143ab2a3 fix(domain): switch hosted URLs to openworklabs (#1150) 2026-03-25 18:02:44 -07:00
Source Open
18723ec767 feat(security): default local workers to localhost only (#1132)
Require generated OpenCode auth and explicit remote-sharing opt-in so local workers stay loopback-only unless the user intentionally exposes them.
2026-03-23 17:58:53 -07:00
Source Open
24c47f190b fix(den): harden public auth and publishing surfaces (#1128)
* fix(den): harden public auth and publishing surfaces

* fix(den-db): write migrations to den-controller drizzle dir

\
2026-03-23 17:58:15 -07:00
Omar McAdam
5cdf86b120 feat(den): add Daytona worker activity heartbeats and release snapshot automation (#1045)
* feat(den): add daytona activity heartbeats and snapshot release automation

* ci: run Daytona snapshot publish from release workflow

---------

Co-authored-by: Omar McAdam <omar@OpenWork-Studio.localdomain>
2026-03-19 15:38:11 -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
ben
16536e50b2 fix(docker): expose dev stacks on LAN and Tailscale (#1009) 2026-03-17 19:48:11 -07:00
Omar McAdam
abc5559d8a fix(den): hide mobile rename summary and repair docker startup (#1001)
Keep the worker rename step focused on small screens, and point the Den Docker services at their built entrypoints so the onboarding flow can be verified end to end.
2026-03-17 17:30:15 -07:00
Jan
b3ec627f85 Simplify the share OG preview card (#970)
* Simplify share OG preview card

* Cover OG unfurls and fix dev Docker startup

* Simulate social preview card sizes

* Add typed social OG image variants

* Use OpenWork logo in OG card

---------

Co-authored-by: jcllobet <jcllobet@users.noreply.github.com>
2026-03-16 22:58:59 -07:00
ben
0e88389849 feat(den): add daytona-backed docker dev flow (#918)
* feat(den): add daytona-backed docker dev flow

* fix(den): allow multiple cloud workers in dev

* fix(den): use Daytona snapshots for sandbox runtime

Use a prebuilt Daytona snapshot for the dev worker runtime so sandboxes start with openwork and opencode already installed. Pass the snapshot through the local Docker flow and add a helper to build the snapshot image for repeatable setup.

* chore(den): lower Daytona snapshot defaults

Reduce the default snapshot footprint to 1 CPU and 2GB RAM so local Daytona worker testing fits smaller org limits more easily.

* Omar is comfortable

Make Daytona-backed cloud workers stable enough to reconnect through a dedicated proxy instead of persisting expiring signed preview URLs. Split the proxy into its own deployable service, share Den schema access through a common package, and fix the web badge so healthy workers show ready.

* chore(den-db): add Drizzle package scripts

Move the shared schema package toward owning its own migration workflow by adding generate and migrate commands plus a local Drizzle config.

* chore: update lockfile

Refresh the workspace lockfile so the new den-db Drizzle tooling is captured in pnpm-lock.yaml.

* feat(den-worker-proxy): make Vercel deployment-ready

Align the proxy service with Vercel's Hono runtime entry pattern and keep a separate Node server entry for Docker/local runs. Also scaffold the Vercel project/env setup and wire Render deploy sync to pass Daytona variables needed for daytona mode.

* feat(den-db): add db mode switch for PlanetScale

Support DB_MODE=planetscale with Drizzle's PlanetScale serverless driver while keeping mysql2 as the local default. This lets Vercel-hosted services use HTTP database access without changing local development workflows.

* refactor(den-db): adopt shared TypeID ids

Move the Den TypeID system into a shared utils package and use it across auth, org, worker, and sandbox records so fresh databases get one consistent internal ID format. Wire Better Auth into the same generator and update Den request boundaries to normalize typed ids cleanly.

* fix(den): restore docker dev stack after refactor

Include the shared utils package in the Den Docker images, expose MySQL to the host for local inspection, and fix the remaining Den build/runtime issues surfaced by the Docker path after the shared package and TypeID changes.

* docs(den): document Daytona snapshot setup

Add README guidance for building and publishing the prebuilt Daytona runtime snapshot, including the helper script, required env, and how to point Den at the snapshot for local Daytona mode.

* refactor(den-db): reset migrations and load env files

Replace the old Den SQL migration history with a fresh baseline for the current schema, and let Drizzle commands load database credentials from env files. Default to mysql when DATABASE_URL is present and otherwise use PlanetScale credentials so local Docker and hosted environments can share the same DB package cleanly.

* fix(den): prepare manual PlanetScale deploys

Update the Render workflow and Docker build path for the shared workspace packages, support PlanetScale credentials in the manual SQL migration runner, and stop auto-running DB migrations on Den startup so schema changes stay manual.

* feat(den-v2): add Daytona-first control plane

Create a new den-v2 service from the current Daytona-enabled control plane, default it to Daytona provisioning, and add a dedicated Render deployment workflow targeting the new v2 Render service.

* feat(den-worker-proxy): redirect root to landing

Send root proxy traffic to openworklabs.com so direct visits to the worker proxy domain do not hit worker-resolution errors.

---------

Co-authored-by: OmarMcAdam <gh@mcadam.io>
2026-03-16 21:20:26 -07:00
Omar McAdam
b68bfafbbe feat(den): support configurable Better Auth trusted origins (#958)
* feat(den): support dedicated Better Auth trusted origins

* fix(den): unify trusted origins env key naming
2026-03-16 14:11:43 -07:00
ben
3ae7735555 feat(settings): add OpenWork Cloud auth and worker open flow (#957)
* add OpenWork Cloud settings auth and worker open

* hide Den endpoint override outside developer mode

* add documented Den and OpenWork Cloud flow evidence
2026-03-16 13:28:01 -07:00
ben
11fd1490c7 improve docker dev defaults for LAN/public access (#943) 2026-03-15 17:06:19 -07:00
Benjamin Shafii
9502137dd4 feat(share): add local docker publisher flow 2026-03-13 13:32:23 -07:00
Benjamin Shafii
6fd9b5f94c feat(den): add dockerized local test stack 2026-03-13 09:41:34 -07:00
Omar McAdam
f96b50a1ef feat(web): add local Den dev stack (#855)
* feat(web): add local Den dev stack

* fix(web): stabilize mobile Den worker cards

* fix(web): default empty Den state to new worker

* Add Google auth to Den signup (#847)

* feat(den): add google auth provider

* feat(web): add social signup buttons for den

---------

Co-authored-by: jcllobet <jcllobet@users.noreply.github.com>

---------

Co-authored-by: Jan <jc2897@cornell.edu>
Co-authored-by: jcllobet <jcllobet@users.noreply.github.com>
2026-03-12 11:27:34 -07:00
ben
6496d1cc90 refactor(app): remove soul mode surfaces (#851) 2026-03-11 19:42:22 -07:00
Omar McAdam
13d79aee07 feat: isolate OpenCode dev state (#816) 2026-03-09 17:21:17 -07:00
ben
27205a259c fix(docker): mount host opencode config in dev dev-up stack (#690) 2026-02-27 08:09:52 -08:00
ben
6284b581f7 chore: rename openwrk to openwork-orchestrator (#573)
* chore(orchestrator): rename openwrk to openwork-orchestrator

Rename the host package and internal references from openwrk to openwork-orchestrator, and expose the CLI as 'openwork'.

Update desktop/UI runtime wiring, release workflows, and docs; bundle the Tauri sidecar as 'openwork-orchestrator' to avoid Cargo package name collisions.

* chore: keep orchestrator publish script executable

* chore: update pnpm lockfile

* chore: sync lockfile with orchestrator deps

* docs: update orchestrator usage + release notes

Document that openwork-orchestrator installs the 'openwork' CLI, update release command wording, and remove obsolete workflow branch trigger.
2026-02-15 14:24:42 -08:00
ben
32cc853d10 refactor(router): rename owpenbot to opencode-router (#567) 2026-02-14 20:53:06 -08:00
ben
23cea6c1a1 Soul Mode: harden give-me-a-soul bootstrap (#566)
* fix(app): harden give-me-a-soul bootstrap prompt

* chore(docker): improve soul mode proof harness

* fix(app): fix soul agent frontmatter indentation

* chore(docker): deepen soul mode proof harness

* fix(app): allow soul to update soul.md
2026-02-14 20:52:26 -08:00
ben
1ae676e469 feat(app): unify Apps and Plugins in Extensions (#555) 2026-02-12 23:16:05 -08:00
ben
e8ce3a821b feat: OpenCode hot reload wiring + engine binary selector (#552)
* feat(app): drop reload-required flow

* chore(server): disable legacy engine reload endpoints

* feat(openwrk): wire OpenCode hot reload env

* fix(docker): compile sidecars for container arch

* chore(dev): pin OpenCode sidecar version

* feat(engine): allow custom OpenCode binary selection
2026-02-12 12:17:23 -08:00
ben
4285a97a3f feat(app): simplify run status UI and inline stop action (#551)
* feat(app): streamline run status and inline stop control

* fix(docker): write compiled sidecars directly to /tmp
2026-02-11 23:39:23 -08:00
Dobes Vandermeer
957856773f feat(app): add MCP server add/remove UI with confirmation and OAuth defaults (#546)
- Add MCP Server modal (remote URL or local command) with validation
- Remove confirmation dialog before deleting MCP servers
- Default remote servers to oauth: true so OAuth flows auto-trigger
- Update placeholders to GitHub Copilot MCP and sequential-thinking
- Fix Docker dev stack bun --compile EXDEV error (cross-device rename)
- i18n support for en and zh locales
2026-02-11 17:33:55 -08:00
Benjamin Shafii
57d3681422 yo 2026-02-09 16:39:21 -08:00
Benjamin Shafii
548ea8b0ef feat: add Docker Compose dev testability stack (no custom Dockerfile)
Add docker-compose.dev.yml using off-the-shelf node:22-bookworm-slim image
that starts headless + web UI with auto-wired tokens and health checks.
Builds Linux binaries into /tmp to avoid overwriting host macOS binaries.
2026-02-09 15:55:42 -08:00
ben
f3da381606 feat: minimal container sandbox + server tokens + toy UI (#494)
* feat(server): add scoped tokens, inbox/outbox, toy UI, and auth hardening

- TokenService with file-based persistence (tokens.json)
- /tokens CRUD (host auth), /whoami (client auth)
- Bearer token auth accepting OPENWORK_TOKEN or scoped tokens
- POST /workspace/:id/inbox (multipart upload)
- GET /workspace/:id/artifacts, /workspace/:id/artifacts/:id
- Toy UI at /ui with SSE, prompt send, inbox upload, outbox download
- Extended GET /capabilities with schemaVersion, serverVersion, approvals info
- Updated README with all new endpoints and auth model

* feat(headless): add sandbox runtime with Docker and Apple container backends

- --sandbox none|auto|docker|container CLI flag
- --sandbox-image, --sandbox-persist-dir, --sandbox-mount options
- Mount security: allowlist, blocked patterns, symlink resolution
- Docker backend: workspace/persist volumes, sidecar staging, entrypoint
- Apple container backend: --mount type=bind for ro mounts
- Sandbox mode proxies all OpenCode access through openwork-server
- Proxy health check (waitForHealthyViaProxy) avoids SDK auth issues
- Sandbox-specific check suite (runSandboxChecks) for --check mode
- Non-fatal verifyOpenworkServer in sandbox mode for version mismatches
- Updated README with sandbox docs and mount security

* feat(packaging): add Docker/docker-compose PaaS packaging

- Dockerfile (node:22-bookworm-slim, installs openwrk via npm)
- docker-compose.yml with workspace and data volumes
- README with usage instructions

* fix(headless): define sandbox owpenbot internal health port
2026-02-07 13:01:15 -08:00