Commit Graph

56 Commits

Author SHA1 Message Date
Jason Kneen
997a8ed3e9 refactor: codebase quality improvements — types, tests, error handling (#592)
* fix(desktop): suppress unused variable warnings in manager modules

Prefix unused `child` bindings with underscore in engine and openwork_server
managers to silence Rust compiler warnings.

* refactor(app): remove `as any` casts with typed SDK helpers

Create lib/opencode-session.ts that wraps OpenCode SDK session operations
(abort, revert, unrevert, shell, command listing) with proper types.

Replace all `(c.session as any).abort/revert/unrevert` and
`(c.command as any).list` calls in app.tsx with the typed helpers.

The SDK v2 already exposes these methods with full type definitions —
the casts were unnecessary and bypassed type safety on critical API paths.

* refactor(app): extract OpenWork server connection store

Create context/openwork-server.ts that encapsulates all OpenWork server
connection state: 15 signals, 6 polling effects, derived memos for
baseUrl/auth/client, and the health check helper.

This is a standalone module ready to replace the corresponding state in
app.tsx. It follows the same factory pattern as createSessionStore and
createExtensionsStore.

* feat(app): add safe execution utilities for error handling

Create lib/safe-run.ts with safeAsync, safeSync, and fireAndForget
helpers that replace bare `catch {}` blocks. Errors are logged in
development mode and silently swallowed in production.

This provides a migration path for the ~50 silent catch blocks.

* test(server): add unit tests for validators, utils, and token service

Add 41 new tests across 3 test files:

- validators.test.ts: sanitizeCommandName, validateCommandName,
  validateMcpName, validateSkillName, validateMcpConfig (22 tests)
- utils.test.ts: hashToken, shortId, parseList, ensureDir/exists (10 tests)
- tokens.test.ts: TokenService CRUD, scope resolution, revocation (9 tests)

Total server test count: 48 (from 7 previously).

---------

Co-authored-by: Benjamin Shafii <benjamin.shafii@gmail.com>
2026-02-17 10:53:11 -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
64ca5054a3 Fix sandbox mounts + add worker inbox panel (#571)
* fix(headless): stabilize sandbox startup config mounts

* feat(ui): add worker inbox panel and API
2026-02-15 13:27:20 -08:00
ben
32cc853d10 refactor(router): rename owpenbot to opencode-router (#567) 2026-02-14 20:53:06 -08:00
Benjamin Shafii
e03bd51189 fix(files): normalize workspace path prefixes
Accept workspace/ and /workspace/ paths across server file APIs and session markdown editor opens.
2026-02-13 10:23:50 -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
Benjamin Shafii
bad5021154 fix(server): allow owpenbot direct send to resolve active identity 2026-02-11 16:55:43 -08:00
Benjamin Shafii
dd0ce4b5fd fix(owpenbot): route direct sends by workspace identity directory 2026-02-11 16:27:23 -08:00
Benjamin Shafii
0ef02a3eb5 feat(owpenbot): scope workspace agent and split identities advanced tab 2026-02-11 15:22:02 -08:00
Benjamin Shafii
9547aaf68d feat(owpenbot): add workspace agent file behavior and outbound send wiring 2026-02-11 09:46:27 -08:00
ben
122d6b178d feat: workspace + session deletion (fixes #517) (#529)
* feat: add workspace and session deletion functions

* fix(ui): clear selection after session delete

* fix(ui): navigate away after deleting selected session

* fix(ui): redirect off deleted session route

* fix(router): handle deleted session routes

* docs(pr): add issue 517 screenshots
2026-02-10 18:36:35 -08:00
ben
fa6a189ff8 feat(skills): hub-backed skill catalog + install (#528)
* feat(skills): browse and install hub skills

* fix(skills): tolerate missing hub metadata
2026-02-10 18:33:54 -08:00
ben
30ecf1efc4 feat(mcp): add OAuth logout action (#527) 2026-02-10 18:01:03 -08:00
ben
017412ca49 feat(app): markdown editor for touched files (#518)
* feat(server): add markdown file read/write endpoints

* feat(app): edit markdown files from sidebar

* fix(app): open sidebar files without workspace prefix

* chore(pr): add markdown editor verification screenshots

* feat(app): dock markdown editor on the right

* refactor(app): dock markdown editor as right sidebar

* chore(pr): add sidebar editor verification screenshots
2026-02-10 10:01:44 -08:00
Benjamin Shafii
57d3681422 yo 2026-02-09 16:39:21 -08:00
Benjamin Shafii
3107c583e1 feat(owpenbot): auto-bind chats to workspace
Store a default directory on workspace identities and auto-create bindings on first inbound message. Remove the bindings editor from the Identities UI and keep /dir as the advanced override.
2026-02-09 15:28:53 -08:00
Benjamin Shafii
c365039510 feat(app): scope messaging identities to workspace
Enforces workspace-scoped owpenbot identities/bindings via openwork-server, updates the Identities UI and Tauri status schema, and adds UX evidence screenshots.
2026-02-09 14:21:28 -08:00
Benjamin Shafii
1953977906 feat(scheduler): support scoped scheduled jobs 2026-02-09 13:48:21 -08:00
Benjamin Shafii
3a88b1e0a9 fix(openwrk): make owpenbot health wiring reliable 2026-02-08 20:48:54 -08:00
Benjamin Shafii
1660c0782d chore(server): move audit log to host data dir 2026-02-08 20:44:09 -08:00
Benjamin Shafii
47c3c49bea feat(identities): show bot info, disconnect, and isolate owpenbot 2026-02-08 20:03:45 -08:00
Benjamin Shafii
92e1486894 feat(server): watch workspace files for reload events 2026-02-08 15:53:03 -08:00
ben
589c308bba fix(server): secure opencode proxy + add skill delete (#505)
* fix(server): harden opencode proxy auth

* feat(server): add skill delete endpoint

* fix(ci): reuse resolved OPENCODE_VERSION for desktop build

* fix(desktop): skip opencode version lookup when sidecar exists

* fix(desktop): avoid TDZ when reusing opencode sidecar

* chore(desktop): update Cargo.lock
2026-02-08 15:08:08 -08:00
ben
366bc36d55 feat(agent-lab): multi-instance host + Agent Lab Toy UI (#504)
* feat(agent-lab): add instance manager CLI

* fix(server): block opencode permission replies for non-owners

* feat(toy-ui): add share + checkpoints

* feat(agent-lab): add entrypoints and scheduler sync

* feat(server): add agentlab automations and skill delete

* feat(toy-ui): add agent lab panels
2026-02-08 13:58:50 -08:00
ben
f9a2809f96 feat: proxy owpenbot via openwork-server (#499)
* feat: proxy owpenbot via openwork-server

Unify client surface by routing owpenbot through /owpenbot/* (+ /w/:id/owpenbot/*), and move QR/token flows off interactive CLI calls. Sandbox mode keeps owpenbot internal (no extra published port) while preserving health + config via the edge.

* chore(desktop): refresh Cargo.lock

Update the Tauri crate lockfile so linux CI can run with --locked.
2026-02-07 15:44:12 -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
ben
265ed971b5 fix(owpenbot): make token saves fast and resilient (#488)
* fix(owpenbot): make token saves fast and resilient

Persist Telegram/Slack tokens even when owpenbot is offline, bound adapter restarts to avoid long hangs, and refresh UI status with apply warnings.

* chore: update Cargo.lock

Keep desktop Cargo.lock in sync with the crate version so CI cargo --locked passes.
2026-02-06 21:18:45 -08:00
ben
9b87ccaba7 feat: multi-workspace hosting + workspace-scoped tasks sidebar (#485)
* feat(server): expose all workspaces and support mounted baseUrl

* feat(ui): keep tasks visible across workspaces

* feat(desktop): default engine runtime to openwrk

* feat(owpenbot): route chats by directory bindings
2026-02-06 14:49:17 -08:00
ben
05a0499f88 feat(workspace): scope OpenWork sharing via /w/:id mounts (#479)
* feat(workspace): add Share modal in workspace menu

* feat(workspace): share workspace from session view

* feat(workspace): store OpenWork token per workspace

* feat(workspace): scope OpenWork sharing via /w/:id mounts
2026-02-06 00:07:23 -08:00
Benjamin Shafii
e1df942970 feat(skills): add basic viewer/editor with server-backed reads 2026-02-05 23:55:14 -08:00
ben
39a46b5540 feat(owpenbot): add Slack Socket Mode bridge (#476) 2026-02-05 18:26:02 -08:00
ben
b999903ead Fix reload-required spam; add auto-reload + resume (#467)
* fix(app): scope and defer reload prompts

Avoid reload-required spam by ignoring .opencode/openwork.json, scoping detection to the active workspace, and deferring prompts until sessions go idle. Add per-workspace auto-reload + optional resume so agent/skill/command updates apply without tearing down the UX.

* chore(desktop): sync Cargo.lock

Keep Cargo.lock consistent with the desktop crate version so CI can run cargo test --locked on Linux.
2026-02-05 14:00:51 -08:00
Benjamin Shafii
3bbcacb256 feat(headless): improve cross-service observability 2026-02-04 12:54:08 -08:00
ben
1b272355de feat: auto-connect web sessions and sidebar workspace hub (#438) 2026-02-04 09:10:21 -08:00
Benjamin Shafii
a2b334ebe9 fix: align remote MCP auth with workspace directory 2026-02-02 23:41:13 -08:00
ben
2695ea631a Refactor onboarding for startup preferences (#400)
* refactor(app): align onboarding with startup preferences

* chore: refresh pnpm lockfile

* feat(web): proxy OpenCode through OpenWork
2026-02-02 15:48:37 -08:00
Benjamin Shafii
3aa9f41b49 fix: try owpenbot health on request host 2026-02-01 16:27:21 -08:00
Benjamin Shafii
103bcd3ef5 fix: pass owpenbot health port through openwork server 2026-02-01 16:24:26 -08:00
Benjamin Shafii
95246d5270 feat: surface sidecar diagnostics for troubleshooting and releases 2026-02-01 16:18:18 -08:00
Benjamin Shafii
20d2497c36 Merge branch 'fix/owpenbot-telegram-remote' into dev 2026-02-01 16:08:46 -08:00
Benjamin Shafii
23bbd80bf8 chore: add owpenbot debug logging 2026-02-01 16:06:52 -08:00
ben
57941ccc02 feat: proxy owpenbot token updates through openwork server (#391) 2026-02-01 15:36:52 -08:00
Benjamin Shafii
f05226e5ec feat: proxy owpenbot token updates through openwork server 2026-02-01 15:32:28 -08:00
ben
bf001a8384 fix: wire reload toast through OpenWork server (#362)
* feat(app): reload via OpenWork server

* feat(server): emit reload events for UI

* fix: resolve reload timeout and approval errors

- Add idleTimeout: 120 to Bun.serve() to prevent 10-second timeout on long operations
- Pass --approval auto flag when spawning OpenWork server from desktop app
- Suppress dead_code warning on OpenwrkStateFile.version field
2026-01-31 23:34:24 -08:00
ben
4c82424390 Use OpenWork server for scheduled tasks (#354)
* feat(server): expose scheduler jobs for remote clients

* fix(app): load schedules from openwork host
2026-01-31 13:09:39 -08:00
Benjamin Shafii
6b6092fe1c fix(server): change workspaceConfigs to let for reassignment 2026-01-31 10:13:14 -08:00
Benjamin Shafii
389c57871d feat(app): wire openwrk runtime for host switching 2026-01-31 09:54:17 -08:00
ben
727013e646 Merge pull request #347 from different-ai/fix/openwrk-integrity-verify
fix(headless): verify sidecar integrity and auth handoff
2026-01-30 23:05:51 -08:00
Benjamin Shafii
0780ba1604 fix(headless): validate sidecar versions and auth handoff 2026-01-30 23:03:49 -08:00
ben
96c71851f3 feat(server): enable engine reloads for headless refresh (#345) 2026-01-30 22:42:44 -08:00