From 7294ef648f2ba2f79c35cc3b054c01aad49e0cde Mon Sep 17 00:00:00 2001 From: Hamza Date: Sun, 22 Nov 2026 01:53:05 +0000 Subject: [PATCH 01/18] Rename the product to MyMuse and add distributable desktop and mobile builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ship installable builds of this fork: the Electron shell in `apps/desktop` packages the existing Expo web client as Windows NSIS/portable/.msi, macOS .dmg, and Linux AppImage/.deb targets. Installing it as a local HTTP server on 127.0.0.1:8081 keeps the export's absolute asset paths and the API's default allowed origins working. Mobile installers go through EAS (`eas.json`), and the Release workflow builds every host plus the APK/IPA that cannot be produced locally. The product also takes its new name here, keeping the legacy `openmuse`/`OPENMUSE_*` identifiers as migration fallbacks. πŸ€– Generated with Codebuff Co-Authored-By: Codebuff --- .env.example | 14 +- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 126 + .gitignore | 3 +- CHANGELOG.md | 2 +- CONTRIBUTING.md | 6 +- LICENSE | 2 +- README.md | 117 +- ROADMAP.md | 2 +- SECURITY.md | 8 +- apps/computer/Dockerfile | 8 +- apps/computer/e2b-desktop-smoke.test.ts | 2 +- apps/computer/files.py | 2 +- apps/computer/smoke.test.ts | 6 +- apps/desktop/README.md | 40 + apps/desktop/electron-builder.yml | 51 + apps/desktop/main.cjs | 120 + apps/desktop/package.json | 25 + apps/mobile/App.tsx | 6 +- apps/mobile/README.md | 20 +- apps/mobile/app.json | 12 +- apps/mobile/assets/README.md | 4 +- apps/mobile/eas.json | 16 + apps/mobile/package.json | 6 +- apps/mobile/src/agent-ui.tsx | 8 +- apps/mobile/src/chat.tsx | 6 +- apps/mobile/src/details.tsx | 4 +- apps/mobile/src/screens.tsx | 4 +- apps/mobile/src/threads.tsx | 2 +- apps/mobile/src/ui.tsx | 4 +- apps/mobile/test/jev-actions.test.ts | 4 +- apps/mobile/tsconfig.json | 2 +- apps/server/src/agent.ts | 4 +- apps/server/src/app.ts | 8 +- apps/server/src/auth.ts | 2 +- apps/server/src/browser-console.ts | 4 +- apps/server/src/computer-backend.ts | 4 +- apps/server/src/computer-e2b-desktop.ts | 6 +- apps/server/src/computer.ts | 2 +- apps/server/src/config.ts | 14 +- apps/server/src/demo/entry.ts | 6 +- apps/server/src/demo/model.ts | 46 +- apps/server/src/engine/conversation.ts | 2 +- apps/server/src/engine/model.ts | 2 +- apps/server/src/engine/service.ts | 4 +- apps/server/src/index.ts | 2 +- apps/server/src/worker-entry.ts | 2 +- apps/server/src/workspace.ts | 2 +- apps/worker/README.md | 6 +- apps/worker/package-lock.json | 4 +- apps/worker/package.json | 2 +- apps/worker/src/browser.ts | 2 +- apps/worker/src/demo-entry.ts | 2 +- apps/worker/src/index.ts | 4 +- apps/worker/tests/close-resilience.test.ts | 2 +- apps/worker/tests/fixture-worker.ts | 2 +- apps/worker/tests/fixtures.ts | 6 +- apps/worker/tests/lifecycle.test.ts | 10 +- apps/worker/tests/run-docker.mjs | 6 +- biome.json | 3 +- docs/COMPUTER.md | 20 +- docs/DEMO.md | 18 +- docs/EXPERIENCE.md | 6 +- docs/FEATURES.md | 2 +- docs/OPENBOT-INTEGRATION.md | 14 +- docs/README.md | 4 +- docs/RICH-THREADS.md | 4 +- docs/TELEMETRY.md | 28 +- docs/VERIFICATION.md | 4 +- docs/demos/jev-generative-ui.md | 4 +- infra/compose.yaml | 2 +- package.json | 9 +- packages/backends/src/openbot.ts | 2 +- packages/domain/src/jev.ts | 2 +- packages/integrations/src/google.ts | 4 +- packages/integrations/src/pdf.ts | 4 +- packages/integrations/src/vault.ts | 2 +- pnpm-lock.yaml | 3294 +++++++++++++++++++- pnpm-workspace.yaml | 4 + render.yaml | 28 +- tests/agent-api.test.ts | 6 +- tests/api.test.ts | 2 +- tests/auth-startup.test.ts | 18 +- tests/browser-fixture-runner.test.ts | 6 +- tests/browser-imports-race.test.ts | 2 +- tests/browser-pdf-prefix.test.ts | 4 +- tests/browser.test.ts | 12 +- tests/computer-api.test.ts | 2 +- tests/computer-e2b-desktop.test.ts | 10 +- tests/computer-runner.test.ts | 12 +- tests/config.test.ts | 20 +- tests/conversation-jev.test.ts | 2 +- tests/demo-model.test.ts | 16 +- tests/engine.test.ts | 2 +- tests/helpers/browser.ts | 2 +- tests/helpers/computer.ts | 2 +- tests/jev.test.ts | 4 +- tests/model-outcome.test.ts | 4 +- tests/model-worker.test.ts | 12 +- tests/monitor-recovery.test.ts | 2 +- tests/persistence.test.ts | 4 +- tests/prepare-lease-loss.test.ts | 2 +- tests/rate-limit.test.ts | 2 +- tests/resource-ids.test.ts | 4 +- tests/rich-threads.test.ts | 2 +- tests/search.test.ts | 2 +- tests/telemetry.test.ts | 6 +- tests/workflows.test.ts | 4 +- 110 files changed, 4032 insertions(+), 386 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 apps/desktop/README.md create mode 100644 apps/desktop/electron-builder.yml create mode 100644 apps/desktop/main.cjs create mode 100644 apps/desktop/package.json create mode 100644 apps/mobile/eas.json diff --git a/.env.example b/.env.example index 603e35542..a42a4b495 100644 --- a/.env.example +++ b/.env.example @@ -6,7 +6,7 @@ PORT=8787 HOST=127.0.0.1 PUBLIC_API_URL=http://localhost:8787 ALLOWED_ORIGINS=http://localhost:8081,http://127.0.0.1:8081 -DATA_DIR=.openfuse +DATA_DIR=.mymuse TASK_WORKER_ENABLED=true # Rate limiting keys on the socket address. Set true only behind a reverse proxy that # overwrites X-Forwarded-For; otherwise callers can spoof it. @@ -32,7 +32,7 @@ WEB_SEARCH_ENABLED=true # OPENAI_CHAT_COMPLETIONS=true # Live Google workspace: WORKSPACE_MODE=live, AGENT_BACKEND=model. -# OPENFUSE_ACCESS_KEY= # random secret, at least 24 characters +# MYMUSE_ACCESS_KEY= # random secret, at least 24 characters # TOKEN_ENCRYPTION_KEY= # 32 random bytes encoded as base64 # GOOGLE_CLIENT_ID= # GOOGLE_CLIENT_SECRET= @@ -45,7 +45,7 @@ WEB_SEARCH_ENABLED=true # Browser worker (separate from the task worker): # BROWSER_WORKER_URL=http://127.0.0.1:8790 # WORKER_TOKEN= # same random 32+ character secret in API and browser worker -WORKER_DATA_DIR=.openfuse/browser-profiles +WORKER_DATA_DIR=.mymuse/browser-profiles WORKER_HOST=127.0.0.1 # An optional external raw AG-UI agent replaces conversational routing only. @@ -60,7 +60,7 @@ WORKER_HOST=127.0.0.1 # npx copilotkit@latest project select CPK_INTELLIGENCE_API_KEY= -# CopilotKit SDK telemetry goes through the shared sink to PostHog, tagged OpenFuse. +# CopilotKit SDK telemetry goes through the shared sink to PostHog, tagged MyMuse. # project select also writes CPK_TELEMETRY_ID: preserve that generated value and # deploy it alongside CPK_INTELLIGENCE_API_KEY to link runtime usage to the account. # Do not invent an identity or copy one from another project. @@ -72,14 +72,14 @@ CPK_INTELLIGENCE_API_KEY= # DO_NOT_TRACK=1 # Optional private Docker Linux computer (separate from the browser). -# Build first: docker build -t openfuse-computer:local apps/computer +# Build first: docker build -t mymuse-computer:local apps/computer # Docker must be reachable from the API and any separate task worker. COMPUTER_ENABLED=false -COMPUTER_IMAGE=openfuse-computer:local +COMPUTER_IMAGE=mymuse-computer:local # Optional deployment name shared by API and worker. When unset, a new install keeps a random # name in DATA_DIR; an install created before that keeps a hash of PUBLIC_API_URL. # COMPUTER_DEPLOYMENT_ID= # e.g. from `openssl rand -hex 12` -# Optional scoped Docker engine, e.g. DOCKER_CONTEXT=colima-openfuse +# Optional scoped Docker engine, e.g. DOCKER_CONTEXT=colima-mymuse # Or run each owner's computer in an E2B Desktop sandbox instead of Docker # (graphical desktop with internet access; see docs/COMPUTER.md): # COMPUTER_PROVIDER=e2b-desktop # default: docker diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 71e83996e..527f7072a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,5 +1,5 @@ name: Bug report -description: Report a reproducible OpenFuse failure +description: Report a reproducible MyMuse failure title: "[Bug] " body: - type: textarea diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 128ee435f..e6b49dfe3 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -5,7 +5,7 @@ body: - type: textarea id: outcome attributes: - label: What outcome should OpenFuse handle? + label: What outcome should MyMuse handle? validations: required: true - type: textarea diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 011d280c4..c87bbd68d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,6 +85,6 @@ jobs: - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 - run: pnpm install --frozen-lockfile - name: Build the isolated Linux computer - run: docker build -t openfuse-computer:local apps/computer + run: docker build -t mymuse-computer:local apps/computer - name: Verify computer isolation, persistence and cancellation run: pnpm test:computer diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..1bb119562 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,126 @@ +name: Release + +on: + workflow_dispatch: + push: + tags: ["v*"] + +permissions: + contents: read + +jobs: + desktop: + name: Desktop (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + env: + CSC_IDENTITY_AUTO_DISCOVERY: "false" + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 + with: + node-version: 24 + - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 + - run: pnpm install --frozen-lockfile + - run: pnpm build:web + - run: pnpm --dir apps/desktop exec electron-builder --publish never + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: desktop-${{ matrix.os }} + if-no-files-found: error + path: | + apps/desktop/release/*.exe + apps/desktop/release/*.msi + apps/desktop/release/*.dmg + apps/desktop/release/*.zip + apps/desktop/release/*.AppImage + apps/desktop/release/*.deb + + android: + name: Android APK (EAS) + runs-on: ubuntu-latest + env: + EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }} + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 + with: + node-version: 24 + - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 + - run: pnpm install --frozen-lockfile + - name: Check the Expo credentials + run: | + if [ -z "$EXPO_TOKEN" ]; then + echo "::error::Missing EXPO_TOKEN. Create one at https://expo.dev/settings/access-tokens, then add it under Settings -> Secrets and variables -> Actions -> New repository secret." + exit 1 + fi + if ! grep -q '"projectId"' apps/mobile/app.json; then + echo "::error::apps/mobile/app.json has no extra.eas.projectId. Run 'npx eas-cli init' in apps/mobile once, commit the change, and rerun this workflow." + exit 1 + fi + - name: Build the APK + working-directory: apps/mobile + run: | + pnpm exec eas build --platform android --profile preview --non-interactive --wait --json > "$RUNNER_TEMP/eas-android.json" + url=$(node -e ' + const builds = require(process.argv[1]); + const build = builds[0] ?? {}; + const url = build.artifacts?.buildUrl; + if (!url) { + console.error("EAS did not return an APK URL:", JSON.stringify(build).slice(0, 2000)); + process.exit(1); + } + console.log(url); + ' "$RUNNER_TEMP/eas-android.json") + curl -fL "$url" -o "MyMuse-${{ github.ref_name }}.apk" + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: android-apk + if-no-files-found: error + path: apps/mobile/MyMuse-${{ github.ref_name }}.apk + + ios: + name: iOS build (EAS) + runs-on: ubuntu-latest + env: + EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }} + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 + with: + node-version: 24 + - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 + - run: pnpm install --frozen-lockfile + - name: Check the Expo credentials + run: | + if [ -z "$EXPO_TOKEN" ]; then + echo "::error::Missing EXPO_TOKEN. Create one at https://expo.dev/settings/access-tokens, then add it under Settings -> Secrets and variables -> Actions -> New repository secret." + exit 1 + fi + if ! grep -q '"projectId"' apps/mobile/app.json; then + echo "::error::apps/mobile/app.json has no extra.eas.projectId. Run 'npx eas-cli init' in apps/mobile once, commit the change, and rerun this workflow." + exit 1 + fi + - name: Build the iOS app + working-directory: apps/mobile + run: | + pnpm exec eas build --platform ios --profile preview --non-interactive --wait --json > "$RUNNER_TEMP/eas-ios.json" + url=$(node -e ' + const builds = require(process.argv[1]); + const build = builds[0] ?? {}; + const url = build.artifacts?.buildUrl; + if (!url) { + console.error("EAS did not return an iOS build URL:", JSON.stringify(build).slice(0, 2000)); + process.exit(1); + } + console.log(url); + ' "$RUNNER_TEMP/eas-ios.json") + curl -fL "$url" -o "MyMuse-${{ github.ref_name }}.ipa" + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: ios-build + if-no-files-found: error + path: apps/mobile/MyMuse-${{ github.ref_name }}.ipa diff --git a/.gitignore b/.gitignore index d514a5df5..dc039a58b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,10 +2,11 @@ node_modules/ .expo/ dist/ build/ +release/ .env .env.local .env.*.local -.openfuse/ +.mymuse/ # Legacy name, kept so existing installs keep working. .openmuse/ apps/mobile/ios/ diff --git a/CHANGELOG.md b/CHANGELOG.md index ae88f8980..af4506f92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 0.1.0-alpha β€” 2026-09-15 -Initial public OpenFuse alpha. +Initial public MyMuse alpha. - Native/web interface using CopilotKit React Native and AG-UI. - Persistent browser computer, inline PDFs, structured artifacts, and optional Rich Threads integration. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f78e5fff1..6de6f1d6d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ -# Contributing to OpenFuse +# Contributing to MyMuse -OpenFuse is an MIT-licensed alpha. Contributions should make delegated work reliable and visible, with honest connector status and useful native interactions. +MyMuse is an MIT-licensed alpha. Contributions should make delegated work reliable and visible, with honest connector status and useful native interactions. ## Local development @@ -9,7 +9,7 @@ OpenFuse is an MIT-licensed alpha. Contributions should make delegated work reli 3. Run `pnpm dev` and, in another terminal, `pnpm dev:web`. 4. Use the fictional sample workspace for development and recordings. See [native setup](apps/mobile/README.md) for simulator/emulator builds. -Never commit `.env`, `.openfuse`, browser profiles, credentials, or personal documents. Live provider testing is optional for ordinary contributions; state exactly which paths you tested. +Never commit `.env`, `.mymuse`, browser profiles, credentials, or personal documents. Live provider testing is optional for ordinary contributions; state exactly which paths you tested. ## Checks before a pull request diff --git a/LICENSE b/LICENSE index 0e1238724..0c120f4c2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2026 OpenFuse contributors +Copyright (c) 2026 MyMuse contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 91512e288..c7aacc230 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
-# OpenFuse +# MyMuse **A personal agent with a browser, terminal, files, and work that keeps going. Compatible with any agent harness.** @@ -12,13 +12,13 @@ Built with CopilotKit React Native for iOS, Android, and web. [![CI](https://github.com/CopilotKit/openfuse/actions/workflows/ci.yml/badge.svg)](https://github.com/CopilotKit/openfuse/actions/workflows/ci.yml) [![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) -CopilotKit%2Fopenfuse | Trendshift +CopilotKit%2Fmymuse | Trendshift [![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy?repo=https://github.com/CopilotKit/openfuse) Clone this template and customize it however you want. -**[Building on OpenFuse? Meet with the CopilotKit team β†’](https://www.copilotkit.ai/talk-to-an-engineer?ref=openfuse_hero)** +**[Building on MyMuse? Meet with the CopilotKit team β†’](https://www.copilotkit.ai/talk-to-an-engineer?ref=mymuse_hero)**
@@ -26,7 +26,7 @@ Clone this template and customize it however you want. ## Demo -On iPhone, ask OpenFuse to find interesting stories on Hacker News and summarize CopilotKit. On desktop, ask it to check the school-trip email, open the message, and research exhibits at Monterey Bay Aquarium. The agent shows email and browser results inline. **Take control** opens that same browser session when you need it. +On iPhone, ask MyMuse to find interesting stories on Hacker News and summarize CopilotKit. On desktop, ask it to check the school-trip email, open the message, and research exhibits at Monterey Bay Aquarium. The agent shows email and browser results inline. **Take control** opens that same browser session when you need it. The send arrow becomes a stop square inside the input pill while the agent replies, then switches back. Stopping keeps your draft intact. See the [recording notes](docs/DEMO.md) for the model setup and reproduction steps. @@ -36,7 +36,7 @@ The [Jev aquarium-trip demo](docs/demos/jev-generative-ui.md) walks through a fi ## What it is -OpenFuse is a personal-agent application with an agent computer, visible work, and rich results. It runs its own server, task worker, and browser worker. You can inspect and change the source under the MIT license. +MyMuse is a personal-agent application with an agent computer, visible work, and rich results. It runs its own server, task worker, and browser worker. You can inspect and change the source under the MIT license. The computer combines **persistent Chromium and an optional Linux workspace**. The agent can browse public pages, run commands in its own container, work with files, and move PDFs between the computer and the app. You can open its browser or terminal and continue the work. Graphical desktops and autonomous checkout remain future work. @@ -62,8 +62,21 @@ The [feature inventory](docs/FEATURES.md) describes implemented capabilities and **Requirements:** Node 24 LTS, pnpm 11.19.0, and a CopilotKit Intelligence project key. The local sample app needs no model, Google account, or Docker. ```sh -git clone https://github.com/CopilotKit/openfuse.git openfuse -cd openfuse +git clone https://github.com/Hamza35779/openmuse.git openmuse +cd openmuse +``` + +Your clone's `origin` points at your fork ([Hamza35779/openmuse](https://github.com/Hamza35779/openmuse)). Add the original project as `upstream` so you can pull in its changes: + +```sh +git remote add upstream https://github.com/CopilotKit/openfuse.git +``` + +Enable the pinned package manager, install, and configure the environment: + +```sh +corepack enable +corepack prepare pnpm@11.19.0 --activate pnpm install --frozen-lockfile cp .env.example .env npx copilotkit@latest login @@ -81,6 +94,26 @@ pnpm dev:web Open [localhost:8081](http://localhost:8081). The API runs at [localhost:8787/api/health](http://localhost:8787/api/health). +If `corepack` is unavailable, install the pinned version directly with `npm install -g pnpm@11.19.0`. With `nvm` or `fnm` on macOS or Linux, `nvm install 24` (or `fnm install 24`) selects the required Node release. + +### Work on your own copy + +Commit and push to your own fork: + +```sh +git add -A +git commit -m "Describe the change" +git push origin main +``` + +Pull in changes from the original project without changing your remote: + +```sh +git fetch upstream +git merge upstream/main +git push origin main +``` + ### Try it 1. In Chat, send **β€œComplete the permission slip”**. Open the task, supply fictional form values, inspect the saved PDF, and review the prepared reply. This writes only to the local mailbox. @@ -90,6 +123,46 @@ Open [localhost:8081](http://localhost:8081). The API runs at [localhost:8787/ap For iOS or Android, use `pnpm --dir apps/mobile ios` or `pnpm --dir apps/mobile android`. Xcode or Android tooling is required. The PDF reader needs an Expo development build; use [native setup](apps/mobile/README.md). +## Installable apps + +Both desktop and mobile builds are clients for an API server. Set `EXPO_PUBLIC_API_URL` to a reachable server (for example your Render URL) when you build; the default is `http://localhost:8787`. + +### Desktop (Windows, macOS, Linux) + +The desktop app wraps the web client in an Electron shell (`apps/desktop`). + +```sh +pnpm build:desktop:win # NSIS installer, portable .exe, .msi +pnpm build:desktop:mac # .dmg and .zip +pnpm build:desktop:linux # .AppImage and .deb +``` + +Artifacts land in `apps/desktop/release`. Run each target on its own operating system: `.msi` and `.dmg` cannot be produced elsewhere, while the `.exe` targets also build on Linux with Wine and Xvfb (`xvfb-run -a pnpm --dir apps/desktop exec electron-builder --win nsis portable`). Builds are unsigned unless you provide signing credentials, so Windows SmartScreen and macOS Gatekeeper warn on first launch. Installers are also attached by the [Release workflow](#github-actions-builds). See [apps/desktop/README.md](apps/desktop/README.md). + +### Android and iOS + +Mobile installers are built with [EAS Build](https://docs.expo.dev/build/introduction/) using `apps/mobile/eas.json`. + +```sh +npx eas-cli login +npx eas-cli init # links the project and writes extra.eas.projectId +pnpm build:apk # preview profile: installable .apk +pnpm build:ipa # preview profile: installable iOS build +``` + +Both commands print a download link when the cloud build finishes. iOS builds need an Apple Developer account and a registered device; EAS prompts for credentials on the first run. For store submissions use `pnpm --dir apps/mobile dist:store`, which builds an Android App Bundle and an App Store IPA. To point a cloud build at your server, add `"env": { "EXPO_PUBLIC_API_URL": "https://your-api.example.com" }` to the chosen profile in `apps/mobile/eas.json`. + +### GitHub Actions builds + +Run **Actions β†’ Release β†’ Run workflow**, or push a `v*` tag. The desktop matrix (Ubuntu, Windows, macOS) uploads the installable files as workflow artifacts, and the Android and iOS jobs upload the `.apk` and `.ipa` EAS produces. + +The mobile jobs need two things set up once: + +1. Link the Expo project: `cd apps/mobile && npx eas-cli login && npx eas-cli init`, then commit the generated `extra.eas.projectId` in `apps/mobile/app.json`. Without it the jobs stop with a message telling you to do this. +2. Create a robot token at [expo.dev/settings/access-tokens](https://expo.dev/settings/access-tokens) and add it as a repository secret named `EXPO_TOKEN` (**Settings β†’ Secrets and variables β†’ Actions β†’ New repository secret**). + +With both in place, run the workflow; it waits for each EAS build and attaches the download as the `android-apk` and `ios-build` artifacts. The iOS build also needs an Apple Developer account and registered devices, which EAS asks for on the first run. + ## Deploy on Render [![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy?repo=https://github.com/CopilotKit/openfuse) @@ -98,9 +171,9 @@ For iOS or Android, use `pnpm --dir apps/mobile ios` or `pnpm --dir apps/mobile ### First run -1. Click **Deploy to Render**. Wait until `openfuse-api`, `openfuse-web`, and `openfuse-browser` are live. -2. On `openfuse-api`, open **Environment** and copy `OPENFUSE_ACCESS_KEY`. -3. Open the `openfuse-web` URL and sign in with that key. +1. Click **Deploy to Render**. Wait until `mymuse-api`, `mymuse-web`, and `mymuse-browser` are live. +2. On `mymuse-api`, open **Environment** and copy `MYMUSE_ACCESS_KEY`. +3. Open the `mymuse-web` URL and sign in with that key. 4. Send a message. The deploy form asks for three values you provide. Render generates the other two. @@ -110,18 +183,18 @@ The deploy form asks for three values you provide. Render generates the other tw | `CPK_INTELLIGENCE_API_KEY` | You. Run `npx copilotkit@latest login`, then `npx copilotkit@latest project select`. Keep it on the server. | Chat cannot open a thread. | | `CPK_TELEMETRY_ID` | You. Keep the identity generated by the same project selection. | Runtime usage cannot be attributed to the Intelligence signup account. | | `OPENAI_API_KEY` | You. Used by the default `openai/gpt-5`. Change `MODEL` and supply the matching provider key for Anthropic or Google. | The model call fails. | -| `OPENFUSE_ACCESS_KEY` | Render | You cannot sign in. | +| `MYMUSE_ACCESS_KEY` | Render | You cannot sign in. | | `TOKEN_ENCRYPTION_KEY` | Render | The API refuses to start in live mode. | -Health check: `https:///api/health`. +Health check: `https:///api/health`. ### Services | Service | Plan | What it runs | |---|---|---| -| `openfuse-api` | Standard, with a 1 GB disk at `/var/data` | The Hono API and the in-process task worker. `DATA_DIR` is `/var/data/openfuse`. | -| `openfuse-web` | Static site | The Expo web export. `EXPO_PUBLIC_API_URL` is baked in at build time. | -| `openfuse-browser` | Private service, Standard, 1 GB disk at `/data` | Playwright and Chromium. The API calls it on the private network. | +| `mymuse-api` | Standard, with a 1 GB disk at `/var/data` | The Hono API and the in-process task worker. `DATA_DIR` is `/var/data/mymuse`. | +| `mymuse-web` | Static site | The Expo web export. `EXPO_PUBLIC_API_URL` is baked in at build time. | +| `mymuse-browser` | Private service, Standard, 1 GB disk at `/data` | Playwright and Chromium. The API calls it on the private network. | **Standard** is the smallest plan that stays up. At 512 MB the process runs out of memory before it binds a port, because PGlite loads an embedded Postgres build. @@ -129,7 +202,7 @@ Health check: `https:///api/health`. **Live mode** is required. Render binds `0.0.0.0`, and sample mode rejects any host that is not loopback. The Blueprint sets `WORKSPACE_MODE=live`. -**Browsing is included, and you can take it out.** `openfuse-browser` is a private service, so it has no public URL. The API reaches it at `http://openfuse-browser:8790` with a token Render generates. If the private hostname is not `openfuse-browser`, set `BROWSER_WORKER_URL` to `http://:8790`. To deploy without it, delete the `openfuse-browser` service and the `BROWSER_WORKER_URL` and `WORKER_TOKEN` entries on `openfuse-api`. Chat, drafts, and tasks still run. Page reads, screenshots, and **Take control** do not. +**Browsing is included, and you can take it out.** `mymuse-browser` is a private service, so it has no public URL. The API reaches it at `http://mymuse-browser:8790` with a token Render generates. If the private hostname is not `mymuse-browser`, set `BROWSER_WORKER_URL` to `http://:8790`. To deploy without it, delete the `mymuse-browser` service and the `BROWSER_WORKER_URL` and `WORKER_TOKEN` entries on `mymuse-api`. Chat, drafts, and tasks still run. Page reads, screenshots, and **Take control** do not. The Docker computer and Google mail or calendar need the setup in the sections below. This Blueprint does not start them. @@ -139,7 +212,7 @@ Copy the commented settings in [.env.example](.env.example) into your private `. 1. Set `AGENT_BACKEND=model`, `MODEL=provider/model-id`, and the matching provider key. CopilotKit supports the configured OpenAI, Anthropic or Google provider. Fictional data can still be used with a real model. Provider keys stay on the server. 2. Create or select a CopilotKit Intelligence project with `npx copilotkit@latest login` and `npx copilotkit@latest project select`. Keep the generated `CPK_INTELLIGENCE_API_KEY` on the server. -3. For personal mail/calendar, set `WORKSPACE_MODE=live`, the generated `CPK_INTELLIGENCE_API_KEY`, a random `OPENFUSE_ACCESS_KEY` of at least 24 characters, and `TOKEN_ENCRYPTION_KEY` containing 32 random bytes encoded as base64. Restart the API. +3. For personal mail/calendar, set `WORKSPACE_MODE=live`, the generated `CPK_INTELLIGENCE_API_KEY`, a random `MYMUSE_ACCESS_KEY` of at least 24 characters, and `TOKEN_ENCRYPTION_KEY` containing 32 random bytes encoded as base64. Restart the API. 4. Configure a Google OAuth web client with Gmail and Calendar APIs enabled. Set `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET`; register `${PUBLIC_API_URL}/api/google/callback` as its redirect URI. Configure consent/test-user access in your Google project. 5. Open **Apps β†’ Gmail** (or **Google Calendar**), connect read access, and grant write access when needed. Every send or calendar change still requires its own stored review. Changing/disconnecting the account invalidates pending connection-bound work. @@ -169,7 +242,7 @@ Or use `docker compose --env-file .env -f infra/compose.yaml up --build -d`. The Build the computer image, enable it on the API, then open **Computer β†’ Terminal β†’ Start computer**: ```sh -docker build -t openfuse-computer:local apps/computer +docker build -t mymuse-computer:local apps/computer COMPUTER_ENABLED=true pnpm dev ``` @@ -177,7 +250,7 @@ The API needs access to the Docker CLI and engine. Commands run in a nonroot con ### Application storage -By default, embedded PGlite, documents and the signing key live in `.openfuse/`; browser profiles live in `.openfuse/browser-profiles/`. Keep that directory private and back it up. The API hosts the task worker. The host must remain running for background work. +By default, embedded PGlite, documents and the signing key live in `.mymuse/`; browser profiles live in `.mymuse/browser-profiles/`. Keep that directory private and back it up. The API hosts the task worker. The host must remain running for background work. For a separate task worker, configure the same `DATABASE_URL`, secrets and shared `DATA_DIR` for both processes, then set `TASK_WORKER_ENABLED=false` on the API and run `pnpm dev:worker`. PGlite cannot be opened by separate processes. Production commands are `pnpm build:server`, `pnpm start` and `pnpm start:worker`. Run one API instance; task workers coordinate through SQL leases. @@ -191,7 +264,7 @@ Intelligence is a separate service and is not included in this repository's MIT ## Signup and runtime tracking -The CopilotKit SDK sends runtime telemetry through the shared CopilotKit sink to PostHog with `accessibility_title: "OpenFuse"`. Telemetry defaults to full capture; explicit SDK opt-outs and sampling settings take precedence. Keep the CLI-generated `CPK_TELEMETRY_ID` alongside the server-only project key when deploying. Intelligence records completed account signups separately; OpenFuse runtime usage can be joined to those accounts after the sink resolves the identity. [Setup, opt-out and PostHog validation](docs/TELEMETRY.md). +The CopilotKit SDK sends runtime telemetry through the shared CopilotKit sink to PostHog with `accessibility_title: "MyMuse"`. Telemetry defaults to full capture; explicit SDK opt-outs and sampling settings take precedence. Keep the CLI-generated `CPK_TELEMETRY_ID` alongside the server-only project key when deploying. Intelligence records completed account signups separately; MyMuse runtime usage can be joined to those accounts after the sink resolves the identity. [Setup, opt-out and PostHog validation](docs/TELEMETRY.md). ## Architecture @@ -226,7 +299,7 @@ flowchart TD ### OpenBot compatibility -OpenFuse's native client and personal-agent workflows are independent of OpenBot. The disabled OpenBot adapter is pinned and contract-tested against upstream interfaces. Live user/session bridging, routine mapping, and computer backend wiring remain future work. OpenBot's Intelligence runtime is not a raw AG-UI endpoint. [Integration contract](docs/OPENBOT-INTEGRATION.md). +MyMuse's native client and personal-agent workflows are independent of OpenBot. The disabled OpenBot adapter is pinned and contract-tested against upstream interfaces. Live user/session bridging, routine mapping, and computer backend wiring remain future work. OpenBot's Intelligence runtime is not a raw AG-UI endpoint. [Integration contract](docs/OPENBOT-INTEGRATION.md). ## Development @@ -243,7 +316,7 @@ pnpm test:browser pnpm test:computer ``` -Platform build scripts export JavaScript/Hermes bundles; they do not produce signed app binaries. Browser checks use controlled HTTP fixtures; the local check requires installed Chromium, and the container check requires Docker and registry access to build its image. CI also exercises the browser and Linux computer containers. See [contribution guidance](CONTRIBUTING.md) and [verification results](docs/VERIFICATION.md). +Platform build scripts export JavaScript/Hermes bundles; they do not produce signed app binaries. Use the [installable app builds](#installable-apps) for those. Browser checks use controlled HTTP fixtures; the local check requires installed Chromium, and the container check requires Docker and registry access to build its image. CI also exercises the browser and Linux computer containers. See [contribution guidance](CONTRIBUTING.md) and [verification results](docs/VERIFICATION.md). ## Contributing and license diff --git a/ROADMAP.md b/ROADMAP.md index 83c977334..cc58c6860 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,4 +1,4 @@ -# OpenFuse roadmap +# MyMuse roadmap The release is a personal-agent alpha: delegate a job, inspect its plan, supply missing information, review an action, and return to a saved result. The [reference inventory](docs/FEATURES.md) is broader than this release. diff --git a/SECURITY.md b/SECURITY.md index bcdfc706e..52dc7e59d 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -6,9 +6,9 @@ Use the repository's **Security β†’ Report a vulnerability** form for private re ## Deployment boundary -OpenFuse currently supports one owner per deployment. Live mode uses a shared access key; it is not multi-tenant account authentication. Sample mode binds to loopback and contains fictional data. Use HTTPS and restricted network access for a remote live deployment. +MyMuse currently supports one owner per deployment. Live mode uses a shared access key; it is not multi-tenant account authentication. Sample mode binds to loopback and contains fictional data. Use HTTPS and restricted network access for a remote live deployment. -The API holds provider credentials. Google tokens are encrypted at rest; short-lived signed URLs grant file and browser-console access. Protect `.env`, `.openfuse`, database backups, and browser profiles as private data. A signed URL is a credential until it expires. +The API holds provider credentials. Google tokens are encrypted at rest; short-lived signed URLs grant file and browser-console access. Protect `.env`, `.mymuse`, database backups, and browser profiles as private data. A signed URL is a credential until it expires. The browser worker must remain private and require its own random token. It runs persistent Chromium with application-enforced public-network checks. Playwright disables Chromium's internal sandbox by default; this is not a full desktop VM or a security boundary for hostile tenants. The browser Docker image reduces host access but does not establish kernel-enforced network isolation. See [worker boundaries](apps/worker/README.md). @@ -18,7 +18,7 @@ The optional computer service runs a **single-owner Docker Linux container**, se The container runs as UID/GID 1000 with a read-only root filesystem, all capabilities dropped, no added privileges, and Docker networking set to `none`. It receives no host directory mounts, Docker socket, model keys, Google tokens, or API access key. Limits are 512 MB RAM with no swap, one CPU, 128 processes, and 64 MB of temporary storage. Existing containers and volumes must match this deployment's ownership labels and isolation settings before the service attaches. -A named volume persists `/workspace`. Commands may create, change, or delete its files. The file API stays inside `/workspace`, rejects symlink traversal and special files, and uses atomic text replacement. Text reads/writes are limited to 256 KB; PDF import/export is limited to 10 MB and checks ownership in OpenFuse. File contents and command output remain untrusted input for the agent. +A named volume persists `/workspace`. Commands may create, change, or delete its files. The file API stays inside `/workspace`, rejects symlink traversal and special files, and uses atomic text replacement. Text reads/writes are limited to 256 KB; PDF import/export is limited to 10 MB and checks ownership in MyMuse. File contents and command output remain untrusted input for the agent. Commands have a 30-second container timeout, a 2-second kill grace, a 35-second Docker-client timeout, and a combined 128 KB output cap. The server records output, status, and exit codes. Stop prevents restart until both Docker stop and the original execution are acknowledged. Failed cleanup retains a safety lock and permits an explicit Stop retry. Interrupted work is recorded with an uncertain outcome and is never automatically replayed. @@ -26,7 +26,7 @@ Docker shares its host kernel and does not provide a full VM or a hostile-tenant ### E2B desktop provider (opt-in) -With `COMPUTER_PROVIDER=e2b-desktop`, each owner's computer is a dedicated E2B Desktop VM instead of a Docker container, and the paragraphs above about Docker networking, the read-only root filesystem, capabilities and limits do not apply. Outbound internet access is enabled, the in-VM `user` account has passwordless sudo, and `/workspace` is stored with E2B. Internet access is an egress path that OpenFuse does not review: approval gating covers only the app's own email and calendar tools, so a prompt-injected agent could send data from the computer or submit forms in its browser. The live desktop stream is reachable from the internet and protected only by the VNC password in its URL (8 effective characters); treat that URL as a bearer secret. All listening VM ports are publicly reachable at `https://-.e2b.app` without application authentication; public traffic is enabled to allow the direct desktop iframe. The sandbox ID appears in the stream hostname and is not an access control. For example, `python3 -m http.server 8000` in `/workspace` exposes workspace files to the internet. Do not leave servers running or put sensitive files in an unauthenticated service. The iframe is sandboxed to block forms, popups and top-level navigation, but VM-controlled content can still display misleading prompts. The E2B API key stays on the API host and is never passed into the VM or to the client. A unique `COMPUTER_DEPLOYMENT_ID` is required, because sandboxes are matched by metadata across the whole E2B team. See [the E2B desktop section](docs/COMPUTER.md#run-the-computer-on-an-e2b-desktop-optional). +With `COMPUTER_PROVIDER=e2b-desktop`, each owner's computer is a dedicated E2B Desktop VM instead of a Docker container, and the paragraphs above about Docker networking, the read-only root filesystem, capabilities and limits do not apply. Outbound internet access is enabled, the in-VM `user` account has passwordless sudo, and `/workspace` is stored with E2B. Internet access is an egress path that MyMuse does not review: approval gating covers only the app's own email and calendar tools, so a prompt-injected agent could send data from the computer or submit forms in its browser. The live desktop stream is reachable from the internet and protected only by the VNC password in its URL (8 effective characters); treat that URL as a bearer secret. All listening VM ports are publicly reachable at `https://-.e2b.app` without application authentication; public traffic is enabled to allow the direct desktop iframe. The sandbox ID appears in the stream hostname and is not an access control. For example, `python3 -m http.server 8000` in `/workspace` exposes workspace files to the internet. Do not leave servers running or put sensitive files in an unauthenticated service. The iframe is sandboxed to block forms, popups and top-level navigation, but VM-controlled content can still display misleading prompts. The E2B API key stays on the API host and is never passed into the VM or to the client. A unique `COMPUTER_DEPLOYMENT_ID` is required, because sandboxes are matched by metadata across the whole E2B team. See [the E2B desktop section](docs/COMPUTER.md#run-the-computer-on-an-e2b-desktop-optional). ## External actions diff --git a/apps/computer/Dockerfile b/apps/computer/Dockerfile index 4ef4cf852..8c6e6cb3b 100644 --- a/apps/computer/Dockerfile +++ b/apps/computer/Dockerfile @@ -3,13 +3,13 @@ FROM node:22.22.0-bookworm-slim RUN apt-get update \ && apt-get install -y --no-install-recommends bash python3 git coreutils \ && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /opt/openfuse /workspace \ + && mkdir -p /opt/mymuse /workspace \ && chown 1000:1000 /workspace -COPY files.py /opt/openfuse/files.py -RUN chmod 0555 /opt/openfuse/files.py +COPY files.py /opt/mymuse/files.py +RUN chmod 0555 /opt/mymuse/files.py # Legacy path, kept so existing installs keep working. -RUN ln -s /opt/openfuse /opt/openmuse +RUN ln -s /opt/mymuse /opt/openmuse ENV HOME=/workspace LANG=C.UTF-8 WORKDIR /workspace diff --git a/apps/computer/e2b-desktop-smoke.test.ts b/apps/computer/e2b-desktop-smoke.test.ts index 0de8cb8d0..af463402a 100644 --- a/apps/computer/e2b-desktop-smoke.test.ts +++ b/apps/computer/e2b-desktop-smoke.test.ts @@ -18,7 +18,7 @@ test("real E2B desktop runs commands, opens GUI apps, streams, acts, persists fi timeout: 300000, skip: !apiKey && "set E2B_API_KEY to run the E2B desktop smoke test", }, async () => { - const directory = await mkdtemp(join(tmpdir(), "openfuse-e2b-desktop-smoke-")); + const directory = await mkdtemp(join(tmpdir(), "mymuse-e2b-desktop-smoke-")); const db = await createStore(); const config: Config = { mode: "sample", diff --git a/apps/computer/files.py b/apps/computer/files.py index 270a5f1f3..1610df08d 100644 --- a/apps/computer/files.py +++ b/apps/computer/files.py @@ -76,7 +76,7 @@ def main(): raise ValueError("Only regular files can be replaced") except FileNotFoundError: pass - temporary = ".openfuse-" + uuid.uuid4().hex + temporary = ".mymuse-" + uuid.uuid4().hex fd = os.open(temporary, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o600, dir_fd=directory) try: with os.fdopen(fd, "wb") as target: diff --git a/apps/computer/smoke.test.ts b/apps/computer/smoke.test.ts index dc9201916..59db0e8d9 100644 --- a/apps/computer/smoke.test.ts +++ b/apps/computer/smoke.test.ts @@ -16,7 +16,7 @@ import { createStore } from "../server/src/db.ts"; test("real isolated computer executes commands, persists files, bridges PDFs and stops active work", { timeout: 120000, }, async () => { - const directory = await mkdtemp(join(tmpdir(), "openfuse-computer-smoke-")); + const directory = await mkdtemp(join(tmpdir(), "mymuse-computer-smoke-")); const db = await createStore(); const config: Config = { mode: "sample", @@ -29,7 +29,7 @@ test("real isolated computer executes commands, persists files, bridges PDFs and googleRedirectUri: "http://localhost/callback", allowedOrigins: [], computerEnabled: true, - computerImage: process.env.COMPUTER_IMAGE ?? "openfuse-computer:local", + computerImage: process.env.COMPUTER_IMAGE ?? "mymuse-computer:local", computerDeploymentId: `smoke-${randomUUID()}`, }; const server = await createApp(db, config); @@ -68,7 +68,7 @@ test("real isolated computer executes commands, persists files, bridges PDFs and (await post("/files/read", { path: "/workspace/notes/hello.txt" })).text, "Hello from the API βœ“", ); - const denied = await post("/commands", { command: "touch /etc/openfuse-must-fail" }); + const denied = await post("/commands", { command: "touch /etc/mymuse-must-fail" }); assert.equal(denied.status, "failed"); const network = await post("/commands", { command: "python3 -c 'import socket; socket.create_connection((\"1.1.1.1\", 443), 1)'", diff --git a/apps/desktop/README.md b/apps/desktop/README.md new file mode 100644 index 000000000..ccc8424db --- /dev/null +++ b/apps/desktop/README.md @@ -0,0 +1,40 @@ +# MyMuse desktop + +An Electron shell around the Expo web client, packaged for Windows, macOS, and Linux with +[electron-builder](https://www.electron.build). + +`main.cjs` serves the exported web client (`apps/mobile/dist/web`) from a local HTTP server on +`127.0.0.1:8081` and loads it in a window. It must be a real HTTP origin, not `file://`, because the +Expo export uses absolute asset paths and the API accepts `http://localhost:8081` and +`http://127.0.0.1:8081` by default. + +## Run + +```sh +pnpm dev:desktop +``` + +This builds the web client, then opens the desktop window. The API still runs separately +(`pnpm dev`) and is reached at `http://localhost:8787`. + +## Package + +```sh +pnpm build:desktop:win # NSIS installer, portable .exe, .msi +pnpm build:desktop:mac # .dmg and .zip +pnpm build:desktop:linux # .AppImage and .deb +pnpm build:desktop # current platform only +``` + +Artifacts land in `apps/desktop/release`. The `.msi` and `.dmg` targets need their native build +hosts; `.exe` targets can also be cross-built on Linux with Wine and a virtual display: + +```sh +xvfb-run -a pnpm --dir apps/desktop exec electron-builder --win nsis portable +``` + +Builds are unsigned unless signing credentials are configured (`CSC_LINK`/`CSC_KEY_PASSWORD` for +Windows and macOS). macOS also requires `CSC_IDENTITY_AUTO_DISCOVERY=false` for unsigned builds. + +The packaged app contains the web client under `resources/web` and does not need Node or pnpm at +runtime. It does need a reachable API, set via `EXPO_PUBLIC_API_URL` when the web client is built. diff --git a/apps/desktop/electron-builder.yml b/apps/desktop/electron-builder.yml new file mode 100644 index 000000000..310c95b7d --- /dev/null +++ b/apps/desktop/electron-builder.yml @@ -0,0 +1,51 @@ +appId: app.mymuse.desktop +productName: MyMuse +executableName: MyMuse +copyright: MIT licensed. Built by CopilotKit. +directories: + output: release + buildResources: build +asar: true +npmRebuild: false +electronLanguages: [en-US] +files: + - main.cjs + - package.json +extraResources: + - from: ../mobile/dist/web + to: web + filter: + - "**/*" + - "!**/*.map" + - "!**/*.d.ts" + - "!**/.DS_Store" +artifactName: ${productName}-${version}-${os}-${arch}.${ext} +win: + icon: build/icon.png + target: + - target: nsis + arch: [x64] + - target: portable + arch: [x64] + - target: msi + arch: [x64] +nsis: + artifactName: ${productName}-${version}-win-${arch}-setup.${ext} + oneClick: false + perMachine: false + allowToChangeInstallationDirectory: true + createDesktopShortcut: true +portable: + artifactName: ${productName}-${version}-win-${arch}-portable.${ext} +msi: + artifactName: ${productName}-${version}-win-${arch}.${ext} +mac: + icon: build/icon.png + category: public.app-category.productivity + target: [dmg, zip] +linux: + icon: build/icon.png + category: Utility + maintainer: CopilotKit + synopsis: Personal agent with a browser, terminal, and files + target: [AppImage, deb] diff --git a/apps/desktop/main.cjs b/apps/desktop/main.cjs new file mode 100644 index 000000000..80a16c688 --- /dev/null +++ b/apps/desktop/main.cjs @@ -0,0 +1,120 @@ +const { app, BrowserWindow, dialog, shell } = require("electron"); +const fs = require("node:fs"); +const http = require("node:http"); +const path = require("node:path"); + +const DEFAULT_PORT = 8081; +const MIME = { + ".css": "text/css; charset=utf-8", + ".html": "text/html; charset=utf-8", + ".ico": "image/x-icon", + ".jpeg": "image/jpeg", + ".jpg": "image/jpeg", + ".js": "text/javascript; charset=utf-8", + ".json": "application/json; charset=utf-8", + ".map": "application/json; charset=utf-8", + ".png": "image/png", + ".svg": "image/svg+xml", + ".ttf": "font/ttf", + ".txt": "text/plain; charset=utf-8", + ".wasm": "application/wasm", + ".webp": "image/webp", + ".woff": "font/woff", + ".woff2": "font/woff2", +}; + +// The Expo web export is packaged next to the app; in the repository it is +// built by `pnpm --dir apps/mobile build:web`. +const webRoot = app.isPackaged + ? path.join(process.resourcesPath, "web") + : path.resolve(__dirname, "../mobile/dist/web"); + +app.setName("MyMuse"); + +function lookupFile(urlPath) { + const clean = decodeURIComponent((urlPath || "/").split("?")[0].split("#")[0]); + const candidate = path.resolve(webRoot, clean.replace(/^\/+/, "") || "index.html"); + if (!candidate.startsWith(webRoot + path.sep)) return null; + if (fs.existsSync(candidate) && fs.statSync(candidate).isFile()) return candidate; + // Unknown extensionless routes fall back to the single-page entry point. + return path.extname(clean) ? null : path.join(webRoot, "index.html"); +} + +function startServer() { + return new Promise((resolve, reject) => { + if (!fs.existsSync(path.join(webRoot, "index.html"))) { + reject( + new Error( + `No web build found at ${webRoot}. Run "pnpm --dir apps/mobile build:web" first.`, + ), + ); + return; + } + const server = http.createServer((request, response) => { + const file = lookupFile(request.url); + if (!file) { + response.writeHead(404, { "Content-Type": "text/plain; charset=utf-8" }); + response.end("Not found"); + return; + } + response.writeHead(200, { + "Content-Type": MIME[path.extname(file).toLowerCase()] || "application/octet-stream", + "Cache-Control": "no-cache", + }); + fs.createReadStream(file) + .on("error", () => response.destroy()) + .pipe(response); + }); + server.once("error", reject); + server.listen(Number(process.env.MYMUSE_DESKTOP_PORT || DEFAULT_PORT), "127.0.0.1", () => + resolve(server), + ); + }); +} + +let baseUrl = ""; + +function createWindow() { + const window = new BrowserWindow({ + width: 1280, + height: 900, + minWidth: 380, + minHeight: 600, + backgroundColor: "#FCFCFC", + title: "MyMuse", + autoHideMenuBar: process.platform !== "darwin", + webPreferences: { contextIsolation: true, nodeIntegration: false, sandbox: true }, + }); + window.loadURL(`${baseUrl}/`); + window.webContents.setWindowOpenHandler(({ url }) => { + if (/^https?:\/\//.test(url)) void shell.openExternal(url); + return { action: "deny" }; + }); + window.webContents.on("will-navigate", (event, url) => { + if (url.startsWith(baseUrl)) return; + event.preventDefault(); + if (/^https?:\/\//.test(url)) void shell.openExternal(url); + }); + return window; +} + +app.whenReady().then(async () => { + try { + const server = await startServer(); + baseUrl = `http://127.0.0.1:${server.address().port}`; + createWindow(); + } catch (error) { + dialog.showErrorBox( + "MyMuse could not start", + `${error instanceof Error ? error.message : String(error)}\n\nBuild the web client, then try again.`, + ); + app.quit(); + } + app.on("activate", () => { + if (baseUrl && BrowserWindow.getAllWindows().length === 0) createWindow(); + }); +}); + +app.on("window-all-closed", () => { + if (process.platform !== "darwin") app.quit(); +}); diff --git a/apps/desktop/package.json b/apps/desktop/package.json new file mode 100644 index 000000000..86a55aedb --- /dev/null +++ b/apps/desktop/package.json @@ -0,0 +1,25 @@ +{ + "name": "@mymuse/desktop", + "version": "0.1.0", + "private": true, + "description": "MyMuse desktop app for Windows, macOS, and Linux.", + "author": "CopilotKit", + "license": "MIT", + "homepage": "https://github.com/Hamza35779/openmuse", + "repository": { + "type": "git", + "url": "https://github.com/Hamza35779/openmuse.git" + }, + "main": "main.cjs", + "scripts": { + "start": "electron .", + "dist": "electron-builder --publish never", + "dist:win": "electron-builder --win --publish never", + "dist:mac": "electron-builder --mac --publish never", + "dist:linux": "electron-builder --linux --publish never" + }, + "devDependencies": { + "electron": "^45.4.1", + "electron-builder": "^26.18.0" + } +} diff --git a/apps/mobile/App.tsx b/apps/mobile/App.tsx index 53e192a60..065ecb7de 100644 --- a/apps/mobile/App.tsx +++ b/apps/mobile/App.tsx @@ -111,7 +111,7 @@ export default function App() { - Welcome to OpenFuse. + Welcome to MyMuse. A little room for your day. {busy ? ( @@ -130,7 +130,7 @@ export default function App() { Open workspace - Local workspaces open without a key. Make sure your OpenFuse server is running at{" "} + Local workspaces open without a key. Make sure your MyMuse server is running at{" "} {API_URL}. @@ -261,7 +261,7 @@ function WorkspaceShell({ data?.tasks.find( (task) => task.status === "waiting_approval" || task.status === "waiting_input", ) || data?.tasks.find((task) => task.status === "running"); - const agentName = data?.identity.name || "OpenFuse"; + const agentName = data?.identity.name || "MyMuse"; const status = activeTask ? activeTask.status === "waiting_approval" ? `Ready to review Β· ${activeTask.title}` diff --git a/apps/mobile/README.md b/apps/mobile/README.md index 7116de34d..a1f075f79 100644 --- a/apps/mobile/README.md +++ b/apps/mobile/README.md @@ -1,4 +1,4 @@ -# OpenFuse mobile +# MyMuse mobile A shared React Native workspace for iOS, Android, and the web preview. The client uses native primitives and the CopilotKit headless hooks; the web preview renders those same screens through React Native Web. @@ -6,7 +6,7 @@ A shared React Native workspace for iOS, Android, and the web preview. The clien [Recording setup](../../docs/DEMO.md) -Meet OpenFuse's capybara in two different journeys: Hacker News and CopilotKit on iPhone; reading a school-trip email and researching aquarium exhibits on desktop. Results appear inline in chat, with **Take control** opening the same browser session. Send and Stop share the input pill's primary control. +Meet MyMuse's capybara in two different journeys: Hacker News and CopilotKit on iPhone; reading a school-trip email and researching aquarium exhibits on desktop. Results appear inline in chat, with **Take control** opening the same browser session. Send and Stop share the input pill's primary control. ## Run @@ -34,10 +34,24 @@ pnpm --dir apps/mobile build:android The `build:ios` and `build:android` commands validate and export platform JavaScript/Hermes bundles. They do not create signed installable apps. `ios` and `android` run Expo’s native development-build workflows and need the platform toolchains. +## Installable builds + +`eas.json` defines the build profiles. Authenticate once, link the project, then build in the cloud: + +```sh +npx eas-cli login +npx eas-cli init +pnpm --dir apps/mobile dist:android # installable .apk (preview profile) +pnpm --dir apps/mobile dist:ios # installable iOS build (preview profile) +pnpm --dir apps/mobile dist:store # Play App Bundle and App Store IPA +``` + +Each build prints a download link. Building an APK locally (`expo prebuild` + `gradlew assembleRelease`) instead works too, but Gradle needs roughly 6 GB of free disk for the NDK and native compile caches. iOS builds need an Apple Developer account and a registered device; EAS asks for credentials on the first run. `EXPO_PUBLIC_API_URL` is baked in at build time, so add `"env": { "EXPO_PUBLIC_API_URL": "https://your-api.example.com" }` to the profile in `eas.json` for a build that talks to a deployed server instead of `localhost`. + ## Behavior - Chat, Activity, Ideas, Goals and Apps are the primary navigation. Tasks, timelines and notifications refresh from the durable server state. Apps contains Mail, Calendar, Browser, Files and Connections. -- Drafts are saved in OpenFuse and can be reopened from Mail. Mail attachments import into Files before reading. +- Drafts are saved in MyMuse and can be reopened from Mail. Mail attachments import into Files before reading. - Calendar edits preserve named time zones. Date entry rejects nonexistent times at daylight-saving transitions. - Sending mail and creating, changing, or deleting events require a stored proposal and an explicit review decision. Editing a proposal declines the previous version, then opens a new draft. - Chat restores/saves AG-UI conversation messages, renders frontend tool cards, and supports interruption, retry, and document references. diff --git a/apps/mobile/app.json b/apps/mobile/app.json index b7285ebfc..99bf22222 100644 --- a/apps/mobile/app.json +++ b/apps/mobile/app.json @@ -1,15 +1,15 @@ { "expo": { - "name": "OpenFuse", - "slug": "openfuse", - "scheme": "openfuse", + "name": "MyMuse", + "slug": "mymuse", + "scheme": "mymuse", "version": "0.1.0", "orientation": "default", "userInterfaceStyle": "light", "newArchEnabled": true, - "ios": { "supportsTablet": true, "bundleIdentifier": "app.openfuse.mobile" }, - "android": { "package": "app.openfuse.mobile" }, - "web": { "bundler": "metro", "name": "OpenFuse β€” a little room for everything" }, + "ios": { "supportsTablet": true, "bundleIdentifier": "app.mymuse.mobile" }, + "android": { "package": "app.mymuse.mobile" }, + "web": { "bundler": "metro", "name": "MyMuse β€” a little room for everything" }, "plugins": [ "expo-document-picker", "@config-plugins/react-native-blob-util", diff --git a/apps/mobile/assets/README.md b/apps/mobile/assets/README.md index efa7efe59..78d0bdbb6 100644 --- a/apps/mobile/assets/README.md +++ b/apps/mobile/assets/README.md @@ -1,5 +1,5 @@ -# OpenFuse capybara +# MyMuse capybara -`capybara.png` is original artwork generated for OpenFuse with the built-in image-generation tool on September 16, 2026. The transparent PNG is bundled locally and used by the shared `Mascot` component. Sky, sand and lilac backgrounds preserve the avatar color preference. The asset is included under this repository's MIT license. +`capybara.png` is original artwork generated for MyMuse with the built-in image-generation tool on September 16, 2026. The transparent PNG is bundled locally and used by the shared `Mascot` component. Sky, sand and lilac backgrounds preserve the avatar color preference. The asset is included under this repository's MIT license. Generation prompt: β€œAn original friendly capybara assistant mascot, with a broad boxy rounded snout, small round ears, tiny relaxed eyes, a squat body and short legs. Sitting in a gentle three-quarter view, with warm caramel and oat tan coloring, a calm expression, a soft clay/plush finish and restrained detail readable at 48–96 pixels. Entire character centered on a transparent background. One character, no clothing, props, text, logos or watermark.” diff --git a/apps/mobile/eas.json b/apps/mobile/eas.json new file mode 100644 index 000000000..fd6528f86 --- /dev/null +++ b/apps/mobile/eas.json @@ -0,0 +1,16 @@ +{ + "cli": { "version": ">= 16.0.0", "appVersionSource": "remote" }, + "build": { + "development": { "developmentClient": true, "distribution": "internal" }, + "preview": { + "distribution": "internal", + "android": { "buildType": "apk" }, + "ios": { "simulator": false } + }, + "production": { + "autoIncrement": true, + "android": { "buildType": "app-bundle" } + } + }, + "submit": { "production": {} } +} diff --git a/apps/mobile/package.json b/apps/mobile/package.json index a468dc645..be73fd3ca 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -1,5 +1,5 @@ { - "name": "@openfuse/mobile", + "name": "@mymuse/mobile", "version": "0.1.0", "private": true, "main": "index.js", @@ -9,6 +9,9 @@ "build:web": "expo export --platform web --output-dir dist/web", "build:ios": "expo export --platform ios --output-dir dist/ios", "build:android": "expo export --platform android --output-dir dist/android", + "dist:android": "eas build --platform android --profile preview", + "dist:ios": "eas build --platform ios --profile preview", + "dist:store": "eas build --platform all --profile production", "typecheck": "tsc --noEmit", "android": "expo run:android", "ios": "expo run:ios" @@ -42,6 +45,7 @@ "@config-plugins/react-native-pdf": "^12.0.0", "@types/markdown-it": "14.1.2", "@types/react": "~19.1.0", + "eas-cli": "^27.11.0", "typescript": "~5.9.2" } } diff --git a/apps/mobile/src/agent-ui.tsx b/apps/mobile/src/agent-ui.tsx index 4939c12c7..953608c02 100644 --- a/apps/mobile/src/agent-ui.tsx +++ b/apps/mobile/src/agent-ui.tsx @@ -934,7 +934,7 @@ export function DelegateSheet({ goalId, milestoneId }: { goalId?: string; milest return ( {milestoneId && ( @@ -1147,7 +1147,7 @@ function IdeaCard({ idea }: { idea: Idea }) { {editing && ( void }) { {sample ? "Changes to this built-in page stay in your workspace." - : "OpenFuse checks this public page on the server and saves meaningful changes in Notifications."} + : "MyMuse checks this public page on the server and saves meaningful changes in Notifications."}