18 Commits
Author SHA1 Message Date
ben 3db1e4b884 refactor(worlds): name previews by what they boot, pass app settings (#5441)
* refactor(worlds): name previews by what they boot and pass app settings

`worlds/` held 21 recipes; about half served one test, doc or nothing.

- preview-desktop is now the desktop app alone (no Den): source on local,
  Daytona or Freestyle, or exact published release bytes. One Daytona
  sandbox instead of two.
- preview-full is the old Den plus desktop preview (fresh, team,
  restricted, workspace); preview-den is unchanged.
- Renames: app-web -> preview-app-web, dev-headless -> dev-app-web,
  desktop-prod-live -> live-desktop, headless-prod-live -> live-app-web.
  Old names fail with the new one (RENAMED_WORLDS).
- Single-use worlds move next to their user and run by path; unused
  worlds (solo, acme-demo, azure-byok, gateway-local, den-gateway-local)
  are removed.
- `pnpm world up --env KEY` values now reach desktop apps on local and
  Daytona (e.g. OPENWORK_ENGINE_V2_PREVIEW=1). The selection marker now
  lists only keys the person selected, not keys the CLI adds itself.
  Freestyle refuses --env for desktops: its snapshot starts the app at
  build time.
- evidence-web accepts its documented --source again.

Signed-off-by: Benjamin Shafii <ben@prologe.io>

* test(evals): remove the failing cross-workspace split view spec

It fails on unchanged dev at the same step (the session context menu never
renders), so it proves nothing. Its world had no other user.

Signed-off-by: Benjamin Shafii <ben@prologe.io>

* test(evals): remove the preview-world tooling spec

It needs several Daytona sandboxes at once (over the 10 GiB org cap), and
the proof lane runs it locally where every test skips, so it never proved
anything. windows-published-preview still proves an app-only preview on
Daytona; the preview rules and --env handling are unit-tested.

Signed-off-by: Benjamin Shafii <ben@prologe.io>

---------

Signed-off-by: Benjamin Shafii <ben@prologe.io>
2026-09-28 17:44:49 -07:00
ben d388bd0e3e refactor(evals): replace declarative worlds with script worlds (#4261)
* feat(evals): add script worlds — plain executable TS worlds alongside topology DSL

Worlds can now be ordinary executable TypeScript files instead of declarative
topology objects. A script world composes the same primitives specs already
use (server, createAdmin, createOrg, inviteMember, liteLlmPerMemberProvider,
app) with native `AsyncDisposableStack` for lifecycle, and calls `hold()` to
register a snapshot and block until torn down.

- packages/world: new `hold()` + script-world runtime; loader classifies
  `worlds/*.ts` as `definition` or `script` without importing (discovery
  stays import-free); CLI gains `world down <name>` and script-aware
  `up [--detach] [--timeout]` / `list` / `forget`.
- evals/packages/env: extract `liteLlmPerMemberProvider` out of the topology
  interpreter into a standalone exported primitive (interpreter now delegates
  to it, unchanged behavior); export `createAdmin`/`createOrg` so scripts can
  compose an org without the `server({ org })` bundle.
- worlds/litellm-per-member.ts: rewritten as an import-safe script
  (`if (import.meta.main)`) demonstrating the new shape; the topology
  definition is gone.
- evals/specs: litellm-per-member-world.e2e.test.ts updated to the new
  builder; new script-world-lifecycle.test.ts (PR lane) covers detached
  launch ownership, duplicate-launch/unknown-teardown isolation, and graceful
  stack disposal on `world down`.

Verified: script-world-lifecycle + shared-world-engine specs pass; full evals
package suite (242 tests) passes; litellm-per-member-world.e2e.test.ts passes
cold against a fresh local Den; typecheck diagnostics unchanged from the
origin/dev baseline (571, none in touched files).

* refactor(evals): remove declarative world layer

* docs(world): document script-only lifecycle

* docs(world): remove declarative lifecycle guidance
2026-08-31 21:12:22 -07:00
ben a7242b7584 feat(world): share headless lifecycle engine (#4091)
* feat(world): share headless lifecycle engine

* fix(world): keep package builds self-contained
2026-08-25 15:04:26 -07:00
ben a19e8fbf67 fix(dev): run headless server from source (#3752) 2026-08-13 10:12:04 +01:00
benandCursor 286d05da05 fix(dev): reliable headless web with same-origin Den sign-in (#3732)
* fix(dev): reliable headless web with same-origin Den sign-in

pnpm dev:headless-web now runs an isolated, self-healing stack: isolated
server config under tmp/, stable default ports, single-instance reuse or
--replace via pids recorded in the runtime manifest, detached children
that survive the invoking terminal, and a --detach mode for agents.

Cloud sign-in works from the browser by mirroring the gateway runtime:
Vite serves /api/den same-origin (proxied to the control plane) and
injects the gateway marker, so Den calls are never CORS-blocked and
stale localStorage base URLs are ignored. The bespoke Den sidecar proxy
is gone. VITE_OPENWORK_FORCE_ENV_SETTINGS lets the launcher overwrite
stale openwork-server credentials in localStorage.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(dev): keep headless web sessions alive across relaunches

Stable tokens (reused from the previous manifest) and a merged — never
rewritten — server config so registered workspaces survive --replace.
Den Cloud calls stay same-origin via VITE_DEN_API_BASE_URL pinned to the
Vite /api/den proxy; drop the gateway marker, which assumed a provisioned
cloud instance and blocked env token hydration in the browser.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(dev): use paste handoff for loopback Cloud sign-in

Local headless web cannot receive approved webAuth return URLs from
hosted Den. Open desktopAuth instead and guide copy/paste of the grant.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(dev): restrict headless runtime manifest to owner-only

The manifest carries the server bearer and host tokens, so a permissive
umask would expose them to other local users.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(dev): scope headless server CORS to the web app origins

--cors * let any site the developer visits reach the token-authenticated
local API. The only browser client is the Vite app, so allow its origins.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(dev): add --rotate-tokens to headless web launcher

Token reuse keeps open tabs working across relaunches, but left no way to
invalidate credentials believed leaked. Opt into fresh ones explicitly.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-13 07:11:49 +00:00
ben 9d14c9b729 chore: remove the openwork-orchestrator (#3181)
* chore: remove the openwork-orchestrator

The orchestrator was the last thing standing between OpenWork and a single
server binary. Cloud already ran without it; this removes it everywhere else
and deletes the package.

Render workers are now purely openwork-server: the build installs the
published npm package instead of the orchestrator, the start command drops
every orchestrator-only flag (--remote-access becomes --host 0.0.0.0,
--opencode-source/--opencode-bin become OPENWORK_MANAGE_OPENCODE and
OPENWORK_OPENCODE_BIN, --allow-external and --connect-host simply go), and it
resolves the extension plugins from the installed package - failing loudly if
they are absent rather than booting into the silent
extensions_plugin_missing state Cloud just hit. install-opencode.mjs reads
the pinned OpenCode version from the repo's own constants.json instead of
from the globally installed orchestrator.

The desktop stops shipping it. It was compiling, signing, notarizing and
shipping eight orchestrator binaries per release that nothing ever ran:
engineStart has always hardcoded the direct runtime, and both
startOrchestratorRuntime and startDirectRuntime were defined and never
called. The dead runtime paths, the detached-start IPC and its types, and the
sidecar packaging entries are gone; boot now calls engineStart directly
instead of a vestigial orchestratorWorkspaceActivate that only delegated to
it.

The single-container and microsandbox images run openwork-server directly,
with the plugins shipped and OPENWORK_EXTENSIONS_PLUGIN_DIR set. Their data
directory keeps its historical name on purpose - existing deployments have
volumes mounted there and renaming it would silently orphan their state. That
is a directory name only; the CLI is gone.

The release pipeline loses the sidecar job and the npm publish, and
verify-tag, review and bump-version no longer read a package.json that no
longer exists - they would have thrown on every release.

Legacy cleanup is deliberately preserved: users still have
~/.openwork/openwork-orchestrator on disk, so nuke keeps wiping it and the
tests keep asserting that.

Verified: apps/orchestrator deleted and the lockfile updated; app, server,
desktop-electron, den-api and den-web typechecks clean; 53 desktop electron
tests, 20 den-api cloud tests, 20 server db/env tests and the stats tests
pass; i18n audit passes across all locales; release review and verify-tag run
clean without the folder; every changed YAML parses. The server suite is
1083 pass / 7 fail, byte-identical to the pre-existing baseline on clean dev
(reload watcher/event timing plus one suite-order plugin test). The landing
prebuild parity check also fails identically on clean dev - unrelated.

* test(evals): make the cloud e2e sign-in frame state-independent

Frame 2 asserted the org-chooser screen, which only appears when a workspace
or server is already configured in the browser profile. It passed on the
dirty profiles I had been reusing and failed on a clean one - the app
legitimately lands on the first-run welcome screen instead.

It now proves what the frame actually claims: Den accepts the signed-in
admin session (node-side /v1/me, asserting the email matches), the browser
carries it, and the forced sign-in gate is no longer blocking. The wait is a
positive one for any settled post-gate surface, because a negative wait
passes on the empty DOM right after reload and the capture then lands on the
"checking" flash where app-root re-renders the gate.

Two runner behaviors worth recording: ctx.eval does not await promises, so an
async IIFE serializes to {} - probes belong node-side; and the screenshot
validator sees a later moment than the assertions, so transient states must
be waited out, not asserted around.

* fix(scripts): let the Daytona snapshot build run on arm64

The snapshot image is always linux/amd64 because that is what Daytona runs,
but the Dockerfile's runtime asserts execute the installed binaries. On an
arm64 machine those x86_64 binaries run under emulation and die with
"Illegal instruction (core dumped)", so the script could never build a
snapshot on Apple Silicon - it failed at the final assert stage every time.

Default RUNTIME_ASSERTS to 0 when the host is not x86_64, which is exactly
the cross-build path the Dockerfile already documents as "binaries must be
verified on target hardware". x86_64 hosts and CI keep asserting as before,
and the chosen value is echoed so a cross-build is obvious in the log.
2026-07-27 19:55:19 +02:00
ben e1a68743e3 refactor: remove opencode-router sidecar and the Telegram/Slack messaging feature (#2553) 2026-07-07 16:22:10 -07:00
Source Openandsrc-opn aa8e7d9577 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
Source Open afb0b73fcd 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
Omar McAdamandOmar McAdam 249031d992 fix: rename openwork-server package references (#1040)
Co-authored-by: Omar McAdam <omar@OpenWork-Studio.localdomain>
2026-03-19 14:27:34 -07:00
Omar McAdam db26e76891 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 955e3629f4 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
Benjamin Shafii d46404f018 chore: rename owpenwork to opencode-router 2026-02-14 23:28:46 -08:00
ben a4580ba428 refactor(router): rename owpenbot to opencode-router (#567) 2026-02-14 20:53:06 -08:00
ben b8c7476eae chore(dev): auto-build dev:headless-web binaries (#514) 2026-02-09 22:40:51 -08:00
Benjamin Shafii 401844f8fa feat(identities): show bot info, disconnect, and isolate owpenbot 2026-02-08 20:03:45 -08:00
Benjamin Shafii a075581f24 fix: harden headless web dev startup
Bind Vite to an explicit host/port and fail fast when the server binary is missing to avoid localhost-only binds and silent startup failures.
2026-02-04 15:17:02 -08:00
ben 454645e088 feat: auto-connect web sessions and sidebar workspace hub (#438) 2026-02-04 09:10:21 -08:00