Compare commits

..
2 Commits
Author SHA1 Message Date
Chad Curtis e87ee0d18a project creation fix 2025-09-22 06:14:55 +00:00
Chad Curtis 72adaa4c18 opfs support init 2025-09-22 05:43:53 +00:00
668 changed files with 22859 additions and 94801 deletions

No files matched your search

-121
View File
@@ -1,121 +0,0 @@
---
name: plausible-analytics
description: Add Plausible Analytics tracking to the application, configured through AppConfig and environment variables.
---
# Plausible Analytics
Add privacy-friendly analytics with [Plausible](https://plausible.io/) using the `@plausible-analytics/tracker` npm package. Configuration lives in `AppConfig` so it can be set via `VITE_` environment variables.
## 1. Install the package
```bash
npm install @plausible-analytics/tracker
```
## 2. Add fields to `AppConfig`
In `src/contexts/AppContext.ts`, add two fields to the `AppConfig` interface:
```typescript
export interface AppConfig {
// ...existing fields...
/** Plausible Analytics domain (empty string = disabled). */
plausibleDomain: string;
/** Plausible Analytics API endpoint (empty string = use default). */
plausibleEndpoint: string;
}
```
## 3. Update the Zod schema in `AppProvider.tsx`
Add the new fields to the `AppConfigSchema`:
```typescript
const AppConfigSchema = z.object({
// ...existing fields...
plausibleDomain: z.string(),
plausibleEndpoint: z.string(),
}) satisfies z.ZodType<AppConfig>;
```
## 4. Create `PlausibleProvider`
Create `src/components/PlausibleProvider.tsx`:
```tsx
import { ReactNode, useEffect, useRef } from 'react';
import { useAppContext } from '@/hooks/useAppContext';
interface PlausibleProviderProps {
children: ReactNode;
}
/**
* Reactively initializes Plausible Analytics from AppConfig.
* Plausible's `init()` can only be called once, so we guard with a ref.
*/
export function PlausibleProvider({ children }: PlausibleProviderProps) {
const { config } = useAppContext();
const initializedRef = useRef(false);
useEffect(() => {
if (initializedRef.current || !config.plausibleDomain) return;
initializedRef.current = true;
import('@plausible-analytics/tracker').then(({ init }) => {
init({
domain: config.plausibleDomain,
...(config.plausibleEndpoint && { endpoint: config.plausibleEndpoint }),
});
}).catch(console.error);
}, [config.plausibleDomain, config.plausibleEndpoint]);
return <>{children}</>;
}
```
## 5. Wire into `App.tsx`
Import `PlausibleProvider` and add it inside `AppProvider` (it needs access to `useAppContext`):
```tsx
import { PlausibleProvider } from '@/components/PlausibleProvider';
// In the defaultConfig, add:
const defaultConfig: AppConfig = {
// ...existing fields...
plausibleDomain: import.meta.env.VITE_PLAUSIBLE_DOMAIN || '',
plausibleEndpoint: import.meta.env.VITE_PLAUSIBLE_ENDPOINT || '',
};
// In the JSX, wrap children of AppProvider:
<AppProvider storageKey="nostr:app-config" defaultConfig={defaultConfig}>
<PlausibleProvider>
{/* ...rest of providers... */}
</PlausibleProvider>
</AppProvider>
```
## 6. Update `TestApp.tsx`
Add the new fields to the test default config with empty strings (disabled):
```typescript
const defaultConfig: AppConfig = {
// ...existing fields...
plausibleDomain: '',
plausibleEndpoint: '',
};
```
## 7. Configure via environment variables
Create or update `.env`:
```
VITE_PLAUSIBLE_DOMAIN="example.com"
VITE_PLAUSIBLE_ENDPOINT="https://plausible.example.com/api/event"
```
`VITE_PLAUSIBLE_ENDPOINT` is optional -- it defaults to Plausible Cloud's endpoint if omitted. Set it when using a self-hosted Plausible instance.
-198
View File
@@ -1,198 +0,0 @@
---
name: release
description: Publish a new app release with versioning, changelog, and git tagging. Triggered by "publish a new release" or similar requests.
---
# Release Skill
This skill guides you through publishing a new release of the app. It handles version bumping, changelog generation, and git tagging/pushing.
## Overview
- **Version format**: Marketing version (X.Y.Z), starting from 9.9.1. **This is NOT semver.** Version numbers are chosen based on how the release looks to end users, not based on API compatibility or breaking changes. Think of it like an app store version -- the number reflects the perceived significance of the update to a regular user.
- **Version source of truth**: `package.json` `version` field
- **Changelog**: `CHANGELOG.md` in repo root, using [Keep a Changelog](https://keepachangelog.com/) format
- **Version bumping**:
- **Patch (Z)**: Most releases. Bug fixes, tweaks, internal improvements, anything a user wouldn't specifically notice or seek out.
- **Minor (Y)**: Releases with headline features -- things worth announcing. A user should be able to look at the minor bump and think "oh, something new happened."
- **Major (X)**: Only when the user explicitly requests it (milestones, rebrands, major redesigns)
- **CI trigger**: Pushing a version tag (`v9.9.0`) triggers the CI pipeline to build and create a GitLab release
## Release Procedure
Follow these steps in order. Do NOT skip any step.
### Step 1: Required Reading
Before writing any release notes, you MUST read these pages to understand the product context, voice, and values:
1. **https://soapbox.pub/** -- Soapbox company overview and product suite
2. **https://soapbox.pub/shakespeare/** -- Shakespeare product page
These pages define what Shakespeare is, how it's positioned, and the tone of voice to use. Changelog entries should reflect this identity: creative, empowering, user-focused, emphasizing building and self-expression. Avoid dry technical jargon -- write for people who use the app, not developers.
### Step 2: Pre-flight Checks
```bash
# Ensure working directory is clean
git status
# Ensure we're on main branch
git branch --show-current
# Run the full test suite
npm run test
```
- If the working directory has uncommitted changes, ask the user whether to commit them first or abort.
- If not on `main`, warn the user and ask whether to proceed.
- If tests fail, stop and fix the issues before continuing.
### Step 3: Determine What Changed
```bash
# Get the current version from package.json
node -p "require('./package.json').version"
# Get commits since the last version tag
git log v$(node -p "require('./package.json').version")..HEAD --oneline
```
- If there are no commits since the last tag, inform the user there is nothing to release and stop.
- Review the commit list to understand the scope of changes.
### Step 4: Decide the Version Bump
Analyze the commits from Step 3 and determine the appropriate bump level:
| Bump | When to use | Example |
|------|-------------|---------|
| **Patch** | Bug fixes, minor tweaks, dependency updates, small UI polish, internal tooling, developer-facing pages, CI/build changes, settings/admin screens | 9.9.0 -> 9.9.1 |
| **Minor** | Significant new product features that change how users interact with the app -- the kind of thing you'd highlight in an app store update or announce on social media (e.g., new template support, new AI features, new deployment options, major UI overhaul) | 9.9.1 -> 9.10.0 |
| **Major** | ONLY when the user explicitly instructs a major bump | 9.10.0 -> 10.0.0 |
**Default to patch** when in doubt. The bar for a minor bump is high -- ask yourself: "Would a regular user notice and care about this change?" If the answer is no, it's a patch. Internal pages (changelog, settings, about screens), infrastructure improvements, CI fixes, and developer tooling are always patch-level regardless of whether they technically add a new page or screen.
When bumping minor, reset patch to 0 (e.g., 9.9.3 -> 9.10.0).
When bumping major, reset minor and patch to 0 (e.g., 9.3.1 -> 10.0.0).
### Step 5: Write the Changelog Entry
Prepend a new section to `CHANGELOG.md` directly below the `# Changelog` heading.
**Format:**
```markdown
## [X.Y.Z] - YYYY-MM-DD
### Added
- Description of new features
### Changed
- Description of changes to existing features
### Fixed
- Description of bug fixes
### Removed
- Description of removed features
```
**Rules:**
- Only include categories that have entries (omit empty categories)
- Write **user-facing descriptions**, not raw commit messages
- Keep descriptions concise -- one line per change
- Group related commits into single entries where appropriate
- Use present tense ("Add dark mode toggle", not "Added dark mode toggle")
- Focus on what the user sees/experiences, not internal implementation details
- Use the current date in YYYY-MM-DD format
- **Collapse related work into one entry.** If a feature was added and then fixed/tweaked across multiple commits in the same release, present the finished result as a single "Added" entry. Never list something as "Added" and then also list fixes for that same thing -- the user sees the end product, not the development history.
- **Omit purely internal changes.** CI fixes, build pipeline tweaks, developer tooling, and infrastructure changes should be omitted from the changelog entirely unless they have a direct, visible impact on the user experience. The changelog is for users, not developers.
- **Compare the actual code between versions** to understand what really changed, rather than just reading commit messages. Commit messages may over- or under-represent the significance of changes.
### Step 6: Update Version in All Files
#### 6a. `package.json`
Update the `version` field:
```json
"version": "X.Y.Z"
```
### Step 7: Copy Changelog to Public Directory
The changelog is served at runtime by the app from the `public/` directory. After updating `CHANGELOG.md`, copy it:
```bash
cp CHANGELOG.md public/CHANGELOG.md
```
### Step 8: Pull Latest Changes
Before committing the release, pull the latest changes from the remote to ensure the release commit sits on top of the latest code. This **must** happen before committing and tagging.
```bash
git pull origin main
```
**CRITICAL**: Always use `git pull` (merge), NEVER `git pull --rebase`. Rebasing rewrites commit hashes, which would orphan any tag pointing to the original commit. Since version tags are often protected on the remote and cannot be deleted or updated, a broken tag cannot be easily fixed.
If there are merge conflicts with the pulled changes, resolve them before proceeding.
### Step 9: Commit the Release
```bash
git add package.json CHANGELOG.md public/CHANGELOG.md
git commit -m "release: vX.Y.Z"
```
### Step 10: Tag the Release
```bash
git tag vX.Y.Z
```
The tag format is `v` followed by the version with no suffix. Examples: `v9.9.0`, `v9.10.0`, `v10.0.0`.
### Step 11: Push
```bash
git push origin main vX.Y.Z
```
**CRITICAL**: Push only the specific tag being released. NEVER use `--tags` -- that pushes ALL local tags, including stale or deleted ones.
### Step 12: Confirm
After pushing, inform the user:
- The new version number
- A brief summary of what was released
- That CI will handle building and publishing the artifacts
## File Reference
| File | What to update | Notes |
|------|---------------|-------|
| `package.json` | `version` field | Source of truth for the version |
| `CHANGELOG.md` | Prepend new section | User-facing changelog |
| `public/CHANGELOG.md` | Copy from `CHANGELOG.md` | Served at runtime by the app |
## Troubleshooting
### "Nothing to release"
If `git log` shows no commits since the last tag, there genuinely is nothing to release.
### Tests fail
Fix the failing tests before proceeding. The release must not contain broken code.
### Wrong version bumped
If you tagged the wrong version and haven't pushed yet:
```bash
git tag -d vX.Y.Z # delete the local tag
git reset --soft HEAD~1 # undo the commit but keep changes staged
```
Then redo steps 4-10 with the correct version.
### Already pushed a bad release
This requires manual intervention. Inform the user and suggest they delete the tag and release from GitLab manually, then re-run the release process.
+1 -17
View File
@@ -1,18 +1,2 @@
# Sentry
VITE_SENTRY_DSN="https://********************************@*****************.example.com/****************"
# Plausible Analytics
VITE_PLAUSIBLE_DOMAIN="example.com"
VITE_PLAUSIBLE_ENDPOINT="https://plausible.example.com/api/event"
# GitHub OAuth Configuration
VITE_GITHUB_OAUTH_CLIENT_ID="********************"
VITE_GITHUB_OAUTH_CLIENT_SECRET="****************************************"
# Netlify OAuth Configuration
VITE_NETLIFY_OAUTH_CLIENT_ID="********************"
VITE_NETLIFY_OAUTH_CLIENT_SECRET="****************************************"
# Vercel OAuth Configuration
VITE_VERCEL_OAUTH_CLIENT_ID="********************"
VITE_VERCEL_OAUTH_CLIENT_SECRET="****************************************"
VITE_GITHUB_OAUTH_CLIENT_SECRET="****************************************"
-7
View File
@@ -7,17 +7,11 @@ yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
deploy.sh
node_modules
dist
dist-ssr
*.local
.ai-history/
*.apk
*.aab
# Electron build output
electron-dist
# Editor directories and files
.idea
@@ -36,4 +30,3 @@ electron-dist
.env.*
!.env.example
.ai/
*.keystore
+8 -206
View File
@@ -1,225 +1,27 @@
image: node:25
image: node:22
default:
interruptible: true
timeout: 1 minute
cache:
key:
files:
- package-lock.json
paths:
- node_modules/
stages:
- test
- deploy
- build
- release
- publish
test:
stage: test
rules:
- if: $CI_COMMIT_TAG
when: never
- when: always
script:
- npm run typecheck
- npm run build
- npm run test
deploy-nsite:
pages:
stage: deploy
timeout: 10 minutes
rules:
- if: $CI_COMMIT_TAG
when: never
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
variables:
NSYTE_VERSION: "v0.24.1"
script:
# Build the web app
- npm ci
- npm run build
- cp dist/index.html dist/404.html
# Remove sourcemaps to stay under nsite's 65KB manifest limit
- find dist -name '*.map' -delete
# Download nsyte binary
- curl -fsSL "https://github.com/sandwichfarm/nsyte/releases/download/${NSYTE_VERSION}/nsyte-linux" -o /usr/local/bin/nsyte
- chmod +x /usr/local/bin/nsyte
# Deploy to nsite via nsyte using the nbunksec credential
- >-
nsyte deploy ./dist
-i
--sec "$NSITE_NBUNKSEC"
--name shakespeare
--relays "wss://relay.ditto.pub,wss://relay.nsite.lol,wss://relay.dreamith.to,wss://relay.primal.net"
--servers "https://blossom.primal.net,https://blossom.ditto.pub,https://blossom.dreamith.to"
--fallback "/index.html"
--use-fallback-relays
--use-fallback-servers
build-apk:
stage: build
image: eclipse-temurin:21-jdk
timeout: 15 minutes
needs: []
rules:
- if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/
variables:
ANDROID_SDK_ROOT: /opt/android-sdk
ANDROID_HOME: /opt/android-sdk
before_script:
# Install system dependencies
- apt-get update -qq
- apt-get install -y -qq curl unzip > /dev/null
# Install Node.js 22
- curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
- apt-get install -y -qq nodejs > /dev/null
- node --version
- npm --version
# Install Android SDK command-line tools
- mkdir -p $ANDROID_SDK_ROOT/cmdline-tools
- curl -fsSL https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -o cmdline-tools.zip
- unzip -q cmdline-tools.zip -d $ANDROID_SDK_ROOT/cmdline-tools
- mv $ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools $ANDROID_SDK_ROOT/cmdline-tools/latest
- export PATH="$ANDROID_SDK_ROOT/cmdline-tools/latest/bin:$ANDROID_SDK_ROOT/platform-tools:$PATH"
# Accept licenses and install SDK components
- printf 'y\ny\ny\ny\ny\ny\ny\n' | sdkmanager --licenses > /dev/null 2>&1 || true
- sdkmanager --install "platforms;android-36" "build-tools;36.0.0" "platform-tools" > /dev/null
# Write local.properties for Gradle
- echo "sdk.dir=$ANDROID_SDK_ROOT" > android/local.properties
# Decode signing keystore and migrate JKS -> PKCS12 for Gradle compatibility
- echo "$ANDROID_KEYSTORE_BASE64" | base64 -d > android/app/my-upload-key.jks
- keytool -importkeystore
-srckeystore android/app/my-upload-key.jks
-destkeystore android/app/my-upload-key.keystore
-deststoretype pkcs12
-srcstorepass "$KEYSTORE_PASSWORD"
-deststorepass "$KEYSTORE_PASSWORD"
-srcalias upload
-destalias upload
-noprompt
- rm android/app/my-upload-key.jks
# Write key.properties from CI/CD variables
- |
cat > android/key.properties << EOF
storePassword=$KEYSTORE_PASSWORD
keyPassword=$KEY_PASSWORD
keyAlias=upload
storeFile=my-upload-key.keystore
EOF
script:
# Extract semver version from git tag (e.g., v9.9.2 -> 9.9.2)
- TAG="${CI_COMMIT_TAG#v}"
- VERSION_NAME="${TAG}"
- VERSION_CODE="${CI_PIPELINE_IID}"
- echo "Building version $VERSION_NAME (code $VERSION_CODE) from tag $CI_COMMIT_TAG"
# Stamp version into build.gradle
- sed -i "s/versionCode [0-9]*/versionCode ${VERSION_CODE}/" android/app/build.gradle
- sed -i "s/versionName \"[^\"]*\"/versionName \"${VERSION_NAME}\"/" android/app/build.gradle
# Build web assets
- npm ci
- npx vite build -l error
- cp dist/index.html dist/404.html
# Sync web assets to Capacitor Android project
- npx cap sync android
# Build signed release APK
- cd android && chmod +x gradlew && ./gradlew assembleRelease bundleRelease && cd ..
# Copy APK to a predictable artifact path
- mkdir -p artifacts
- cp android/app/build/outputs/apk/release/app-release.apk "artifacts/Shakespeare.apk"
- cp android/app/build/outputs/bundle/release/app-release.aab "artifacts/Shakespeare.aab"
- ls -lh artifacts/
# Upload to Generic Packages registry for a stable public download URL
- |
curl --fail --header "JOB-TOKEN: ${CI_JOB_TOKEN}" \
--upload-file "artifacts/Shakespeare.apk" \
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/shakespeare/${CI_COMMIT_TAG}/Shakespeare-${CI_COMMIT_TAG}.apk"
- |
curl --fail --header "JOB-TOKEN: ${CI_JOB_TOKEN}" \
--upload-file "artifacts/Shakespeare.aab" \
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/shakespeare/${CI_COMMIT_TAG}/Shakespeare-${CI_COMMIT_TAG}.aab"
- rm -rf public
- mv dist public
artifacts:
paths:
- artifacts/Shakespeare.apk
- artifacts/Shakespeare.aab
expire_in: 90 days
cache:
key: android-gradle
paths:
- android/.gradle/
- .gradle/
release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- build-apk
rules:
- if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/
script:
- echo "Creating release for $CI_COMMIT_TAG"
# Extract the latest changelog section for the release description.
# Reads from "## [version]" to the next "## [" or end of file.
- |
VERSION="${CI_COMMIT_TAG#v}"
RELEASE_NOTES=$(awk "/^## \\[${VERSION}\\]/{found=1; next} /^## \\[/{if(found) exit} found{print}" CHANGELOG.md)
if [ -z "$RELEASE_NOTES" ]; then
RELEASE_NOTES="Shakespeare ${CI_COMMIT_TAG}"
fi
- echo "$RELEASE_NOTES" > release-notes.md
release:
tag_name: $CI_COMMIT_TAG
name: $CI_COMMIT_TAG
description: './release-notes.md'
assets:
links:
- name: Shakespeare-${CI_COMMIT_TAG}.apk
url: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/shakespeare/${CI_COMMIT_TAG}/Shakespeare-${CI_COMMIT_TAG}.apk
link_type: package
- name: Shakespeare-${CI_COMMIT_TAG}.aab
url: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/shakespeare/${CI_COMMIT_TAG}/Shakespeare-${CI_COMMIT_TAG}.aab
link_type: package
publish-zapstore:
stage: publish
image: golang:1.24
needs:
- build-apk
rules:
- if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/
variables:
SIGN_WITH: $ZAPSTORE_BUNKER_URL
RELAY_URLS: "wss://relay.zapstore.dev,wss://relay.ditto.pub"
BLOSSOM_URL: "https://blossom.ditto.pub"
script:
- go install github.com/zapstore/zsp@latest
# Restore the persistent NIP-46 client key so the bunker recognizes us across CI runs.
# zsp stores client keys at ~/.config/zsp/bunker-keys/<bunker-pubkey>.key
- BUNKER_PUBKEY=$(echo "$ZAPSTORE_BUNKER_URL" | sed 's|bunker://||;s|?.*||')
- mkdir -p ~/.config/zsp/bunker-keys
- echo "$ZAPSTORE_CLIENT_KEY" > ~/.config/zsp/bunker-keys/${BUNKER_PUBKEY}.key
- APK_PATH="artifacts/Shakespeare.apk"
- VERSION="${CI_COMMIT_TAG#v}"
- sed -i "2i release_source:\ ./${APK_PATH}" zapstore.yaml
- sed -i "2i version:\ ${VERSION}" zapstore.yaml
- zsp publish --quiet --skip-preview zapstore.yaml
- public
only:
variables:
- $CI_DEFAULT_BRANCH == $CI_COMMIT_REF_NAME
-137
View File
@@ -1,137 +0,0 @@
name: Deploy nsite
# Builds dist/ and publishes it as the named nsite "shakespeare" (NIP-5A kind
# 35128) described by .nsite/config.json: the files become Blossom blobs, the
# manifest mapping path -> sha256 goes to relays, and npanel on venus serves
# shakespeare.diy from it. Runs on pushes to the default branch, alongside
# Test.
#
# Replaces the GitLab `deploy-nsite` job, which published the same site under a
# PERSONAL npub with nsyte 0.24.1. The signing pubkey IS the site address, so
# this one lives in the Team Soapbox namespace instead.
#
# Secrets are provisioned by the ngit-ci operator as
# NGIT_CI_SECRET_<ALIAS>__<NAME> (note the double underscore) and injected ONLY
# on maintainer-authored triggers, which a push to a watched repo always is.
# This job needs one:
# NSYTE_BUNKER nbunksec1... -- a pre-established NIP-46 session, the form
# nsyte documents for CI.
# An empty NSYTE_BUNKER fails the job rather than skipping quietly: this is the
# only workflow that publishes the client anywhere, so a skipped run would
# leave the nsite silently pinned to an older build.
#
# NOTE: *.shakespeare.diy is NOT served from here. The wildcard keeps its own
# Caddy vhost and /var/www tree on venus, because the nsite catch-all issues
# certificates on demand over HTTP-01 and cannot get a wildcard.
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
# Ahead of the build, so a config nsyte will not accept costs seconds
# rather than failing at the end of a green-looking run.
- name: Install nsyte and validate the config
env:
NSYTE_BUNKER: ${{ secrets.NSYTE_BUNKER }}
run: |
set -eu
: "${NSYTE_BUNKER:?NSYTE_BUNKER is not set; ask the ngit-ci operator to provision it for this repo alias.}"
# Pin the binary as a FLOOR, not an exact version. An unversioned
# install has been observed pulling 0.10.1, which emits legacy
# kind-34128 events that every current gateway ignores while still
# reporting a successful deploy. 0.28.0 is the floor because it is the
# first release whose nostr-tools will encrypt a NIP-44 payload larger
# than 64 KiB; under it, signing a large site manifest through the
# bunker fails outright.
#
# nsyte is baked into the coordinator's CI image alongside zsp
# (armada's .ngit/ci-image/Dockerfile). Comparing its VERSION rather
# than just `command -v` is deliberate: a stale baked binary silently
# outranked this pin, which is how deploys kept running 0.27.2 long
# after the pin moved. Accepting anything NEWER than the floor lets
# the image move ahead of these files without sending every job back
# to the download.
#
# That download is the fallback for a coordinator whose image lacks
# nsyte, and is exactly what kept failing here: the ~129 MB release
# asset broke mid-transfer with "SSL_read: decryption failed or bad
# record mac", identically on every attempt within a run, taking
# deploy-nsite down across every repo. Hence the loop, HTTP/1.1, and
# running the binary before trusting it.
NSYTE_MIN_VERSION=0.28.0
# nsyte colours its version output with ANSI escapes even when piped.
baked="$(NO_COLOR=1 nsyte --version 2>/dev/null \
| sed 's/\x1b\[[0-9;]*m//g' | awk 'NR == 1 { print $2 }')"
oldest="$(printf '%s\n%s\n' "$NSYTE_MIN_VERSION" "$baked" | sort -V | head -1)"
if [ -n "$baked" ] && [ "$oldest" = "$NSYTE_MIN_VERSION" ]; then
echo "using the nsyte baked into the runner image ($baked)"
else
test -z "$baked" || echo "baked nsyte $baked is below $NSYTE_MIN_VERSION; downloading"
NSYTE_URL="https://github.com/sandwichfarm/nsyte/releases/download/v${NSYTE_MIN_VERSION}/nsyte-linux-${NSYTE_MIN_VERSION}"
ok=""
for attempt in 1 2 3 4 5; do
if curl -fsSL --http1.1 --retry 2 --retry-delay 5 --retry-all-errors \
--connect-timeout 20 --max-time 900 -o /usr/local/bin/nsyte "$NSYTE_URL" \
&& chmod +x /usr/local/bin/nsyte \
&& nsyte --version >/dev/null; then
ok=yes
break
fi
echo "nsyte download attempt $attempt failed; retrying in 10s"
sleep 10
done
test -n "$ok" || { echo "could not download a working nsyte after 5 attempts"; exit 1; }
fi
nsyte --version
nsyte validate
- run: npm ci
# Builds dist/ and copies index.html -> 404.html, the path NIP-5A host
# servers fall back to.
- run: npm run build
# Sourcemaps are ~290 files and 30 MB of blobs nobody fetches, and they
# near-double the manifest. The GitLab job dropped them too.
- run: find dist -name '*.map' -delete
- name: Publish to Blossom + relays
env:
NSYTE_BUNKER: ${{ secrets.NSYTE_BUNKER }}
run: |
set -eu
# Relays, servers and the site id all come from .nsite/config.json,
# so they are versioned with the client rather than split across this
# file. The secrets scan is skipped because it prompts on false
# positives in our own bundle (pubkeys, bunker:// parsing code), and
# a prompt is unanswerable here -- with -i it defaults to N and
# aborts.
set +e
nsyte deploy dist \
--sec "$NSYTE_BUNKER" \
--concurrency 2 \
--non-interactive \
--skip-secrets-scan 2>&1 | tee /tmp/nsyte-deploy.log
status="${PIPESTATUS[0]}"
set -e
# A deploy that changes no file exits NON-ZERO with "No new files to
# upload". That is success: the manifest already on the relays
# describes exactly this build.
if [ "$status" -ne 0 ] && ! grep -q "No new files to upload" /tmp/nsyte-deploy.log; then
exit "$status"
fi
-31
View File
@@ -1,31 +0,0 @@
name: Test
# Typecheck / lint / unit tests / production build for the Shakespeare client.
# ngit-ci watches .ngit/act/workflows/ and runs each job with `act` (GitHub
# Actions-compatible syntax) in a Linux container. Runs on every push and on
# every Nostr PR.
on:
push:
branches: ["**"]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
# package.json splits these: "typecheck" is tsc --noEmit and "test" is
# eslint + vitest. The GitLab job ran typecheck, build and test; keep all
# three so a type error still fails CI.
- run: npm run typecheck
- run: npm run build
- run: npm run test
-20
View File
@@ -1,20 +0,0 @@
{
"$schema": "https://nsyte.run/schemas/config.schema.json",
"relays": [
"wss://relay.ditto.pub",
"wss://relay.dreamith.to",
"wss://relay.primal.net"
],
"id": "shakespeare",
"servers": [
"https://blossom.ditto.pub",
"https://blossom.dreamith.to",
"https://blossom.primal.net"
],
"fallback": "/index.html",
"publishRelayList": false,
"publishServerList": false,
"title": "Shakespeare",
"description": "Build custom apps with AI assistance using Shakespeare, an open-source development environment.",
"source": "https://gitworkshop.dev/soapbox.pub/relay.ngit.dev/shakespeare"
}
+2 -3
View File
@@ -1,4 +1,3 @@
{
"editor.tabSize": 2,
"editor.insertSpaces": true
}
"editor.tabSize": 2
}
+24 -143
View File
@@ -1,10 +1,6 @@
# Agent Rules
# Shakespeare - AI-Powered Nostr Website Builder
- ALWAYS commit after you finish your turn. No exceptions. Don't ask for permission, just do it.
# Shakespeare - AI-Powered App Builder
Shakespeare is a browser-based AI chat application that allows users to build custom web applications through natural language conversation. All operations including AI chat and Git operations are executed in client-side JavaScript, with API keys stored in browser storage. Simply describe what you want to build, and AI will help you create it.
Shakespeare is a browser-based AI chat application that allows users to build custom Nostr websites through natural language conversation. All operations including AI chat and Git operations are executed in client-side JavaScript, with API keys stored in browser storage. Simply describe what you want to build, and AI will help you create it.
### Virtual Filesystem Layout
@@ -37,16 +33,17 @@ This architecture allows Shakespeare to provide a full development environment e
Shakespeare provides AI agents with specialized tools for project development (note: these are different from the tools available during Shakespeare's own development). These tools are defined in `src/lib/tools/`:
- **ShellTool**: Execute shell commands in the virtual browser environment
- **ShellTool**: Execute shell commands in the virtual filesystem environment
- **TextEditorViewTool**: Read file contents and view directory structures
- **TextEditorWriteTool**: Create or overwrite files with new content
- **TextEditorStrReplaceTool**: Replace strings in files
- **BuildProjectTool**: Build and compile projects
- **TypecheckTool**: Run TypeScript type checking
- **NpmAddPackageTool**: Add npm packages to projects
- **NpmRemovePackageTool**: Remove npm packages from projects
- **GitCommitTool**: Commit changes to Git repositories
- **WebFetchTool**: Fetch and read web pages with support for markdown, text, and HTML formats
- **WebSearchTool**: Search the web using Exa AI for real-time web searches
- **DeployProjectTool**: Deploy projects to hosting platforms
- **ReadWebpageTool**: Fetch and read web pages
- **NostrReadNipTool**: Read Nostr protocol NIP documents
- **NostrReadKindTool**: Read Nostr event kind documentation
- **NostrReadTagTool**: Read Nostr tag documentation
@@ -54,10 +51,6 @@ Shakespeare provides AI agents with specialized tools for project development (n
- **NostrReadNipsIndexTool**: Read the full list of NIPs, kinds, and tags
- **NostrFetchEventTool**: Fetch Nostr events using NIP-19 identifiers
- **NostrGenerateKindTool**: Generate unused Nostr event kind numbers
- **NostrEncodeTool**: Encode hex values into NIP-19 bech32 entities (npub, note, nprofile, nevent, naddr)
- **NostrDecodeTool**: Decode NIP-19 bech32 entities into hex and structured data
- **BlossomUploadTool**: Upload files from the project to Blossom media hosting, returns a public URL
- **ReadConsoleMessagesTool**: Read console messages from project preview with filtering capabilities
#### Shell Commands
@@ -67,7 +60,7 @@ Shakespeare provides a comprehensive set of shell commands that are JavaScript r
- **File Operations**: `cat`, `cp`, `mv`, `rm`, `touch`, `find`, `grep`
- **Directory Operations**: `cd`, `ls`, `mkdir`, `pwd`, `tree`
- **System Commands**: `echo`, `which`, `wc`, `head`, `tail`
- **Git Commands**: `git add`, `git commit`, `git push`, `git pull`, `git status`, `git log`, `git diff`, `git branch`, `git checkout`, `git switch`, `git merge`, `git revert`, `git rm`, `git mv`, `git restore`, `git rev-parse`, `git ls-files`, `git tag`, `git stash`, `git fetch`, `git clone`, `git init`, `git reset`, `git show`, `git remote`, `git config`
- **Git Commands**: `git add`, `git commit`, `git push`, `git pull`, `git status`, `git log`, etc.
#### Security
@@ -77,41 +70,6 @@ AI filesystem access through tools (including shell commands via ShellTool) has
- **Write operations**: Restricted to current project directory and `/tmp/` directory (including subdirectories)
- **Copy operations**: Can copy from any absolute path to relative paths or `/tmp/`, but cannot copy from relative to absolute paths outside allowed areas
#### Web Workers and Asset URLs
Shakespeare's esbuild-wasm build pipeline supports the Vite/webpack-compatible patterns for loading Web Workers and static assets:
```ts
// Module Worker (required: { type: 'module' })
const worker = new Worker(
new URL('./worker.ts', import.meta.url),
{ type: 'module' },
);
// SharedWorker, same pattern
const shared = new SharedWorker(
new URL('./shared.ts', import.meta.url),
{ type: 'module' },
);
// Static asset URL (images, wasm, fonts, audio, etc.)
const logoUrl = new URL('./logo.svg', import.meta.url);
```
**Supported:**
- `new Worker(new URL('<spec>', import.meta.url), { type: 'module' })`
- `new SharedWorker(new URL('<spec>', import.meta.url), { type: 'module' })`
- `new URL('<spec>', import.meta.url)` where `<spec>` resolves to a non-source file (images, wasm, audio, fonts, etc.)
- Relative (`./`, `../`), absolute (`/`), and alias (`@/`) specifiers
- String literals with any quote style, including backticks without interpolation
**Not supported (will emit a build error):**
- Classic (non-module) workers — `{ type: 'module' }` is required
- Dynamic specifiers — the first argument to `new URL()` must be a string literal
- `new URL(..., import.meta.url)` pointing at source files (`.ts/.tsx/.js/.jsx/.mjs/.cjs/.css`); use a regular import or the Worker pattern instead (emits a console warning, then leaves the expression untouched)
Workers are bundled as separate ESM chunks and can import from npm packages normally — the same ESM-CDN rewrites applied to the main bundle apply to workers. When any workers are emitted, the build also extends the output CSP's `worker-src` and `child-src` directives to permit loading the ESM CDN from within workers.
### Git Integration with isomorphic-git
Shakespeare provides full Git functionality in the browser using `isomorphic-git` and `@isomorphic-git/lightning-fs`, with all data persisted in IndexedDB.
@@ -121,7 +79,6 @@ Shakespeare provides full Git functionality in the browser using `isomorphic-git
- **LightningFSAdapter**: Adapts LightningFS to the unified JSRuntimeFS interface
- **GitCommitTool**: AI tool for automated commits with staging and validation
- **useGitStatus Hook**: Real-time Git status monitoring (updates every 5 seconds)
- **useGitFetch Hook**: Automatic remote fetch
- **ProjectsManager**: Handles project creation, Git initialization, and template cloning
#### Core Features
@@ -150,30 +107,6 @@ Shakespeare provides full Git functionality in the browser using `isomorphic-git
Git operations happen transparently in the background, providing professional version control without requiring Git knowledge from users.
### Gift Card Redemption
Shakespeare supports automatic gift card redemption via URL parameters. Users can click shareable gift card links to instantly redeem AI credits.
**URL Format:**
```
/giftcard#baseURL=<providerBaseURL>&code=<giftcardCode>
```
**Flow:**
1. User clicks gift card link (e.g., from email or social media)
2. Shakespeare displays a dialog showing the credit amount
3. URL is rewritten to `/` for privacy (removes gift card code from history)
4. If user is not logged in or provider is not configured, a multi-step wizard guides them through setup
5. User can switch between Nostr accounts before redeeming
6. Credits are added to the user's account via NIP-98 authenticated API call
**Components:**
- `GiftCardRedeemDialog`: Main dialog handling the entire redemption flow
- Integrates with existing login/signup dialogs and provider configuration
- Automatically matches provider baseURL against configured providers and presets
See `GIFTCARD_REDEMPTION.md` for detailed documentation.
## AI Message Format
Shakespeare uses OpenAI-compatible messages for communication between users and AI assistants. The message format follows these conventions:
@@ -235,8 +168,6 @@ This project is a Nostr client application built with React 18.x, TailwindCSS 3.
- `/src/components/ai/`: AI-related components (GitCommit, GitHistoryDialog)
- `/src/components/comments/`: Comment system components (Comment, CommentForm, CommentsSection)
- `/src/components/Shakespeare/`: Core Shakespeare editor components (ChatPane, FileEditor, FileTree, PreviewPane)
- `/src/components/ProjectSidebar.tsx`: Sidebar component containing project list and import options
- `/src/components/ZipImportDialog.tsx`: Dialog component for importing projects from ZIP files
- Zap components: `ZapButton`, `ZapDialog`, `WalletModal` for Lightning payments
- `/src/hooks/`: Custom hooks including:
- `useNostr`: Core Nostr protocol integration
@@ -250,9 +181,8 @@ This project is a Nostr client application built with React 18.x, TailwindCSS 3.
- `useGitSettings`: Manage Git credentials and repository settings
- `useSessionManager`: Access session management for AI chat sessions
- `useGitStatus`: Real-time Git repository status monitoring
- `useGitFetch`: Automatic remote fetch
- `useProjects`: Project management and CRUD operations
- `useProjectsManager`: Advanced project operations (creation, cloning, building, ZIP import)
- `useProjectsManager`: Advanced project operations (creation, cloning, building)
- `useTheme`: Theme management
- `useToast`: Toast notifications
- `useLocalStorage`: Persistent local storage
@@ -271,11 +201,11 @@ This project is a Nostr client application built with React 18.x, TailwindCSS 3.
- Unix-style commands: `cat`, `cd`, `cp`, `find`, `grep`, `ls`, `mkdir`, `mv`, `rm`, etc.
- `/src/lib/tools/`: AI tool implementations for project development
- File operations: `TextEditorViewTool`, `TextEditorWriteTool`, `TextEditorStrReplaceTool`
- Project tools: `BuildProjectTool`
- Project tools: `BuildProjectTool`, `TypecheckTool`, `DeployProjectTool`
- Package management: `NpmAddPackageTool`, `NpmRemovePackageTool`
- Git integration: `GitCommitTool`
- Shell access: `ShellTool`
- Web access: `WebFetchTool`, `WebSearchTool`
- Web access: `ReadWebpageTool`
- Nostr tools: `NostrReadNipTool`, `NostrFetchEventTool`, `NostrGenerateKindTool`, etc.
- `/src/contexts/`: React context providers
- `AppContext`: Global app configuration and theme
@@ -1130,19 +1060,12 @@ The project includes an `AppProvider` that manages global application state incl
```typescript
const defaultConfig: AppConfig = {
theme: "system",
relayMetadata: {
relays: [
{ url: 'wss://relay.ditto.pub', read: true, write: true },
{ url: 'wss://relay.primal.net', read: true, write: true },
],
updatedAt: 0,
},
// ... other config options
theme: "light",
relayUrl: "wss://relay.nostr.band",
};
```
The app uses NIP-65 relay lists for managing multiple relays with read/write permissions. Configuration is persisted in local storage.
Preset relays are available including Ditto, Nostr.Band, Damus, and Primal. The app uses local storage to persist user preferences.
## Routing
@@ -1196,12 +1119,11 @@ The router includes automatic scroll-to-top functionality and a 404 NotFound pag
### Empty States and No Content Found
When no content is found (empty search results, no data available, etc.), display a minimalist empty state that guides users to take action or provides helpful context.
When no content is found (empty search results, no data available, etc.), display a minimalist empty state with the `RelaySelector` component. This allows users to easily switch relays to discover content from different sources.
```tsx
import { RelaySelector } from '@/components/RelaySelector';
import { Card, CardContent } from '@/components/ui/card';
import { Button } from '@/components/ui/button';
import { Link } from 'react-router-dom';
// Empty state example
<div className="col-span-full">
@@ -1209,64 +1131,24 @@ import { Link } from 'react-router-dom';
<CardContent className="py-12 px-8 text-center">
<div className="max-w-sm mx-auto space-y-6">
<p className="text-muted-foreground">
No results found. Configure your relays to discover more content.
No results found. Try another relay?
</p>
<Button asChild variant="outline">
<Link to="/settings/nostr">Manage Relays</Link>
</Button>
<RelaySelector className="w-full" />
</div>
</CardContent>
</Card>
</div>
```
## CRITICAL Design Standards
## Design Customization
- Create breathtaking, immersive designs that feel like bespoke masterpieces, rivaling the polish of Apple, Stripe, or luxury brands
- Designs must be production-ready, fully featured, with no placeholders unless explicitly requested, ensuring every element serves a functional and aesthetic purpose
- Avoid generic or templated aesthetics at all costs; every design must have a unique, brand-specific visual signature that feels custom-crafted
- Headers must be dynamic, immersive, and storytelling-driven, using layered visuals, motion, and symbolic elements to reflect the brand’s identity—never use simple “icon and text” combos
- Incorporate purposeful, lightweight animations for scroll reveals, micro-interactions (e.g., hover, click, transitions), and section transitions to create a sense of delight and fluidity
**Tailor the site's look and feel based on the user's specific request.** This includes:
### Design Principles
- Achieve Apple-level refinement with meticulous attention to detail, ensuring designs evoke strong emotions (e.g., wonder, inspiration, energy) through color, motion, and composition
- Deliver fully functional interactive components with intuitive feedback states, ensuring every element has a clear purpose and enhances user engagement
- Use custom illustrations, 3D elements, or symbolic visuals instead of generic stock imagery to create a unique brand narrative; stock imagery, when required, must be sourced exclusively from Pexels (NEVER Unsplash) and align with the design’s emotional tone
- Ensure designs feel alive and modern with dynamic elements like gradients, glows, or parallax effects, avoiding static or flat aesthetics
- Before finalizing, ask: "Would this design make Apple or Stripe designers pause and take notice?" If not, iterate until it does
### Avoid Generic Design
- No basic layouts (e.g., text-on-left, image-on-right) without significant custom polish, such as dynamic backgrounds, layered visuals, or interactive elements
- No simplistic headers; they must be immersive, animated, and reflective of the brand’s core identity and mission
- No designs that could be mistaken for free templates or overused patterns; every element must feel intentional and tailored
### Interaction Patterns
- Use progressive disclosure for complex forms or content to guide users intuitively and reduce cognitive load
- Incorporate contextual menus, smart tooltips, and visual cues to enhance navigation and usability
- Implement drag-and-drop, hover effects, and transitions with clear, dynamic visual feedback to elevate the user experience
- Support power users with keyboard shortcuts, ARIA labels, and focus states for accessibility and efficiency
- Add subtle parallax effects or scroll-triggered animations to create depth and engagement without overwhelming the user
### Technical Requirements
- Curated color FRpalette (3-5 evocative colors + neutrals) that aligns with the brand’s emotional tone and creates a memorable impact
- Ensure a minimum 4.5:1 contrast ratio for all text and interactive elements to meet accessibility standards
- Use expressive, readable fonts (18px+ for body text, 40px+ for headlines) with a clear hierarchy; pair a modern sans-serif (e.g., Inter) with an elegant serif (e.g., Playfair Display) for personality
- Design for full responsiveness, ensuring flawless performance and aesthetics across all screen sizes (mobile, tablet, desktop)
- Adhere to WCAG 2.1 AA guidelines, including keyboard navigation, screen reader support, and reduced motion options
- Follow an 8px grid system for consistent spacing, padding, and alignment to ensure visual harmony
- Add depth with subtle shadows, gradients, glows, and rounded corners (e.g., 16px radius) to create a polished, modern aesthetic
- Optimize animations and interactions to be lightweight and performant, ensuring smooth experiences across devices
### Components
- Design reusable, modular components with consistent styling, behavior, and feedback states (e.g., hover, active, focus, error)
- Include purposeful animations (e.g., scale-up on hover, fade-in on scroll) to guide attention and enhance interactivity without distraction
- Ensure full accessibility support with keyboard navigation, ARIA labels, and visible focus states (e.g., a glowing outline in an accent color)
- Use custom icons or illustrations for components to reinforce the brand’s visual identity
- **Color schemes**: Incorporate the user's color preferences when specified, and choose an appropriate scheme that matches the application's purpose and aesthetic
- **Typography**: Choose fonts that match the requested aesthetic (modern, elegant, playful, etc.)
- **Layout**: Follow the requested structure (3-column, sidebar, grid, etc.)
- **Component styling**: Use appropriate border radius, shadows, and spacing for the desired feel
- **Interactive elements**: Style buttons, forms, and hover states to match the theme
### Adding Fonts
@@ -1331,7 +1213,6 @@ When users specify color schemes:
- Follow shadcn/ui patterns for component variants
- Implement responsive design with Tailwind breakpoints
- Add hover and focus states for interactive elements
- **Use `hover:bg-muted` for hover states on clickable cards/buttons** - provides subtle, accessible feedback without overpowering the design (avoid `hover:bg-accent` or `hover:bg-secondary` which can be too strong)
## Writing Tests vs Running Tests
-186
View File
@@ -1,186 +0,0 @@
# Changelog
## [9.16.4] - 2026-09-16
### Changed
- Published sites carry only the tags the nsite spec defines — the relay hints Shakespeare used to attach were read by nothing, and taking a site back no longer rewrites them
## [9.16.3] - 2026-09-14
### Added
- Take back your sites one at a time — every name waiting for you now has its own Publish, Show, and Delete buttons, so you can keep the few you want and clear out the rest
- Show opens a site by its Nostr address before you decide about it, so you can look at names that never loaded in a browser
### Changed
- Deleting a name only gives it up on shakespeare.wtf — anything published to Nostr stays yours
- Names that couldn't be taken back safely can now be cleared out, instead of only explaining why they were stuck
## [9.16.2] - 2026-09-13
### Changed
- Deploy settings now says how many of your names are waiting to be taken back, and stays quiet when there are none
### Fixed
- Names you published before shakespeare.wtf changed hands are recognized as yours as you type them — the Deploy screen offers to hand them back instead of reporting them taken by somebody else
## [9.16.1] - 2026-09-13
### Fixed
- Deploying to a name you already own works again — names you took back in the migration were reported as taken by somebody else, and the Deploy button refused to publish to your own site
## [9.16.0] - 2026-09-13
### Added
- Take back the sites you published before shakespeare.wtf changed hands — Deploy settings now lists every name that's waiting for you and hands them all back at once, republished under your own key
- Deploys report which relays accepted your site, and can fill in any that missed it without republishing
### Changed
- Deploying to Shakespeare now publishes your site to Nostr under your own key, so it stays readable by any Nostr site viewer with or without shakespeare.wtf
- Recovered sites are titled whatever they call themselves rather than after their web address
### Fixed
- Deploying to Shakespeare works again — it had been reporting success while changing nothing, because the host it uploaded to no longer serves those addresses
- New accounts start with Shakespeare set up as a deployment target instead of an empty screen
- Deployment provider settings now scroll, so Save is always reachable
## [9.15.0] - 2026-08-19
### Added
- Connect to Meridian as an AI provider — available as a one-click preset with streamlined setup
- Optimize Repository action in the project menu that consolidates git history to reclaim space and repair bloated repositories
### Fixed
- Zaps now verify the invoice amount before paying, so you're never charged more than you approved
## [9.14.0] - 2026-06-05
### Added
- Log in with a remote signer by scanning a QR code — connect your NIP-46 mobile signer to Shakespeare without copying and pasting bunker strings
### Changed
- Unified the login dialog into a single, streamlined experience across sign-in methods
### Fixed
- Custom fonts now load correctly in previews instead of triggering a runtime error
- Builds no longer fail when a project depends on types-only packages
- Resolved all known security vulnerabilities in dependencies
## [9.13.2] - 2026-04-29
### Changed
- Preview pane now uses the new iframe.diy sandboxing service for a faster, more reliable preview experience
## [9.13.1] - 2026-04-27
### Changed
- AI agents now run commands through a real POSIX-style shell with proper quoting, pipes, redirects, and glob expansion, making multi-step project edits more reliable
- Overhauled the built-in `git` commands used by AI agents, adding `ls-files`, `merge`, `mv`, `restore`, `rev-parse`, `revert`, `rm`, and `switch` alongside improvements across existing git operations
- Overhauled core shell commands (`cat`, `cp`, `find`, `grep`, `ls`, `sed`, `sort`, and more) for closer POSIX behavior and better ergonomics when AI agents work on your project
## [9.13.0] - 2026-04-26
### Added
- Build projects with Tailwind CSS v4, including `@import "tailwindcss"` entry files and third-party v4 plugins like `tw-animate-css`
## [9.12.0] - 2026-04-25
### Added
- Build support for module workers and static asset URLs — projects using `new Worker(new URL('./w.ts', import.meta.url), { type: 'module' })`, `SharedWorker`, and `new URL('./logo.svg', import.meta.url)` now build and run correctly in the preview
- Preview pane grants microphone, ambient-light-sensor, and other device permissions so richer apps can run inside the preview
## [9.11.4] - 2026-04-17
### Fixed
- Preview pane no longer gets stuck on stale builds during rapid edits
### Changed
- Reduce AI costs for Anthropic models via OpenRouter by caching tool definitions across turns
## [9.11.3] - 2026-04-12
### Fixed
- App publish dialog now appears on mobile devices
- Changelog available offline via ServiceWorker precache
## [9.11.2] - 2026-04-06
### Fixed
- Derive private preview subdomains with HMAC to prevent cross-project origin collisions on iframe.diy
## [9.11.1] - 2026-04-05
### Changed
- Switch preview pane to iframe.diy for improved reliability and compatibility
- New users start with OpenCode Zen pre-configured for a zero-setup first experience
- Default nsite gateway changed to shakespeare.to with vanity subdomain support
- Update default Blossom servers and relay lists across deployments and uploads
### Fixed
- Default settings no longer override existing users' recently used models
- Showcase card clone URLs now use proper Nostr URI encoding
- Service worker no longer blocks SvelteKit nsite routes
## [9.11.0] - 2026-04-03
### Added
- Upload a banner image for your app directly from the App dialog
- T-tag editor in the App dialog Advanced section for tagging your app by category
- Delete App button in the App dialog Advanced section when editing an existing app
- Ngit repo and nsite deployment address fields in the App dialog Advanced section
- Auto-fill app name, description, and images from your project's OG tags and web manifest on first publish
### Changed
- Redesigned App dialog with an overlapping banner and avatar card layout
- Reorganized App dialog Advanced section into General, Handlers, and Tags tabs
- Showcase cards now show banner and icon images, and require both to appear in the showcase
- Validation summary above the Save button replaces per-field "Required" labels
- Updated showcase curator to the Shakespeare Builders community list
### Fixed
- Upgrade Nostrify to fix bunker connection issues
## [9.10.4] - 2026-04-02
### Fixed
- Fix Android splash screen showing logo masked to white silhouette instead of full color
## [9.10.3] - 2026-04-02
### Fixed
- Fix Android app showing default Capacitor splash screen and icon colors
## [9.10.2] - 2026-04-02
### Fixed
- Fix Android app showing default Capacitor icon instead of Shakespeare logo in app drawer
## [9.10.1] - 2026-04-02
### Fixed
- Replace default Capacitor vector drawable icons with Shakespeare logo
## [9.10.0] - 2026-04-02
### Added
- Android app powered by Capacitor with deep links, splash screen, and signed release builds
- CI pipeline for building APKs, publishing to GitLab releases, and distributing via Zapstore
- Nsite deployment for decentralized hosting via Nostr
### Changed
- Make version number on mobile settings a clickable link to the changelog with build date
## [9.9.2] - 2026-04-02
### Changed
- Simplify nsite deployment to always use named sites, removing the root site option
### Fixed
- Fix crash in "What's new" toast when used outside the router context
- Truncate long changelog excerpts in update notifications so they fit neatly in the toast
- Left-align changelog page content for better readability
## [9.9.1] - 2026-04-02
### Added
- Changelog page and versioning system with "What's new" toast notifications on updates
- Release skill for managing versioned releases with changelog generation and git tagging
+128
View File
@@ -0,0 +1,128 @@
# OPFS Compatibility Fix for isomorphic-git Clone Operations
## Issue Description
The error `TypeError: Cannot read properties of undefined (reading 'error')` occurs when using OPFS (Origin Private File System) with isomorphic-git during Git clone operations. This happens specifically in the `readObjectPacked` function within isomorphic-git when it tries to read Git pack files.
### Root Cause
The issue stems from subtle differences between how OPFS handles binary data compared to LightningFS/IndexedDB:
1. **Binary Data Handling**: isomorphic-git expects very specific behavior from Uint8Array objects, particularly when reading Git pack files
2. **Error Object Structure**: isomorphic-git expects error objects in a specific Node.js-style format
3. **Filesystem API Differences**: OPFS uses different APIs that don't always match the expected Node.js filesystem behavior
## Solution Implemented
### 1. Enhanced OPFS Adapter (`OPFSAdapterSimple.ts`)
**Improved Binary Data Handling:**
- Added special handling for Git files to ensure Uint8Array compatibility
- Created fresh Uint8Array instances to avoid browser-specific quirks
- Added validation for array methods that isomorphic-git expects
- Enhanced error handling with proper Node.js-style error codes
**Debug Mode:**
- Added optional debug logging to track filesystem operations
- Helps identify specific issues during Git operations
### 2. Better Error Handling (`ProjectsManager.ts`)
**Enhanced Clone Operation:**
- Added timeout mechanism (60 seconds) to prevent hanging
- Improved error detection for OPFS compatibility issues
- Better cleanup of failed project directories
- More descriptive error messages for users
**OPFS Issue Detection:**
- Automatically detects filesystem compatibility issues
- Provides clear recommendations to switch to LightningFS
- User-friendly error messages explaining the problem
### 3. Filesystem Selection UI (`DataSettings.tsx`)
**User Interface Improvements:**
- Clear warnings about OPFS Git compatibility issues
- Information about when to use each filesystem type
- Automatic fallback mechanism when OPFS initialization fails
### 4. Automatic Fallback (`App.tsx`)
**Robust Initialization:**
- Tests OPFS functionality before using it
- Automatically falls back to LightningFS if OPFS fails
- Better error reporting and user feedback
## Usage Recommendations
### When to Use LightningFS (Recommended)
- **Git Operations**: Better compatibility with isomorphic-git
- **Stability**: Proven track record with Shakespeare
- **Cross-browser**: Works in all modern browsers
- **Default Choice**: Recommended for most users
### When to Use OPFS (Experimental)
- **Large Storage**: When you need larger storage quotas
- **Performance**: Potentially better performance for file operations
- **Modern Browsers**: Only in Chrome, Edge, Firefox 111+
- **Non-Git Workflows**: For projects that don't require Git operations
## Technical Details
### Error Patterns Detected
The fix detects these specific error patterns that indicate OPFS compatibility issues:
- `Cannot read properties of undefined`
- `readObjectPacked` errors
- `reading 'error'` errors
- TypeError in isomorphic-git stack traces
### Binary Data Compatibility
```typescript
// Enhanced Uint8Array creation for Git compatibility
const gitCompatibleArray = new Uint8Array(uint8Array.length);
gitCompatibleArray.set(uint8Array);
// Validation of required methods
if (!gitCompatibleArray.slice || typeof gitCompatibleArray.slice !== 'function') {
throw new Error('Uint8Array missing required methods');
}
```
### Error Handling
```typescript
// Node.js-style error objects
const nodeError = new Error(`ENOENT: no such file or directory, open '${path}'`) as NodeJS.ErrnoException;
nodeError.code = 'ENOENT';
nodeError.errno = -2;
nodeError.syscall = 'open';
nodeError.path = path;
```
## Testing
The fix includes:
- ✅ All existing tests pass
- ✅ Enhanced error handling
- ✅ Automatic fallback mechanisms
- ✅ User interface improvements
- ✅ Debug logging capabilities
## Migration Path
For users experiencing OPFS issues:
1. **Immediate Fix**: Switch to LightningFS in Data Settings
2. **Export Data**: Use the export feature before switching filesystems
3. **Refresh**: Page will automatically refresh to apply new filesystem
4. **Import**: Recreate projects as needed
## Future Improvements
1. **Better OPFS Support**: Continue improving OPFS compatibility
2. **Hybrid Approach**: Use OPFS for regular files, LightningFS for Git
3. **Performance Monitoring**: Track filesystem performance differences
4. **User Analytics**: Monitor which filesystem users prefer
## Conclusion
This fix provides a robust solution for the OPFS/isomorphic-git compatibility issue while maintaining backward compatibility and providing clear user guidance. Users can continue using OPFS for non-Git operations while having LightningFS as a reliable fallback for Git-heavy workflows.
+44
View File
@@ -0,0 +1,44 @@
# OPFS Debugging Instructions
## Current Issue
Project creation fails with OPFS due to isomorphic-git compatibility issues.
## Debug Steps
1. **Enable OPFS in browser**:
- Go to Shakespeare app
- Settings → Data Settings → Filesystem Type → OPFS
- Save and refresh
2. **Try to create a project**:
- Enter a description like "test project"
- Select a model
- Click "Create Project"
3. **Check browser console**:
- Open DevTools (F12)
- Look for debug logs starting with `OPFSAdapter.readFile called with path:`
- Look for `OPFSAdapter.mkdir called with path:`
- Look for `OPFSAdapter.stat called with path:`
## Expected Debug Output
If our fixes work, you should see logs like:
```
OPFSAdapter.readFile called with path: /projects/test-project/.git/config encoding: utf8
OPFSAdapter.stat called with path: /projects/test-project
OPFSAdapter.mkdir called with path: /projects/test-project options: { recursive: true }
```
## Current Problems
1. **Undefined paths**: isomorphic-git calls our adapter with `undefined` paths
2. **Git config parsing**: "text.split is not a function" error suggests Git is trying to parse error messages as config files
3. **Directory creation**: Git directory structure creation fails
## Next Steps
Based on what we see in debug logs, we can:
1. Identify exactly which paths are being called as undefined
2. Fix the specific filesystem contract issues
3. Ensure proper error handling that doesn't break Git operations
+265
View File
@@ -0,0 +1,265 @@
# OPFS Fixes for Shakespeare
This document summarizes the fixes implemented to resolve OPFS (Origin Private File System) issues in Shakespeare.
## Problem Description
Users experienced complete failures when attempting to create projects using OPFS. The errors included:
1. **Undefined Path Error**: `Cannot read properties of undefined (reading 'includes')`
2. **Directory Creation Failures**: `ENOENT: no such file or directory, scandir '/projects/squirrel-junction/.git'`
3. **Git Operation Failures**: `text.split is not a function` from Git config parsing
4. **Filesystem Incompatibility**: OPFS adapter wasn't fully compatible with isomorphic-git expectations
## Root Cause Analysis
The issues stemmed from several problems in the OPFS adapter implementation:
### 1. Insufficient Path Validation
The `readFile` method didn't validate input paths, leading to attempts to call `.includes()` on undefined values.
### 2. Inconsistent Error Handling
OPFS throws DOMException errors, but isomorphic-git expects Node.js-style errors with specific error codes (ENOENT, EACCES, etc.).
### 3. Recursive Directory Creation Issues
The recursive directory creation logic didn't handle partial path failures properly, especially for Git directory structures.
### 4. Git Compatibility Problems
The adapter didn't fully support the filesystem operations that isomorphic-git requires for repository operations.
## Fixes Implemented
### 1. Enhanced Path Validation
**File**: `src/lib/OPFSAdapter.ts`
**Changes**:
```typescript
// Added null/undefined path validation
if (!path || typeof path !== 'string') {
const error = new Error('ENOENT: no such file or directory, open \'undefined\'') as NodeJS.ErrnoException;
error.code = 'ENOENT';
error.errno = -2;
error.syscall = 'open';
error.path = path || 'undefined';
throw error;
}
```
**Impact**: Prevents the "Cannot read properties of undefined" error.
### 2. Improved Error Handling
**File**: `src/lib/OPFSAdapter.ts`
**Changes**:
```typescript
// Convert DOMException to Node.js style errors
if (error instanceof Error && error.message.includes('NotFound')) {
const nodeError = new Error(`ENOENT: no such file or directory, open '${path}'`) as NodeJS.ErrnoException;
nodeError.code = 'ENOENT';
nodeError.errno = -2;
nodeError.syscall = 'open';
nodeError.path = path;
throw nodeError;
}
```
**Impact**: Makes OPFS errors compatible with isomorphic-git.
### 3. Better Recursive Directory Creation
**File**: `src/lib/OPFSAdapter.ts`
**Changes**:
```typescript
private async createDirectoriesRecursive(path: string): Promise<void> {
try {
const parts = path.split('/').filter(Boolean);
let currentHandle = await this.root;
for (const part of parts) {
try {
currentHandle = await currentHandle.getDirectoryHandle(part, { create: true });
} catch (error) {
console.error(`Failed to create directory part '${part}' in path '${path}':`, error);
throw new Error(`Failed to create directory ${path}: ${error}`);
}
}
} catch (error) {
console.error(`OPFSAdapter.createDirectoriesRecursive failed for path: ${path}`, error);
throw error;
}
}
```
**Impact**: Ensures Git directory structures can be created reliably.
### 4. Enhanced Git Operation Support
**File**: `src/lib/OPFSAdapter.ts`
**Changes**:
```typescript
private async readFileForGit(path: string): Promise<Uint8Array> {
try {
// Guard against undefined path
if (!path || typeof path !== 'string') {
const error = new Error('ENOENT: no such file or directory, open \'undefined\'') as NodeJS.ErrnoException;
error.code = 'ENOENT';
error.errno = -2;
error.syscall = 'open';
error.path = path || 'undefined';
throw error;
}
const fileHandle = await this.getFileHandle(path);
const file = await fileHandle.getFile();
const arrayBuffer = await file.arrayBuffer();
return new Uint8Array(arrayBuffer);
} catch (error) {
// Enhanced error handling for Git operations
console.error(`Git read operation failed for path: ${path}`, error);
// Create a more detailed error that isomorphic-git can handle
const gitError = new Error(`Failed to read Git object: ${path}`) as NodeJS.ErrnoException;
gitError.code = 'ENOENT';
gitError.errno = -2;
gitError.syscall = 'read';
gitError.path = path;
// Preserve original error information by adding it to the message
if (error instanceof Error) {
gitError.message = `${gitError.message}: ${error.message}`;
}
throw gitError;
}
}
```
**Impact**: Makes Git operations (clone, commit, etc.) work reliably with OPFS.
### 5. Improved ProjectsManager Logging
**File**: `src/lib/ProjectsManager.ts`
**Changes**:
```typescript
async createProject(name: string, customId?: string): Promise<Project> {
console.log(`Creating project: ${name}, customId: ${customId}`);
const project = await this.cloneProject(name, GIT_TEMPLATE_URL, customId, { depth: 1 });
console.log(`Project cloned at path: ${project.path}`);
try {
await this.fs.mkdir(this.dir + `/${project.id}/.ai/history`, { recursive: true });
console.log(`Created .ai/history directory for project ${project.id}`);
} catch (error) {
console.log(`Directory .ai/history might already exist for project ${project.id}:`, error);
// Directory might already exist
}
// ... rest of the method with enhanced logging
}
```
**Impact**: Provides better debugging information when issues occur.
### 6. Better Filesystem Initialization
**File**: `src/App.tsx`
**Changes**:
```typescript
constructor() {
// Check if OPFS is available
if (!('storage' in navigator) ||
typeof (navigator.storage as unknown as { getDirectory: () => Promise<FileSystemDirectoryHandle> }).getDirectory !== 'function') {
throw new Error('OPFS is not supported in this browser or environment');
}
// Get the root directory handle for OPFS
this.root = (navigator.storage as unknown as { getDirectory: () => Promise<FileSystemDirectoryHandle> }).getDirectory();
}
```
**Impact**: Fails fast if OPFS is not available.
## Testing
All existing tests pass:
```bash
✓ Test Files 83 passed (83)
Tests 564 passed | 6 skipped (570)
```
Type checking and build also pass successfully.
## Browser Compatibility
OPFS is supported in:
- Chrome 86+
- Edge 86+
- Firefox 111+ (limited support)
- Safari 16.4+
For browsers that don't support OPFS, the system automatically falls back to LightningFS.
## Usage Instructions
To use OPFS in Shakespeare:
1. **Enable OPFS in Settings**:
- Go to Settings → Data Settings
- Change "Filesystem Type" to "OPFS"
- Save changes
2. **Restart Application**:
- Refresh the page to apply the new filesystem type
3. **Verify OPFS is Working**:
- Try creating a new project
- Check browser console for successful filesystem operations
- Verify that project creation completes without errors
## Troubleshooting
If OPFS still fails:
1. **Check Browser Support**:
- Ensure you're using a supported browser version
- Check browser console for OPFS availability errors
2. **Clear Browser Data**:
- Clear site data and try again
- This can resolve corrupted OPFS storage issues
3. **Fallback to LightningFS**:
- If OPFS consistently fails, use LightningFS instead
- The system will automatically fall back if OPFS initialization fails
## Performance Considerations
OPFS provides better performance than LightningFS for:
- Large file operations
- Concurrent file access
- Storage persistence
However, OPFS has some limitations:
- No symbolic links
- Different permission model
- Browser-specific implementation details
## Future Improvements
Potential enhancements for OPFS support:
1. **Atomic Operations**: Implement atomic file writes using OPFS transactions
2. **File Locking**: Add file locking mechanisms for concurrent access
3. **Storage Quotas**: Better handling of storage quota limits
4. **Migration Tools**: Tools to migrate existing LightningFS data to OPFS
## Conclusion
The fixes implemented resolve the major OPFS compatibility issues and provide a robust filesystem backend for Shakespeare. The enhanced error handling, improved logging, and better Git compatibility ensure that project creation and management work reliably with OPFS.
+83
View File
@@ -0,0 +1,83 @@
# OPFS Git Clone Fix Summary
## Issues Identified and Fixed
### Issue 1: Binary Pack Files Returned as Text
**Problem**: Git pack index files (`.idx`) were being returned as text instead of binary data because isomorphic-git was passing options objects as the encoding parameter.
**Log Evidence**:
```
[OPFSAdapter] readFile called: path="/projects/untitled-1/.git/objects/pack/pack-be5dbf750d545d214e0191ae909d83915c6beb6a.idx", encoding="[object Object]"
[OPFSAdapter] Returning text content for encoding "[object Object]", length=5138
```
**Fix**: Modified encoding detection logic to always return binary data for Git pack files regardless of encoding parameter.
### Issue 2: Git Config Files Returned as Binary
**Problem**: Git configuration files (`.git/config`) were being returned as binary data when they should be text files.
**Log Evidence**:
```
[OPFSAdapter] readFile called: path="/projects/nut-cache/.git/config", encoding="[object Object]"
[OPFSAdapter] Returning binary content: 130 bytes, constructor: Uint8Array, isGitFile: true
TypeError: text.split is not a function
```
**Fix**: Added proper distinction between Git text files and Git binary files.
### Issue 3: Filesystem Capability Testing
**Problem**: isomorphic-git calls `readFile` with undefined paths to test filesystem capabilities, causing unnecessary error logs.
**Fix**: Added proper handling and logging for filesystem capability tests.
## Solution Implementation
### Enhanced File Type Detection
```typescript
// Git binary files that should ALWAYS be returned as Uint8Array
const isGitBinaryFile = path.includes('.git/objects/pack/') ||
(path.includes('.git/objects/') && !path.includes('.git/objects/info/')) ||
path.endsWith('.pack') ||
path.endsWith('.idx') ||
path.includes('.git/index');
// Git text files that should be returned as text
const isGitTextFile = path.includes('.git/config') ||
path.includes('.git/HEAD') ||
path.includes('.git/refs/') ||
path.includes('.git/logs/') ||
path.includes('.git/info/') ||
path.includes('.git/hooks/') ||
path.includes('.git/description');
// Smart encoding detection
const shouldReturnText = (encoding === 'utf8' && typeof encoding === 'string') ||
(!isGitBinaryFile && (isGitTextFile || !path.includes('.git/'))) ||
(isGitTextFile && typeof encoding !== 'string');
```
### Key Insights
1. **isomorphic-git Behavior**: isomorphic-git passes options objects as encoding parameters, not just strings
2. **File Type Distinction**: Git repositories contain both text files (config, refs) and binary files (pack, index, objects)
3. **Capability Testing**: isomorphic-git tests filesystem capabilities by calling methods with invalid parameters
### Testing Status
- ✅ Fixed binary pack file handling
- ✅ Fixed Git config file handling
- ✅ Added proper capability test handling
- ✅ Enhanced debug logging
- ✅ All existing tests pass
- 🔄 Ready for real-world Git clone testing
## Next Steps
The OPFS adapter should now correctly handle Git clone operations by:
1. Returning binary data for Git pack files and objects
2. Returning text data for Git configuration and reference files
3. Properly handling isomorphic-git's filesystem capability tests
4. Providing detailed debug logging for troubleshooting
This should resolve the `TypeError: Cannot read properties of undefined (reading 'error')` and `TypeError: text.split is not a function` errors during Git clone operations with OPFS.
+159
View File
@@ -0,0 +1,159 @@
# OPFS Implementation for Shakespeare
This document describes the implementation of OPFS (Origin Private File System) support as an alternative to LightningFS in the Shakespeare project.
## Overview
The project now supports two filesystem backends:
1. **LightningFS** (IndexedDB) - The original filesystem implementation
2. **OPFS** (Origin Private File System) - A modern browser API for better performance
## Implementation Details
### 1. OPFS Adapter (`src/lib/OPFSAdapter.ts`)
Created a new `OPFSAdapter` class that implements the `JSRuntimeFS` interface, making it compatible with the existing filesystem abstraction. The adapter provides:
- **File Operations**: `readFile`, `writeFile`, `stat`, `unlink`
- **Directory Operations**: `readdir`, `mkdir`, `rmdir`
- **Utility Operations**: `rename`, `copy`, `recursive operations`
- **Error Handling**: Proper error handling with fallback to LightningFS
### 2. Configuration Updates
#### AppContext (`src/contexts/AppContext.ts`)
- Added `FilesystemType` type: `"lightningfs" | "opfs"`
- Extended `AppConfig` interface to include `filesystemType` field
- Updated Zod schema for validation
#### AppProvider (`src/components/AppProvider.tsx`)
- Updated AppConfigSchema to include filesystemType validation
### 3. Dynamic Filesystem Initialization (`src/App.tsx`)
Created a new `FilesystemProvider` component that:
- Detects OPFS availability in the browser
- Dynamically selects the appropriate filesystem backend
- Provides automatic fallback to LightningFS if OPFS fails
- Shows loading states and error messages
### 4. User Interface Updates
#### AppSettingsDialog (`src/components/AppSettingsDialog.tsx`)
- Added filesystem selection UI with RadioGroup component
- Shows OPFS availability detection
- Displays warnings when OPFS is not available
- Includes educational information about each filesystem type
- Automatically refreshes the page when filesystem type changes
### 5. Type Definitions
#### Nostr Types (`src/types/nostr.d.ts`)
- Added proper TypeScript definitions for `window.nostr` object
- Fixed existing TypeScript errors related to Nostr extension access
## Features
### OPFS Advantages
- **Better Performance**: Direct filesystem access without IndexedDB overhead
- **Larger Storage Limits**: Typically higher storage quotas than IndexedDB
- **Modern API**: Uses native browser filesystem APIs
- **Atomic Operations**: Better support for atomic file operations
### LightningFS Advantages
- **Universal Support**: Works in all modern browsers
- **Mature Implementation**: Well-tested and stable
- **Symbolic Links**: Supports symbolic links (OPFS does not)
- **Proven Reliability**: Used in production for years
### User Experience
- **Automatic Detection**: UI automatically shows available options
- **Clear Warnings**: Users are informed when OPFS is not available
- **Safe Switching**: Page refresh ensures clean filesystem transition
- **Fallback Protection**: Automatic fallback prevents data loss
## Browser Compatibility
### OPFS Support
- ✅ Chrome 87+
- ✅ Edge 87+
- ✅ Firefox 111+
- ❌ Safari (limited support)
- ❌ Mobile browsers (varies)
### LightningFS Support
- ✅ All modern browsers
- ✅ Mobile browsers
- ✅ Older browsers (with polyfills)
## Usage
### For Users
1. Go to Settings → App Settings
2. Select preferred filesystem type in the Filesystem section
3. Save changes (page will refresh automatically)
4. The app will use the selected filesystem
### For Developers
- The filesystem is abstracted through the `JSRuntimeFS` interface
- All existing code continues to work without changes
- New filesystem types can be added by implementing the interface
- Use `useFS()` hook to access the filesystem
## Migration
### From LightningFS to OPFS
1. Export current projects using Data Settings → Export Files
2. Change filesystem type in settings
3. Import projects if needed
4. Verify all data is intact
### From OPFS to LightningFS
1. Export current projects using Data Settings → Export Files
2. Change filesystem type in settings
3. Import projects if needed
4. Verify all data is intact
## Error Handling
### OPFS Not Available
- UI shows warning message
- Option is disabled in settings
- Automatic fallback to LightningFS
### Initialization Failures
- Shows error message with details
- Provides browser compatibility information
- Suggests using LightningFS instead
### Runtime Errors
- Graceful error handling in adapter
- Proper error propagation to UI
- Fallback mechanisms where possible
## Testing
- All existing tests continue to pass
- TypeScript compilation successful
- Build process works correctly
- UI components properly render filesystem options
- Error states are handled appropriately
## Future Enhancements
### Potential Improvements
1. **Data Migration Tools**: Automatic migration between filesystem types
2. **Performance Metrics**: Show performance differences between backends
3. **Storage Analytics**: Display usage statistics for each filesystem
4. **Hybrid Approach**: Use different filesystems for different data types
5. **Compression**: Add compression support for better storage efficiency
### Considerations
- OPFS is still evolving; browser support may change
- LightningFS remains the safer choice for maximum compatibility
- Data portability is important for user freedom
- Performance benefits may vary by use case and browser
## Conclusion
The OPFS implementation provides users with a choice between filesystem backends, balancing modern performance advantages with broad compatibility. The implementation maintains backward compatibility while providing a path forward for users on modern browsers.
+68
View File
@@ -0,0 +1,68 @@
# OPFS Git Compatibility Test
## Issue Fixed
The main issue was that isomorphic-git was calling `fs.readFile()` on Git pack index files (`.idx`) with an options object as the encoding parameter, but the OPFS adapter was incorrectly interpreting this as a string encoding and returning text data instead of binary data.
## Debug Output Analysis
```
[OPFSAdapter] readFile called: path="/projects/untitled-1/.git/objects/pack/pack-be5dbf750d545d214e0191ae909d83915c6beb6a.idx", encoding="[object Object]"
[OPFSAdapter] File found: size=5328, type="", lastModified=1758521210388
[OPFSAdapter] Returning text content for encoding "[object Object]", length=5138
```
**Problem**: The `.idx` file is a binary Git pack index file, but it was being returned as text because `encoding="[object Object]"` was being treated as a truthy string value.
**Solution**: Modified the encoding detection logic to:
1. Always return binary data for Git pack files and object files
2. Only return text for explicit `encoding === 'utf8'` on non-Git binary files
3. Handle cases where isomorphic-git passes options objects as encoding
## Code Changes
### Before (Broken)
```typescript
if (encoding === 'utf8') {
return await file.text();
} else if (encoding) {
// BUG: This treated "[object Object]" as truthy and returned text
return await file.text();
} else {
// Binary data
return new Uint8Array(arrayBuffer);
}
```
### After (Fixed)
```typescript
// Git pack files (.pack, .idx) and object files should always be binary
const isGitBinaryFile = path.includes('.git/objects/pack/') ||
(path.includes('.git/objects/') && !path.includes('.git/objects/info/')) ||
path.endsWith('.pack') ||
path.endsWith('.idx') ||
path.includes('.git/index');
// Only return text for explicit 'utf8' encoding on non-Git binary files
const shouldReturnText = !isGitBinaryFile &&
encoding === 'utf8' &&
typeof encoding === 'string';
if (shouldReturnText) {
return await file.text();
} else {
// Return binary data (Uint8Array)
return new Uint8Array(arrayBuffer);
}
```
## Expected Result
With this fix, Git pack index files will be correctly returned as `Uint8Array` binary data, which should resolve the `Cannot read properties of undefined (reading 'error')` error in isomorphic-git's `readObjectPacked` function.
## Testing
To test this fix:
1. Try creating a new project with OPFS enabled
2. The Git clone operation should now succeed
3. Debug logs should show: `Returning binary content: X bytes` for `.idx` files instead of `Returning text content`
+68 -26
View File
@@ -1,43 +1,85 @@
# Shakespeare 🎭
# Shakespeare - AI-Powered Nostr Website Builder
[![Edit with Shakespeare](https://shakespeare.diy/badge.svg)](https://shakespeare.diy/clone?url=https://gitlab.com/soapbox-pub/shakespeare.git)
Shakespeare is an open-source AI app builder that runs entirely in your browser.
https://shakespeare.diy
Shakespeare is an AI chat application that allows users to build custom Nostr websites through natural language conversation. Simply describe what you want to build, and AI will help you create it.
## Features
- **Use any AI provider** OpenAI, Anthropic, OpenRouter, xAI, ZAI, Deepseek, and more
- **Buy credits anonymously** with Nostr and Lightning ⚡
- **Redeem gift cards** with shareable links for instant credits
- **Runs entirely in the browser** No backend required
- **AI-Powered Development**: Chat with an AI assistant to build your Nostr website
- **File Attachments**: Attach files directly to chat messages with structured text parts, visual badges, and deduplication. Supports both file selection and clipboard image pasting
- **Project Management**: Create and manage multiple projects with sidebar navigation
- **Real-time Editing**: Edit files directly in the browser with syntax highlighting
- **File Explorer**: Browse and manage your project files
- **Project Preview**: Preview your website as you build it
- **Template Cloning**: Start from a pre-configured Nostr template
## How it Works
## Getting Started
Shakespeare is a React PWA that stores files in IndexedDB with [LightningFS](https://github.com/isomorphic-git/lightning-fs). Your browser connects directly to AI providers and git services (through [isomorphic-git](https://github.com/isomorphic-git/isomorphic-git)) to enable you to build and deploy AI apps entirely from your device.
1. **Create a Project**: Enter a description of what you want to build in the prompt textarea
2. **Chat with AI**: Use the AI assistant to add features, edit files, and build your website
3. **Attach Files**: Click the paperclip icon to attach files or paste images directly from your clipboard - they'll show as "Added file: /path/filename"
4. **Edit Code**: Switch to the code view to manually edit files if needed
5. **Preview**: View your website in the preview pane
Shakespeare hosts no backend (except for a couple microservices in the `services/` directory; these are fully configurable within Shakespeare's settings). All your code and configuration is stored in your browser.
## Project Structure
Configure any AI providers and git services you want. Configuration is stored entirely in the browser in localStorage.
Each project includes:
- React 18 with TypeScript
- Vite for building
- TailwindCSS for styling
- Nostrify for Nostr integration
- shadcn/ui components
You can then push and pull code to syncronize your work across devices.
## AI Capabilities
Shakespeare can work on any type of project. But it is specialized to build React applications in TypeScript, which it compiles in the browser with [esbuild-wasm](https://www.npmjs.com/package/esbuild-wasm) and custom plugins. Any codebase can be worked on, but only compatible projects can be previewed directly in Shakespeare.
The AI assistant can:
- Read and write project files
- Add new components and pages
- Configure Nostr functionality
- Build the project
- Search through files
- Provide project structure overview
- Add and remove npm packages
- Install dependencies and dev dependencies
## Open Source
## Usage
Shakespeare is proudly Open Source software licensed under the GNU AGPLv3. The purpose of Shakespeare is to provide a free and open platform for building AI applications that respects user privacy and freedom.
1. **Homepage**: Enter a project description in the textarea to create new projects, with existing projects listed in the sidebar
2. **Project View**: Split-pane interface with AI chat on the left and preview/code on the right
3. **File Explorer**: Navigate your project files in the code view
4. **File Editor**: Edit files with syntax highlighting and save changes
## Mirrors
## Git Integration
Shakespeare is available on the following URLs:
Shakespeare includes full Git functionality with credential management:
- [shakespeare.diy](https://shakespeare.diy)
- [shakespeare-diy.github.io](https://shakespeare-diy.github.io)
- [shakespeare-b0b9c8.gitlab.io](https://shakespeare-b0b9c8.gitlab.io)
### Features
- **Version Control**: Full Git repository support with commit history and branch management
- **Global Credentials**: Configure Git credentials once and use them across all projects
- **Automatic Matching**: Credentials are automatically matched to repository origins
- **Popular Providers**: Built-in support for GitHub, GitLab, and custom Git providers
- **Secure Storage**: Credentials are stored locally in your browser using IndexedDB
## Alternatives
### Setting Up Git Credentials
- [goose](https://github.com/block/goose) - open-source desktop app and cli utilizing your full computer for AI tasks
- [bolt.diy](https://github.com/stackblitz-labs/bolt.diy) - similar to Shakespeare, but built on closed-source WebContainers technology
1. **Access Git Settings**: Click the gear icon in any Git dialog or use the Git Settings option
2. **Add Provider**: Choose from GitHub, GitLab, or add a custom Git provider
3. **Enter Token**: Use your username and personal access token for authentication
4. **Automatic Usage**: Credentials are automatically used for push/pull operations in matching repositories
### Repository Operations
- **Push/Pull**: Sync changes with remote repositories using configured credentials
- **Status Monitoring**: Real-time Git status with file changes and sync information
- **Commit History**: View commit history and repository information
- **Branch Management**: Work with different branches and track remote changes
## Development
Built with:
- React 18
- TypeScript
- Vite
- TailwindCSS
- shadcn/ui
- LightningFS for filesystem
- isomorphic-git for template cloning
+138
View File
@@ -0,0 +1,138 @@
# OPFS UI Improvements
## Problem Addressed
The original implementation had a usability issue where the App Settings dialog (containing filesystem selection) was only accessible through a dropdown menu in the ActionsMenu component, making it very difficult for users to discover and access filesystem settings.
## Solution Implemented
### 1. **Added App Settings to Main Settings Page** (`src/pages/Settings.tsx`)
- Added "App Settings" option to the main settings menu
- Positioned logically between data-related settings and about section
- Uses `Settings` icon for clear visual identification
### 2. **Created Dedicated App Settings Page** (`src/pages/AppSettings.tsx`)
- Full-page settings interface for app configuration
- Organized into clear sections:
- **Filesystem Settings**: OPFS vs LightningFS selection
- **Deployment Settings**: Deploy server configuration
- Responsive design with mobile-friendly layout
- Clear back navigation on mobile devices
### 3. **Updated Routing** (`src/AppRouter.tsx`)
- Added `/settings/app` route for App Settings page
- Integrated with existing SettingsLayout for consistent navigation
- Proper route ordering in settings hierarchy
### 4. **Removed Hidden Access** (`src/components/ActionsMenu.tsx`)
- Removed AppSettingsDialog from ActionsMenu dropdown
- Cleaned up unused imports
- Settings no longer buried in project-specific actions menu
### 5. **Complete Translation Support** (`src/lib/i18n.ts`)
Added comprehensive translations for all new UI elements:
#### English
- `appSettings`: "App Settings"
- `appSettingsDescription`: "Configure filesystem and deployment settings"
- `filesystem`: "Filesystem"
- `filesystemType`: "Filesystem Type"
- `deployment`: "Deployment"
- `deployServer`: "Deploy Server"
- `deployServerDescription`: "Your projects will be deployed to subdomains of this server..."
- `saveSettings`: "Save Settings"
#### Portuguese
- `appSettings`: "Configurações do App"
- `appSettingsDescription`: "Configure sistema de arquivos e configurações de implantação"
- `filesystem`: "Sistema de Arquivos"
- `filesystemType`: "Tipo de Sistema de Arquivos"
- `deployment`: "Implantação"
- `deployServer`: "Servidor de Implantação"
- `deployServerDescription`: "Seus projetos serão implantados em subdomínios deste servidor..."
- `saveSettings`: "Salvar Configurações"
#### Chinese
- `appSettings`: "应用设置"
- `appSettingsDescription`: "配置文件系统和部署设置"
- `filesystem`: "文件系统"
- `filesystemType`: "文件系统类型"
- `deployment`: "部署"
- `deployServer`: "部署服务器"
- `deployServerDescription`: "您的项目将部署到此服务器的子域..."
- `saveSettings`: "保存设置"
## Key UI Improvements
### **Discoverability**
- ✅ Settings now easily accessible from main Settings page
- ✅ Clear, descriptive menu item with appropriate icon
- ✅ Logical grouping with related settings
### **User Experience**
- ✅ Full-page interface with adequate space for explanations
- ✅ Mobile-responsive design with proper navigation
- ✅ Clear visual hierarchy with cards and sections
- ✅ Informative descriptions for each filesystem type
### **Accessibility**
- ✅ Proper semantic HTML structure
- ✅ Clear form labels and associations
- ✅ Keyboard navigation support
- ✅ Screen reader friendly with proper ARIA labels
### **Error Handling**
- ✅ Clear warnings when OPFS is not available
- ✅ Visual indicators for disabled options
- ✅ Helpful error messages and browser compatibility info
- ✅ Automatic fallback to LightningFS when needed
### **Internationalization**
- ✅ Complete translation support for all languages
- ✅ Consistent terminology across languages
- ✅ Culturally appropriate descriptions
## User Flow
### **Before (Poor UX)**
1. User opens project
2. Clicks tiny "more options" button (⋮)
3. Finds "Settings" in dropdown menu
4. Opens dialog to change filesystem settings
5. Hidden and non-intuitive discovery
### **After (Good UX)**
1. User navigates to Settings (accessible from main navigation)
2. Sees "App Settings" option clearly listed
3. Clicks to access full settings page
4. Finds filesystem settings logically grouped with deployment settings
5. Clear, discoverable, and intuitive
## Technical Benefits
### **Maintainability**
- ✅ Dedicated page component for easier maintenance
- ✅ Separation of concerns between settings types
- ✅ Consistent patterns with other settings pages
### **Extensibility**
- ✅ Easy to add new app-level settings
- ✅ Scalable layout for additional configuration options
- ✅ Consistent with existing settings architecture
### **Testing**
- ✅ All existing tests continue to pass
- ✅ TypeScript compilation successful
- ✅ Build process works correctly
- ✅ No breaking changes to existing functionality
## Conclusion
The UI improvements make filesystem settings significantly more discoverable and accessible to users. The implementation follows established patterns in the codebase, maintains complete internationalization support, and provides a much better user experience overall.
Users can now easily find and configure filesystem settings through the main Settings page, rather than having to discover them through a hidden dropdown menu in project-specific actions.
-101
View File
@@ -1,101 +0,0 @@
# Using Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore
# Built application files
*.apk
*.aar
*.ap_
*.aab
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# Android Studio Navigation editor temp files
.navigation/
# Android Studio captures folder
captures/
# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml
# Keystore files
*.jks
*.keystore
key.properties
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/
# Google Services (e.g. APIs or Firebase)
# google-services.json
# Freeline
freeline.py
freeline/
freeline_project_description.json
# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md
# Version control
vcs.xml
# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/
# Android Profiling
*.hprof
# Cordova plugins for Capacitor
capacitor-cordova-android-plugins
# Copied web assets
app/src/main/assets/public
# Generated Config files
app/src/main/assets/capacitor.config.json
app/src/main/assets/capacitor.plugins.json
app/src/main/res/xml/config.xml
-28
View File
@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>android</name>
<comment>Project android created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1775119841750</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
@@ -1,13 +0,0 @@
arguments=--init-script /home/alex/.cache/opencode/bin/jdtls/config_linux/org.eclipse.osgi/58/0/.cp/gradle/init/init.gradle
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/usr/lib/jvm/java-21-openjdk-amd64
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
-2
View File
@@ -1,2 +0,0 @@
/build/*
!/build/.npmkeep
-34
View File
@@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>app</name>
<comment>Project app created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1775119841776</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
@@ -1,2 +0,0 @@
connection.project.dir=..
eclipse.preferences.version=1
-73
View File
@@ -1,73 +0,0 @@
apply plugin: 'com.android.application'
def keystorePropertiesFile = rootProject.file("key.properties")
def keystoreProperties = new Properties()
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
namespace = "diy.shakespeare.app"
compileSdk = rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "diy.shakespeare.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "9.9.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
ignoreAssetsPattern = '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
}
}
signingConfigs {
release {
if (keystorePropertiesFile.exists()) {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
repositories {
flatDir{
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
implementation project(':capacitor-android')
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
testImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
implementation project(':capacitor-cordova-android-plugins')
}
apply from: 'capacitor.build.gradle'
try {
def servicesJSON = file('google-services.json')
if (servicesJSON.text) {
apply plugin: 'com.google.gms.google-services'
}
} catch(Exception e) {
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
}
-20
View File
@@ -1,20 +0,0 @@
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}
}
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {
implementation project(':capacitor-app')
implementation project(':capacitor-status-bar')
}
if (hasProperty('postBuildExtras')) {
postBuildExtras()
}
-28
View File
@@ -1,28 +0,0 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Keep Capacitor classes (WebView JS bridge)
-keep class com.getcapacitor.** { *; }
-keep class diy.shakespeare.app.** { *; }
# Keep WebView JS interfaces
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}
# Keep OkHttp (used by Capacitor)
-dontwarn okhttp3.**
-dontwarn okio.**
-keep class okhttp3.** { *; }
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
@@ -1,26 +0,0 @@
package com.getcapacitor.myapp;
import static org.junit.Assert.*;
import android.content.Context;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.getcapacitor.app", appContext.getPackageName());
}
}
-50
View File
@@ -1,50 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode|navigation|density"
android:name=".MainActivity"
android:label="@string/title_activity_main"
android:theme="@style/AppTheme.NoActionBarLaunch"
android:launchMode="singleTask"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- Deep links: open shakespeare.diy URLs in the app -->
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="shakespeare.diy" />
</intent-filter>
</activity>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"></meta-data>
</provider>
</application>
<!-- Permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
@@ -1,5 +0,0 @@
package diy.shakespeare.app;
import com.getcapacitor.BridgeActivity;
public class MainActivity extends BridgeActivity {}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

@@ -1,82 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<!--
Shakespeare theater masks logo from public/shakespeare.svg.
SVG viewBox is "0 0 128 128", with original colors preserved.
Scaled to ~55% and centered within the 108x108 viewport to fit
Android's adaptive icon safe zone (66% of 108dp).
-->
<group
android:translateX="24.3"
android:translateY="15.5"
android:scaleX="0.464"
android:scaleY="0.464">
<!-- Red beak right -->
<path
android:fillColor="#F45125"
android:pathData="M110.28,61.32l2.63,8.84c0,0,7.24,-1.6,7.62,3.2c0.38,4.8,-6.77,8,-6.77,8l2.26,10.63 c0,0,7.9,-6.4,8,-15.61c0,0,0.66,-11.29,-6.11,-13.92C113.67,60.85,110.28,61.32,110.28,61.32z"/>
<!-- Red tail feathers -->
<path
android:fillColor="#F45125"
android:pathData="M68.71,94.99c0,0,-11.1,-4.7,-16.46,1.98c-0.75,0.94,-1.41,1.88,-2.16,2.82 c-0.56,0.75,-1.13,1.5,-1.69,2.16c-0.47,0.56,-1.03,1.13,-1.69,1.5c-0.66,0.38,-1.32,0.66,-2.07,0.85c-0.94,0.19,-1.88,0.19,-2.82,0.09 c-1.32,-0.09,-2.63,-0.38,-3.95,-0.66c-0.47,-0.09,-0.85,-0.19,-1.22,-0.28c-0.09,0,-0.19,-0.09,-0.28,-0.09 s-0.19,-0.09,-0.28,-0.09c-0.38,0.09,0.19,0.75,0.38,0.94c0.28,0.28,0.56,0.66,0.85,0.94c0.85,0.75,1.69,1.5,2.73,1.98 c1.32,0.66,2.73,1.03,4.14,1.13c0.09,0,0.38,0,0.47,0.09c0.19,0.19,-0.28,0.47,-0.47,0.56c-0.28,0.19,-0.47,0.28,-0.75,0.38 c-0.85,0.38,-1.79,0.56,-2.63,0.75c-0.85,0.19,-1.69,0.28,-2.45,0.28c-0.47,0,-0.85,0.09,-1.22,0.09c-0.28,0,-0.56,-0.09,-0.85,0 s0.09,0.47,0.28,0.56c0.38,0.19,0.75,0.47,1.13,0.66c1.13,0.56,2.26,1.03,3.39,1.32c1.5,0.38,3.1,0.56,4.61,0.38 c1.32,-0.19,2.63,-0.56,3.86,-1.03c6.77,-3.1,6.21,-9.59,12.42,-10.16c4.61,-0.38,11.1,2.07,11.1,2.07L68.71,94.99z"/>
<!-- Red beak left -->
<path
android:fillColor="#F45125"
android:pathData="M19.79,38.28c0,0,-12.13,1.98,-15.24,12.79C0.61,64.9,20.26,69.5,20.26,69.5l1.22,-9.41 c0,0,-13.07,-1.32,-12.32,-6.3c0.94,-6.21,11.85,-5.64,11.85,-5.64L19.79,38.28z"/>
<!-- Red wing detail -->
<path
android:fillColor="#F45125"
android:pathData="M20.73,70.92c0,0,-1.88,0.56,-4.61,2.54c-1.88,1.32,-4.42,3.01,-6.87,5.93 c-1.22,1.41,-2.16,3.1,-2.82,4.89c-0.47,1.22,-0.66,2.45,-0.66,3.76c0,0.28,0,0.56,0,0.85c0,0.09,0,0.85,0.28,0.66 c0.09,-0.09,0.19,-0.38,0.28,-0.47c0.19,-0.47,0.47,-0.85,0.75,-1.22c0.85,-1.13,1.88,-2.16,3.01,-3.01c0.38,-0.28,0.75,-0.47,1.13,-0.66 c0.28,-0.28,0.75,-0.66,0.94,-0.28c0.09,0.19,-0.09,0.47,-0.19,0.66c-0.09,0.28,-0.19,0.66,-0.19,0.94c-0.38,1.5,-0.56,3.01,-0.75,4.51 c-0.09,0.85,-0.09,1.69,0,2.45c0,0.38,0.09,0.85,0.09,1.22c0,0.19,0.09,0.38,0.09,0.56c0,0.19,0.19,0.47,0.38,0.19 c0.09,-0.09,0.09,-0.19,0.19,-0.38c0.19,-0.28,0.28,-0.66,0.47,-0.94c0.47,-0.85,0.94,-1.69,1.5,-2.63c0.66,-1.13,1.41,-2.16,2.16,-3.1 c0.85,-1.13,1.88,-2.26,2.92,-3.2c1.13,-1.03,2.35,-2.07,3.67,-2.92c0.75,-0.47,1.6,-0.94,2.45,-1.32L20.73,70.92z"/>
<!-- Yellow body -->
<path
android:fillColor="#FCC21B"
android:pathData="M116.4,79.29c-1.13,-5.55,-2.73,-11.01,-4.51,-16.46c-1.5,-4.61,-3.1,-9.31,-5.83,-13.36 c-1.22,-1.79,-3.01,-3.01,-5.27,-3.86c-4.33,-1.69,-9.97,-1.98,-13.73,-1.98c-5.64,0,-11.48,1.22,-16.74,3.67 c-1.88,5.64,-7.05,19.94,-14.86,26.34c0.47,2.63,1.03,5.36,1.79,8c1.32,4.61,3.01,9.22,4.61,13.83c1.5,4.42,3.29,8.84,6.58,12.23 c0.85,0.94,1.88,1.69,2.82,2.45c2.26,1.88,4.99,3.01,7.71,3.95c2.54,0.85,5.17,1.5,7.81,2.07c4.7,1.03,11.48,2.82,16.08,0.66 c2.54,-1.13,4.61,-2.92,6.3,-5.08c1.79,-2.26,3.2,-4.8,4.42,-7.43c1.88,-3.95,3.86,-8.37,4.14,-12.89 C117.99,87.38,117.24,83.24,116.4,79.29z"/>
<!-- Blue head -->
<path
android:fillColor="#429ADF"
android:pathData="M77.64,33.57c-0.28,-1.03,-1.03,-2.07,-1.6,-3.01c-6.3,-11.01,-20.04,-16.27,-32.26,-15.52 c-3.76,0.28,-9.31,0.85,-13.54,2.73c-2.07,0.94,-3.86,2.35,-4.99,4.14c-2.54,4.23,-3.76,8.94,-5.08,13.64 C18.67,41,17.35,46.55,16.5,52.2c-0.75,4.89,-1.41,10.25,-0.09,15.14c1.03,3.86,3.29,9.22,5.74,12.32 c2.73,3.39,6.58,7.34,10.72,8.84c0.75,0.28,1.6,0.47,2.45,0.66c1.6,0.28,3.29,0.47,4.89,0.19c0.94,-0.19,1.98,-0.28,2.92,-0.56 c1.88,-0.47,3.67,-1.13,5.46,-1.79c7.52,-3.01,13.64,-7.43,17.68,-14.58c1.69,-3.1,3.1,-6.4,4.42,-9.69c0.09,-0.19,0.19,-0.38,0.19,-0.56 c1.98,-5.46,3.29,-11.19,4.61,-16.84c0.66,-2.73,1.41,-5.55,1.79,-8.37C77.55,35.92,77.92,34.7,77.64,33.57z"/>
<!-- Dark eye band -->
<path
android:fillColor="#193D51"
android:pathData="M23.09,40.53c1.69,-3.1,5.74,-5.55,9.31,-5.08c0.56,0.09,1.22,0.19,1.79,0.47 c3.57,1.5,5.74,4.99,4.89,8.56c-0.19,0.75,-0.66,0.85,-1.22,0.38c-1.98,-1.69,-3.57,-3.01,-6.21,-3.67c-2.16,-0.56,-4.61,-0.28,-6.68,0.28 c-0.47,0.09,-1.22,0.56,-1.69,0.38C22.61,41.57,22.9,40.91,23.09,40.53z"/>
<!-- Dark mouth/chin -->
<path
android:fillColor="#193D51"
android:pathData="M62.21,64.9c-1.03,1.6,-2.45,3.01,-3.86,4.33c-0.38,0.28,-0.66,0.66,-1.03,0.94 c-5.64,4.7,-13.26,7.05,-20.51,5.27c-1.98,-0.47,-4.14,-1.5,-5.74,-2.73c-1.22,-0.94,-2.45,-2.16,-3.48,-3.39c-1.88,-2.26,-3.29,-4.89,-4.23,-7.62 c-0.47,-1.41,-0.75,-2.73,-0.94,-4.23c0,-0.47,-0.66,-5.46,0.85,-4.8c0.38,0.19,0.66,0.47,0.94,0.75c0.28,0.38,0.47,0.75,0.75,1.03 c0.66,0.85,1.32,1.69,2.07,2.45c2.35,2.73,5.27,4.89,8.56,6.4c2.26,1.03,4.7,1.6,7.15,1.79c1.41,0.09,2.73,0.19,4.14,0.09 c5.08,-0.28,10.25,-1.79,14.86,-3.76c0.38,-0.19,0.85,-0.47,1.32,-0.47C64.66,61.04,62.5,64.52,62.21,64.9z"/>
<!-- Dark eye detail -->
<path
android:fillColor="#193D51"
android:pathData="M67.58,51.16c0,0.47,-0.19,1.13,-0.75,1.03c-0.47,-0.09,-0.85,-0.94,-1.13,-1.22 c-1.32,-1.69,-3.86,-3.57,-6.4,-4.14c-3.01,-0.75,-5.27,0.56,-8.28,0.85c-0.85,0.09,-1.32,-0.28,-0.94,-1.03c1.6,-3.48,5.83,-6.21,10.25,-5.46 c0.75,0.09,1.41,0.28,2.07,0.56C66.26,43.36,67.86,47.59,67.58,51.16z"/>
<!-- Gold eye detail -->
<path
android:fillColor="#9B7515"
android:pathData="M91.84,63.86c4.23,2.73,9.69,3.48,14.58,3.2c1.41,-0.09,2.26,0.09,1.88,1.69 c-0.75,3.29,-3.86,5.17,-6.87,5.83c-0.75,0.19,-1.5,0.19,-2.26,0.19c-1.41,-0.09,-2.82,-0.66,-4.04,-1.5c-2.63,-1.79,-4.61,-4.89,-5.17,-8 C89.68,63.67,90.25,62.83,91.84,63.86z"/>
<!-- Gold mouth detail -->
<path
android:fillColor="#9B7515"
android:pathData="M65.22,80.79C64,79.57,64.66,79,65.98,78.25c4.51,-2.35,9.03,-5.93,11.38,-10.63 c0.85,-1.79,1.79,-1.41,2.45,0.28c1.13,3.1,1.03,6.87,-0.38,9.88c-0.66,1.41,-1.6,2.63,-2.82,3.57c-0.66,0.47,-1.32,0.75,-2.07,1.03 C71.43,83.33,67.58,83.24,65.22,80.79z"/>
<!-- Gold chin/jaw detail -->
<path
android:fillColor="#9B7515"
android:pathData="M110,96.41c-0.38,0,-0.94,-0.38,-1.41,-0.66c-0.47,-0.28,-0.94,-0.66,-1.22,-0.85 c-1.13,-0.56,-2.45,-1.13,-3.67,-1.5c-3.76,-1.22,-7.9,-1.22,-11.57,0c-2.63,0.85,-5.17,2.45,-7.24,4.33c-2.26,2.16,-3.95,4.8,-6.11,7.05 c-0.28,0.28,-0.56,0.56,-0.85,0.75c-0.56,0.28,-1.13,-0.09,-1.32,-0.66c-0.94,-3.95,1.69,-9.5,3.67,-12.89c2.26,-3.76,5.55,-6.77,9.78,-8 c2.07,-0.66,4.33,-0.66,6.49,-0.38c6.3,0.94,12.79,5.93,14.02,11.66C110.56,95.75,110.47,96.5,110,96.41z"/>
</group>
</vector>
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillColor="#2b0037"
android:pathData="M0,0h108v108h-108z" />
</vector>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

@@ -1,83 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="240dp"
android:height="240dp"
android:viewportWidth="1200"
android:viewportHeight="1200">
<!--
Android 12 splash screen masks the icon to a circle at 2/3 of canvas (160dp of 240dp).
The Shakespeare logo SVG has viewBox="0 0 128 128".
We scale the 128x128 logo to fit ~800x800 in the center of 1200x1200,
leaving ~200px padding on each side for the circular safe zone.
Scale factor: 800/128 = 6.25. Translate: (200, 200) to shift origin.
-->
<group
android:translateX="200"
android:translateY="200"
android:scaleX="6.25"
android:scaleY="6.25">
<!-- Red beak right -->
<path
android:fillColor="#F45125"
android:pathData="M110.28,61.32l2.63,8.84c0,0,7.24,-1.6,7.62,3.2c0.38,4.8,-6.77,8,-6.77,8l2.26,10.63 c0,0,7.9,-6.4,8,-15.61c0,0,0.66,-11.29,-6.11,-13.92C113.67,60.85,110.28,61.32,110.28,61.32z"/>
<!-- Red tail feathers -->
<path
android:fillColor="#F45125"
android:pathData="M68.71,94.99c0,0,-11.1,-4.7,-16.46,1.98c-0.75,0.94,-1.41,1.88,-2.16,2.82 c-0.56,0.75,-1.13,1.5,-1.69,2.16c-0.47,0.56,-1.03,1.13,-1.69,1.5c-0.66,0.38,-1.32,0.66,-2.07,0.85c-0.94,0.19,-1.88,0.19,-2.82,0.09 c-1.32,-0.09,-2.63,-0.38,-3.95,-0.66c-0.47,-0.09,-0.85,-0.19,-1.22,-0.28c-0.09,0,-0.19,-0.09,-0.28,-0.09 s-0.19,-0.09,-0.28,-0.09c-0.38,0.09,0.19,0.75,0.38,0.94c0.28,0.28,0.56,0.66,0.85,0.94c0.85,0.75,1.69,1.5,2.73,1.98 c1.32,0.66,2.73,1.03,4.14,1.13c0.09,0,0.38,0,0.47,0.09c0.19,0.19,-0.28,0.47,-0.47,0.56c-0.28,0.19,-0.47,0.28,-0.75,0.38 c-0.85,0.38,-1.79,0.56,-2.63,0.75c-0.85,0.19,-1.69,0.28,-2.45,0.28c-0.47,0,-0.85,0.09,-1.22,0.09c-0.28,0,-0.56,-0.09,-0.85,0 s0.09,0.47,0.28,0.56c0.38,0.19,0.75,0.47,1.13,0.66c1.13,0.56,2.26,1.03,3.39,1.32c1.5,0.38,3.1,0.56,4.61,0.38 c1.32,-0.19,2.63,-0.56,3.86,-1.03c6.77,-3.1,6.21,-9.59,12.42,-10.16c4.61,-0.38,11.1,2.07,11.1,2.07L68.71,94.99z"/>
<!-- Red beak left -->
<path
android:fillColor="#F45125"
android:pathData="M19.79,38.28c0,0,-12.13,1.98,-15.24,12.79C0.61,64.9,20.26,69.5,20.26,69.5l1.22,-9.41 c0,0,-13.07,-1.32,-12.32,-6.3c0.94,-6.21,11.85,-5.64,11.85,-5.64L19.79,38.28z"/>
<!-- Red wing detail -->
<path
android:fillColor="#F45125"
android:pathData="M20.73,70.92c0,0,-1.88,0.56,-4.61,2.54c-1.88,1.32,-4.42,3.01,-6.87,5.93 c-1.22,1.41,-2.16,3.1,-2.82,4.89c-0.47,1.22,-0.66,2.45,-0.66,3.76c0,0.28,0,0.56,0,0.85c0,0.09,0,0.85,0.28,0.66 c0.09,-0.09,0.19,-0.38,0.28,-0.47c0.19,-0.47,0.47,-0.85,0.75,-1.22c0.85,-1.13,1.88,-2.16,3.01,-3.01c0.38,-0.28,0.75,-0.47,1.13,-0.66 c0.28,-0.28,0.75,-0.66,0.94,-0.28c0.09,0.19,-0.09,0.47,-0.19,0.66c-0.09,0.28,-0.19,0.66,-0.19,0.94c-0.38,1.5,-0.56,3.01,-0.75,4.51 c-0.09,0.85,-0.09,1.69,0,2.45c0,0.38,0.09,0.85,0.09,1.22c0,0.19,0.09,0.38,0.09,0.56c0,0.19,0.19,0.47,0.38,0.19 c0.09,-0.09,0.09,-0.19,0.19,-0.38c0.19,-0.28,0.28,-0.66,0.47,-0.94c0.47,-0.85,0.94,-1.69,1.5,-2.63c0.66,-1.13,1.41,-2.16,2.16,-3.1 c0.85,-1.13,1.88,-2.26,2.92,-3.2c1.13,-1.03,2.35,-2.07,3.67,-2.92c0.75,-0.47,1.6,-0.94,2.45,-1.32L20.73,70.92z"/>
<!-- Yellow body -->
<path
android:fillColor="#FCC21B"
android:pathData="M116.4,79.29c-1.13,-5.55,-2.73,-11.01,-4.51,-16.46c-1.5,-4.61,-3.1,-9.31,-5.83,-13.36 c-1.22,-1.79,-3.01,-3.01,-5.27,-3.86c-4.33,-1.69,-9.97,-1.98,-13.73,-1.98c-5.64,0,-11.48,1.22,-16.74,3.67 c-1.88,5.64,-7.05,19.94,-14.86,26.34c0.47,2.63,1.03,5.36,1.79,8c1.32,4.61,3.01,9.22,4.61,13.83c1.5,4.42,3.29,8.84,6.58,12.23 c0.85,0.94,1.88,1.69,2.82,2.45c2.26,1.88,4.99,3.01,7.71,3.95c2.54,0.85,5.17,1.5,7.81,2.07c4.7,1.03,11.48,2.82,16.08,0.66 c2.54,-1.13,4.61,-2.92,6.3,-5.08c1.79,-2.26,3.2,-4.8,4.42,-7.43c1.88,-3.95,3.86,-8.37,4.14,-12.89 C117.99,87.38,117.24,83.24,116.4,79.29z"/>
<!-- Blue head -->
<path
android:fillColor="#429ADF"
android:pathData="M77.64,33.57c-0.28,-1.03,-1.03,-2.07,-1.6,-3.01c-6.3,-11.01,-20.04,-16.27,-32.26,-15.52 c-3.76,0.28,-9.31,0.85,-13.54,2.73c-2.07,0.94,-3.86,2.35,-4.99,4.14c-2.54,4.23,-3.76,8.94,-5.08,13.64 C18.67,41,17.35,46.55,16.5,52.2c-0.75,4.89,-1.41,10.25,-0.09,15.14c1.03,3.86,3.29,9.22,5.74,12.32 c2.73,3.39,6.58,7.34,10.72,8.84c0.75,0.28,1.6,0.47,2.45,0.66c1.6,0.28,3.29,0.47,4.89,0.19c0.94,-0.19,1.98,-0.28,2.92,-0.56 c1.88,-0.47,3.67,-1.13,5.46,-1.79c7.52,-3.01,13.64,-7.43,17.68,-14.58c1.69,-3.1,3.1,-6.4,4.42,-9.69c0.09,-0.19,0.19,-0.38,0.19,-0.56 c1.98,-5.46,3.29,-11.19,4.61,-16.84c0.66,-2.73,1.41,-5.55,1.79,-8.37C77.55,35.92,77.92,34.7,77.64,33.57z"/>
<!-- Dark eye band -->
<path
android:fillColor="#193D51"
android:pathData="M23.09,40.53c1.69,-3.1,5.74,-5.55,9.31,-5.08c0.56,0.09,1.22,0.19,1.79,0.47 c3.57,1.5,5.74,4.99,4.89,8.56c-0.19,0.75,-0.66,0.85,-1.22,0.38c-1.98,-1.69,-3.57,-3.01,-6.21,-3.67c-2.16,-0.56,-4.61,-0.28,-6.68,0.28 c-0.47,0.09,-1.22,0.56,-1.69,0.38C22.61,41.57,22.9,40.91,23.09,40.53z"/>
<!-- Dark mouth/chin -->
<path
android:fillColor="#193D51"
android:pathData="M62.21,64.9c-1.03,1.6,-2.45,3.01,-3.86,4.33c-0.38,0.28,-0.66,0.66,-1.03,0.94 c-5.64,4.7,-13.26,7.05,-20.51,5.27c-1.98,-0.47,-4.14,-1.5,-5.74,-2.73c-1.22,-0.94,-2.45,-2.16,-3.48,-3.39c-1.88,-2.26,-3.29,-4.89,-4.23,-7.62 c-0.47,-1.41,-0.75,-2.73,-0.94,-4.23c0,-0.47,-0.66,-5.46,0.85,-4.8c0.38,0.19,0.66,0.47,0.94,0.75c0.28,0.38,0.47,0.75,0.75,1.03 c0.66,0.85,1.32,1.69,2.07,2.45c2.35,2.73,5.27,4.89,8.56,6.4c2.26,1.03,4.7,1.6,7.15,1.79c1.41,0.09,2.73,0.19,4.14,0.09 c5.08,-0.28,10.25,-1.79,14.86,-3.76c0.38,-0.19,0.85,-0.47,1.32,-0.47C64.66,61.04,62.5,64.52,62.21,64.9z"/>
<!-- Dark eye detail -->
<path
android:fillColor="#193D51"
android:pathData="M67.58,51.16c0,0.47,-0.19,1.13,-0.75,1.03c-0.47,-0.09,-0.85,-0.94,-1.13,-1.22 c-1.32,-1.69,-3.86,-3.57,-6.4,-4.14c-3.01,-0.75,-5.27,0.56,-8.28,0.85c-0.85,0.09,-1.32,-0.28,-0.94,-1.03c1.6,-3.48,5.83,-6.21,10.25,-5.46 c0.75,0.09,1.41,0.28,2.07,0.56C66.26,43.36,67.86,47.59,67.58,51.16z"/>
<!-- Gold eye detail -->
<path
android:fillColor="#9B7515"
android:pathData="M91.84,63.86c4.23,2.73,9.69,3.48,14.58,3.2c1.41,-0.09,2.26,0.09,1.88,1.69 c-0.75,3.29,-3.86,5.17,-6.87,5.83c-0.75,0.19,-1.5,0.19,-2.26,0.19c-1.41,-0.09,-2.82,-0.66,-4.04,-1.5c-2.63,-1.79,-4.61,-4.89,-5.17,-8 C89.68,63.67,90.25,62.83,91.84,63.86z"/>
<!-- Gold mouth detail -->
<path
android:fillColor="#9B7515"
android:pathData="M65.22,80.79C64,79.57,64.66,79,65.98,78.25c4.51,-2.35,9.03,-5.93,11.38,-10.63 c0.85,-1.79,1.79,-1.41,2.45,0.28c1.13,3.1,1.03,6.87,-0.38,9.88c-0.66,1.41,-1.6,2.63,-2.82,3.57c-0.66,0.47,-1.32,0.75,-2.07,1.03 C71.43,83.33,67.58,83.24,65.22,80.79z"/>
<!-- Gold chin/jaw detail -->
<path
android:fillColor="#9B7515"
android:pathData="M110,96.41c-0.38,0,-0.94,-0.38,-1.41,-0.66c-0.47,-0.28,-0.94,-0.66,-1.22,-0.85 c-1.13,-0.56,-2.45,-1.13,-3.67,-1.5c-3.76,-1.22,-7.9,-1.22,-11.57,0c-2.63,0.85,-5.17,2.45,-7.24,4.33c-2.26,2.16,-3.95,4.8,-6.11,7.05 c-0.28,0.28,-0.56,0.56,-0.85,0.75c-0.56,0.28,-1.13,-0.09,-1.32,-0.66c-0.94,-3.95,1.69,-9.5,3.67,-12.89c2.26,-3.76,5.55,-6.77,9.78,-8 c2.07,-0.66,4.33,-0.66,6.49,-0.38c6.3,0.94,12.79,5.93,14.02,11.66C110.56,95.75,110.47,96.5,110,96.41z"/>
</group>
</vector>
@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<WebView
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#2b0037</color>
</resources>
@@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="app_name">Shakespeare</string>
<string name="title_activity_main">Shakespeare</string>
<string name="package_name">diy.shakespeare.app</string>
<string name="custom_url_scheme">diy.shakespeare.app</string>
</resources>
@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:background">@null</item>
</style>
<style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">#2b0037</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_icon_vector</item>
<item name="postSplashScreenTheme">@style/AppTheme.NoActionBar</item>
</style>
</resources>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="my_images" path="." />
<cache-path name="my_cache_images" path="." />
</paths>
@@ -1,18 +0,0 @@
package com.getcapacitor.myapp;
import static org.junit.Assert.*;
import org.junit.Test;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
-29
View File
@@ -1,29 +0,0 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.13.0'
classpath 'com.google.gms:google-services:4.4.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
apply from: "variables.gradle"
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
-9
View File
@@ -1,9 +0,0 @@
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
include ':capacitor-android'
project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
include ':capacitor-app'
project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android')
include ':capacitor-status-bar'
project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android')
-22
View File
@@ -1,22 +0,0 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
Binary file not shown.
-7
View File
@@ -1,7 +0,0 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-251
View File
@@ -1,251 +0,0 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH="\\\"\\\""
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
-94
View File
@@ -1,94 +0,0 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
set CLASSPATH=
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
-5
View File
@@ -1,5 +0,0 @@
include ':app'
include ':capacitor-cordova-android-plugins'
project(':capacitor-cordova-android-plugins').projectDir = new File('./capacitor-cordova-android-plugins/')
apply from: 'capacitor.settings.gradle'
-16
View File
@@ -1,16 +0,0 @@
ext {
minSdkVersion = 24
compileSdkVersion = 36
targetSdkVersion = 36
androidxActivityVersion = '1.11.0'
androidxAppCompatVersion = '1.7.1'
androidxCoordinatorLayoutVersion = '1.3.0'
androidxCoreVersion = '1.17.0'
androidxFragmentVersion = '1.8.9'
coreSplashScreenVersion = '1.2.0'
androidxWebkitVersion = '1.14.0'
junitVersion = '4.13.2'
androidxJunitVersion = '1.3.0'
androidxEspressoCoreVersion = '3.7.0'
cordovaAndroidVersion = '14.0.1'
}
-25
View File
@@ -1,25 +0,0 @@
import type { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
appId: 'diy.shakespeare.app',
appName: 'Shakespeare',
webDir: 'dist',
server: {
// Handle deep links from your domain
hostname: 'shakespeare.diy',
androidScheme: 'https',
iosScheme: 'https'
},
android: {
// Enable safe area handling for notches and navigation bars
allowMixedContent: false,
backgroundColor: '#2b0037'
},
ios: {
backgroundColor: '#2b0037',
contentInset: 'automatic',
scheme: 'Shakespeare'
}
};
export default config;
-584
View File
@@ -1,584 +0,0 @@
# Unified OAuth System
Shakespeare implements a unified OAuth 2.0 authentication system that supports multiple providers with a consistent API. This document explains how the system works and how to add new OAuth providers.
## Architecture
The OAuth system consists of three main components:
1. **Generic OAuth Hook** (`useOAuth`) - Core OAuth logic that works with any provider
2. **Provider-Specific Hooks** - Thin wrappers that configure the generic hook for specific providers
3. **OAuth Callback Pages** - React components that handle the OAuth redirect flow
### Current Supported Providers
- **GitHub** - Git repository hosting (with PKCE support)
- **Netlify** - Static site deployment
- **Vercel** - Static site deployment
- **OpenRouter** - AI model routing (with PKCE support)
## File Structure
```
src/
├── hooks/
│ ├── useOAuth.ts # Generic OAuth hook (core logic)
│ ├── useGitHubOAuth.ts # GitHub-specific configuration
│ ├── useNetlifyOAuth.ts # Netlify-specific configuration
│ ├── useVercelOAuth.ts # Vercel-specific configuration
│ └── useOpenRouterOAuth.ts # OpenRouter-specific configuration
├── pages/
│ ├── GitHubOAuth.tsx # GitHub OAuth callback page
│ ├── NetlifyOAuth.tsx # Netlify OAuth callback page
│ ├── VercelOAuth.tsx # Vercel OAuth callback page
│ └── OpenRouterOAuth.tsx # OpenRouter OAuth callback page
└── AppRouter.tsx # Routes for OAuth callbacks
```
## Environment Variables
OAuth credentials are stored in environment variables and loaded from `process.env`:
```bash
# GitHub OAuth Configuration
VITE_GITHUB_OAUTH_CLIENT_ID="your_github_client_id"
VITE_GITHUB_OAUTH_CLIENT_SECRET="your_github_client_secret"
# Netlify OAuth Configuration
VITE_NETLIFY_OAUTH_CLIENT_ID="your_netlify_client_id"
VITE_NETLIFY_OAUTH_CLIENT_SECRET="your_netlify_client_secret"
# Vercel OAuth Configuration
VITE_VERCEL_OAUTH_CLIENT_ID="your_vercel_client_id"
VITE_VERCEL_OAUTH_CLIENT_SECRET="your_vercel_client_secret"
```
### Security Note
**Client secrets are stored in environment variables** and bundled into the client-side JavaScript. This is necessary because the OAuth flow runs entirely in the browser. While this approach is less secure than a traditional server-side OAuth flow, it's acceptable for this use case because:
1. Shakespeare is a client-side application with no backend
2. The OAuth tokens are scoped to specific permissions
3. Users can revoke tokens at any time from the provider's settings
4. The redirect URIs are validated by the OAuth provider
For production deployments, consider using a serverless function or backend service to handle the token exchange step, keeping client secrets secure.
## How It Works
### 1. Generic OAuth Hook (`useOAuth`)
The `useOAuth` hook implements the OAuth 2.0 authorization code flow with optional PKCE (Proof Key for Code Exchange) support. It accepts a configuration object and returns methods to initiate and handle the OAuth flow.
**Configuration Interface:**
```typescript
interface OAuthConfig {
provider: 'github' | 'netlify' | 'vercel'; // Provider identifier
clientId: string; // OAuth client ID
clientSecret: string; // OAuth client secret
authorizeUrl: string; // Provider's authorization endpoint
tokenUrl: string; // Provider's token exchange endpoint
scope?: string; // Requested OAuth scopes (optional)
redirectUri: string; // Callback URL after authorization
usePKCE?: boolean; // Enable PKCE (default: false)
getUserInfo?: ( // Optional function to fetch user info
accessToken: string,
corsProxy: string
) => Promise<{
username: string;
[key: string]: unknown;
}>;
}
```
**Returned API:**
```typescript
{
isLoading: boolean; // True during token exchange
error: string | null; // Error message if OAuth fails
isOAuthConfigured: boolean; // True if client ID and secret are set
initiateOAuth: () => void; // Start the OAuth flow
handleCallback: ( // Handle the OAuth callback
code: string,
state: string
) => Promise<OAuthResult | null>;
}
```
### 2. OAuth Flow Steps
#### Step 1: Initiate OAuth
When the user clicks "Connect to [Provider]", the `initiateOAuth()` function:
1. Generates a random `state` parameter for CSRF protection
2. Optionally generates PKCE parameters (code verifier and challenge)
3. Stores the state and code verifier in localStorage
4. Redirects to the provider's authorization page
```typescript
const { initiateOAuth } = useGitHubOAuth();
// User clicks button
<Button onClick={initiateOAuth}>Connect to GitHub</Button>
```
#### Step 2: User Authorizes
The user is redirected to the provider's authorization page where they:
1. Log in to their account (if not already logged in)
2. Review the requested permissions
3. Approve or deny the authorization request
#### Step 3: OAuth Callback
After authorization, the provider redirects back to the callback URL with:
- `code` - Authorization code
- `state` - The state parameter we sent
- `error` (optional) - Error code if authorization failed
- `error_description` (optional) - Human-readable error description
The callback page (e.g., `GitHubOAuth.tsx`) extracts these parameters and calls `handleCallback()`.
#### Step 4: Token Exchange
The `handleCallback()` function:
1. Verifies the `state` parameter matches what we stored
2. Retrieves the PKCE code verifier (if PKCE is enabled)
3. Exchanges the authorization code for an access token
4. Optionally fetches user information using the access token
5. Returns an `OAuthResult` object with the token and user data
```typescript
interface OAuthResult {
accessToken: string; // OAuth access token
username?: string; // User's username/email
scopes?: string[]; // Granted OAuth scopes
userData?: Record<string, unknown>; // Additional user data
}
```
#### Step 5: Store Credentials
Provider-specific hooks override `handleCallback` to store the credentials appropriately:
- **GitHub**: Stores in Git settings (for push/pull operations)
- **Netlify/Vercel**: Stores in Deploy settings (for deployment operations)
### 3. PKCE Support
PKCE (Proof Key for Code Exchange) adds an extra layer of security to the OAuth flow by preventing authorization code interception attacks. It's recommended for public clients like browser-based apps.
**How PKCE works:**
1. Generate a random `code_verifier` (cryptographically random string)
2. Create a `code_challenge` by hashing the verifier with SHA-256
3. Send the `code_challenge` during authorization
4. Send the `code_verifier` during token exchange
5. The server verifies that the verifier matches the challenge
**Enabling PKCE:**
```typescript
const config: OAuthConfig = {
// ... other config
usePKCE: true, // Enable PKCE
};
```
**Provider Support:**
- ✅ GitHub - Supports PKCE (enabled)
- ❌ Netlify - Doesn't support PKCE (disabled)
- ❌ Vercel - Doesn't support PKCE (disabled)
- ✅ OpenRouter - Requires PKCE (enabled)
### Scope Parameter
The `scope` parameter is optional in the OAuth configuration. Some providers (like Netlify) don't use scopes in the authorization request - instead, permissions are configured when you create the OAuth application in the provider's settings.
**Provider Scope Usage:**
- ✅ GitHub - Uses scopes (e.g., `repo workflow`)
- ❌ Netlify - No scope parameter (permissions set in app settings)
- ✅ Vercel - Uses scopes (e.g., `deployments:write projects:read`)
- ❌ OpenRouter - No scope parameter (uses PKCE for authorization)
### OpenRouter Custom OAuth Implementation
OpenRouter uses a custom OAuth flow that differs from the standard OAuth 2.0 specification. Instead of using the generic `useOAuth` hook, it has a dedicated `useOpenRouterOAuth` hook with the following key differences:
1. **No Client Credentials**: OpenRouter doesn't require client ID or client secret - it uses PKCE only
2. **Authorization URL**: Uses `callback_url` parameter instead of `redirect_uri`
3. **Token Exchange**: Posts to `/api/v1/auth/keys` with a simplified request body
4. **Response Format**: Returns `{ key }` instead of standard `{ access_token }`
5. **PKCE Required**: Must use PKCE with S256 code challenge method
6. **No User Info**: Doesn't provide a user info endpoint after authentication
7. **No Environment Variables**: No configuration needed - works out of the box
**Authorization URL Format:**
```
https://openrouter.ai/auth?callback_url=<REDIRECT_URI>&code_challenge=<CHALLENGE>&code_challenge_method=S256
```
**Token Exchange Request:**
```json
{
"code": "<CODE_FROM_QUERY_PARAM>",
"code_verifier": "<CODE_VERIFIER>",
"code_challenge_method": "S256"
}
```
**Token Exchange Response:**
```json
{
"key": "sk-or-v1-..."
}
```
This custom implementation is fully contained in `useOpenRouterOAuth.ts` and doesn't rely on the generic OAuth hook. Unlike other providers, OpenRouter's OAuth doesn't require any environment variables or application registration - it works immediately without configuration.
## Adding a New OAuth Provider
To add a new OAuth provider, follow these steps:
### 1. Add Environment Variables
Add the client ID and secret to `.env.example`:
```bash
# NewProvider OAuth Configuration
VITE_NEWPROVIDER_OAUTH_CLIENT_ID="********************"
VITE_NEWPROVIDER_OAUTH_CLIENT_SECRET="****************************************"
```
### 2. Create Provider-Specific Hook
Create a new file `src/hooks/useNewProviderOAuth.ts`:
```typescript
import { useCallback } from 'react';
import { useOAuth, type OAuthConfig, type OAuthResult } from './useOAuth';
import { proxyUrl } from '@/lib/proxyUrl';
interface NewProviderUserInfo {
id: string;
email: string;
// ... other user fields
}
export function useNewProviderOAuth() {
// Get the context where you want to store credentials
// e.g., useDeploySettings() or useGitSettings()
const { setProviders, settings } = useDeploySettings();
const config: OAuthConfig = {
provider: 'newprovider',
clientId: import.meta.env.VITE_NEWPROVIDER_OAUTH_CLIENT_ID || '',
clientSecret: import.meta.env.VITE_NEWPROVIDER_OAUTH_CLIENT_SECRET || '',
authorizeUrl: 'https://provider.com/oauth/authorize',
tokenUrl: 'https://provider.com/oauth/token',
scope: 'read write', // Optional - omit if provider doesn't use scopes
redirectUri: window.location.origin + '/oauth/newprovider',
usePKCE: false, // Set to true if provider supports PKCE
getUserInfo: async (accessToken: string, corsProxy: string) => {
const userUrl = proxyUrl({ template: corsProxy, url: 'https://api.provider.com/user' });
const userResponse = await fetch(userUrl, {
headers: {
'Authorization': `Bearer ${accessToken}`,
},
});
if (!userResponse.ok) {
throw new Error(`Failed to verify token: ${userResponse.statusText}`);
}
const userData: NewProviderUserInfo = await userResponse.json();
return {
username: userData.email,
...userData,
};
},
};
const oauth = useOAuth(config);
const handleCallbackAndStore = useCallback(async (
code: string,
state: string
): Promise<boolean> => {
const result: OAuthResult | null = await oauth.handleCallback(code, state);
if (!result) {
return false;
}
// Store the credentials in the appropriate context
// This will vary based on what the provider is used for
const newProvider = {
id: crypto.randomUUID(),
name: result.username ? `NewProvider (${result.username})` : 'NewProvider',
type: 'newprovider',
apiKey: result.accessToken,
proxy: true,
};
setProviders([...settings.providers, newProvider]);
return true;
}, [oauth, setProviders, settings.providers]);
return {
...oauth,
handleCallback: handleCallbackAndStore,
};
}
```
### 3. Create OAuth Callback Page
Create a new file `src/pages/NewProviderOAuth.tsx`:
```typescript
import { useEffect } from 'react';
import { useSearchParams, useNavigate } from 'react-router-dom';
import { useNewProviderOAuth } from '@/hooks/useNewProviderOAuth';
import { useToast } from '@/hooks/useToast';
import { Card, CardContent } from '@/components/ui/card';
export default function NewProviderOAuth() {
const [searchParams] = useSearchParams();
const navigate = useNavigate();
const { handleCallback } = useNewProviderOAuth();
const { toast } = useToast();
useEffect(() => {
const code = searchParams.get('code');
const state = searchParams.get('state');
const error = searchParams.get('error');
const errorDescription = searchParams.get('error_description');
const storedState = localStorage.getItem('newprovider_oauth_state');
if (error) {
toast({
title: "NewProvider OAuth Error",
description: errorDescription || error,
variant: "destructive",
});
navigate('/settings/deploy'); // or appropriate settings page
return;
}
if (code && state && storedState) {
handleCallback(code, state).then((success) => {
if (success) {
toast({
title: "NewProvider Connected",
description: "Successfully connected to NewProvider.",
});
} else {
toast({
title: "Connection Failed",
description: "Failed to connect to NewProvider. Please try again.",
variant: "destructive",
});
}
navigate('/settings/deploy'); // or appropriate settings page
});
} else {
navigate('/settings/deploy');
}
}, [searchParams, handleCallback, toast, navigate]);
return (
<div className="min-h-screen flex items-center justify-center p-4">
<Card className="w-full max-w-md">
<CardContent className="py-12 px-8 text-center">
<div className="space-y-6">
{/* Provider logo/icon */}
<div className="flex justify-center">
<svg className="h-12 w-12 text-primary" viewBox="0 0 24 24">
{/* Provider icon SVG */}
</svg>
</div>
<div className="space-y-2">
<h1 className="text-xl font-semibold">Connecting to NewProvider</h1>
<p className="text-muted-foreground">
Processing your NewProvider authentication...
</p>
</div>
<div className="flex justify-center">
<div className="animate-spin rounded-full h-6 w-6 border-b-2 border-primary"></div>
</div>
</div>
</CardContent>
</Card>
</div>
);
}
```
### 4. Add Route
Add the OAuth callback route to `src/AppRouter.tsx`:
```typescript
import NewProviderOAuth from "./pages/NewProviderOAuth";
// ...
<Route path="/oauth/newprovider" element={<NewProviderOAuth />} />
```
### 5. Add to UI
Add the provider to the appropriate settings page (e.g., `DeploySettings.tsx`):
```typescript
import { useNewProviderOAuth } from '@/hooks/useNewProviderOAuth';
// In component:
const newProviderOAuth = useNewProviderOAuth();
// In PRESET_PROVIDERS array:
{
id: 'newprovider',
type: 'newprovider',
name: 'NewProvider',
description: 'Deploy to NewProvider',
apiKeyLabel: 'Access Token',
apiKeyURL: 'https://provider.com/settings/tokens',
proxy: true,
}
// In the render logic, add the OAuth hook to the switch:
const oauthHook = preset.type === 'netlify' ? netlifyOAuth :
preset.type === 'vercel' ? vercelOAuth :
preset.type === 'newprovider' ? newProviderOAuth : null;
```
### 6. Register OAuth Application
Register your OAuth application with the provider:
1. Go to the provider's developer settings
2. Create a new OAuth application
3. Set the **redirect URI** to: `https://yourdomain.com/oauth/newprovider`
4. Note the **client ID** and **client secret**
5. Add them to your `.env` file
## Testing OAuth Flow
To test the OAuth flow locally:
1. **Set up a tunnel** (e.g., ngrok, cloudflared) to expose localhost:
```bash
npx cloudflared tunnel --url http://localhost:5173
```
2. **Register OAuth app** with the tunnel URL as the redirect URI:
```
https://your-tunnel-url.trycloudflare.com/oauth/provider
```
3. **Add credentials** to `.env`:
```bash
VITE_PROVIDER_OAUTH_CLIENT_ID="your_client_id"
VITE_PROVIDER_OAUTH_CLIENT_SECRET="your_client_secret"
```
4. **Start the dev server**:
```bash
npm run dev
```
5. **Test the flow** by clicking the "Connect to Provider" button
## Error Handling
The OAuth system handles several types of errors:
### User Denies Authorization
If the user denies authorization, the provider redirects with an `error` parameter:
```
/oauth/provider?error=access_denied&error_description=User+denied+access
```
The callback page displays an error toast and redirects to settings.
### Invalid State Parameter
If the `state` parameter doesn't match what we stored (CSRF attack), the flow is aborted and an error is shown.
### Token Exchange Failure
If the token exchange fails (invalid code, expired, etc.), an error is logged and shown to the user.
### Missing PKCE Verifier
If PKCE is enabled but the code verifier is missing from localStorage, the flow is aborted.
## Security Considerations
1. **State Parameter**: Always used for CSRF protection
2. **PKCE**: Used when supported by the provider for additional security
3. **HTTPS Only**: OAuth should only be used over HTTPS in production
4. **Token Storage**: Tokens are stored in browser storage (localStorage/IndexedDB)
5. **Token Revocation**: Users can revoke tokens from the provider's settings
6. **Scope Limitation**: Request only the minimum required scopes
## Troubleshooting
### "OAuth client ID not configured"
The environment variables are not set. Check your `.env` file and ensure the variables are prefixed with `VITE_`.
### "Invalid OAuth state parameter"
The state parameter doesn't match. This could be caused by:
- Multiple OAuth flows running simultaneously
- Browser localStorage being cleared mid-flow
- CSRF attack attempt
### "Failed to verify token"
The provider's API rejected the access token. This could be caused by:
- Incorrect API endpoint URL
- Token doesn't have required scopes
- Provider API is down
### Redirect URI Mismatch
The redirect URI in your OAuth app registration must exactly match the URI in your code:
```typescript
redirectUri: window.location.origin + '/oauth/provider'
```
For local development with a tunnel, this would be:
```
https://your-tunnel-url.trycloudflare.com/oauth/provider
```
## Best Practices
1. **Always use PKCE** when the provider supports it
2. **Request minimal scopes** - only what you need
3. **Handle errors gracefully** - show user-friendly error messages
4. **Clear localStorage** on errors to prevent stuck states
5. **Validate tokens** by fetching user info after exchange
6. **Store tokens securely** - use appropriate browser storage APIs
7. **Provide token revocation** - link to provider's token management page
8. **Test error cases** - user denial, network failures, etc.
## Future Improvements
Potential enhancements to the OAuth system:
1. **Token Refresh**: Implement refresh token flow for long-lived sessions
2. **Token Expiry**: Track token expiration and prompt for re-authentication
3. **Multiple Accounts**: Support multiple accounts per provider
4. **Backend Proxy**: Optional backend service for secure token exchange
5. **Device Flow**: Support OAuth device flow for CLI tools
6. **Biometric Auth**: Integrate with WebAuthn for passwordless OAuth
-274
View File
@@ -1,274 +0,0 @@
# Shakespeare Plugins System
Shakespeare now includes a comprehensive plugins system that allows you to extend the AI's capabilities with reusable skills.
## Overview
Plugins are Git repositories that can contain **skills** - specialized AI workflows that help the AI assistant perform specific tasks more effectively. Skills are automatically discovered and made available to the AI through the `skill` tool.
## Features
- **Git-based plugins**: Clone plugins from any Git repository (GitHub, GitLab, etc.)
- **Automatic skill discovery**: Skills are automatically found and registered from all installed plugins
- **Configurable storage**: Plugin directory is configurable in System Settings
- **Sync support**: Pull latest changes from plugin repositories
- **Delete support**: Remove plugins when no longer needed
- **AI integration**: Skills are automatically included in the system prompt and accessible via the `skill` tool
## User Interface
### AI Settings Page (`/settings/ai`)
The AI Settings page now includes a **Plugins** section with:
1. **Add Plugin**: Clone a new plugin by entering its Git URL
2. **Plugin List**: View all installed plugins with their skills
3. **Sync**: Pull latest changes from a plugin's Git repository
4. **Delete**: Remove a plugin and all its skills
### System Settings Page (`/settings/system`)
The System Settings page includes a **Filesystem Paths** section where you can configure:
- **Plugins Directory**: Path where plugins are stored (default: `/plugins`)
## Plugin Structure
A plugin is a Git repository with the following structure:
```
my-plugin/
├── skills/
│ ├── skill1/
│ │ └── SKILL.md
│ ├── skill2/
│ │ └── SKILL.md
│ └── ...
└── README.md (optional)
```
### Skill Format
Each skill is defined by a `SKILL.md` file with YAML frontmatter:
```markdown
---
name: skillname
description: A brief description of what this skill does
---
# Skill Content
The rest of the file contains instructions, examples, and context
that will be provided to the AI when this skill is invoked.
This can include:
- Step-by-step workflows
- Code examples
- Best practices
- Domain-specific knowledge
```
#### Required Frontmatter Fields
- **`name`**: Skill identifier (must be lowercase alphanumeric with hyphens, e.g., `myskill`, `skill-123`, `condition-based-waiting`)
- **`description`**: Human-readable description of what the skill does
#### Skill Name Validation
Skill names must:
- Contain only lowercase letters (a-z), numbers (0-9), and hyphens (-)
- No spaces, underscores, uppercase letters, or other special characters
- Examples: ✅ `myskill`, `skill-123`, `condition-based-waiting` | ❌ `My-Skill`, `skill_name`, `SKILL`
## How It Works
### For Users
1. **Add a Plugin**:
- Go to Settings > AI
- Scroll to the Plugins section
- Click "Add Plugin"
- Enter the Git URL (e.g., `https://github.com/user/shakespeare-skills.git`)
- Click "Add Plugin"
2. **View Skills**:
- Installed plugins show the number of skills they contain
- Expand a plugin to see all its skills with descriptions
3. **Sync a Plugin**:
- Click the "Sync" button next to a plugin to pull latest changes
- Useful when the plugin repository is updated with new skills
4. **Delete a Plugin**:
- Click the "Delete" button next to a plugin to remove it
- All skills from that plugin will no longer be available
### For the AI
The AI assistant automatically:
1. **Discovers Skills**: All skills from installed plugins are scanned on startup
2. **Includes in System Prompt**: Skills are listed in the system prompt with their names, descriptions, and paths
3. **Enforces Usage**: The system prompt instructs the AI to use skills whenever applicable
4. **Accesses via Tool**: The AI calls the `skill` tool with a skill name to load its content
Example AI workflow:
```
User: "Help me build a Nostr marketplace"
AI: [Sees "nostrmarket" skill in system prompt]
[Calls skill tool with name="nostrmarket"]
[Receives SKILL.md content with marketplace implementation guide]
[Follows the skill's instructions to build the marketplace]
```
## Technical Implementation
### Key Files
- **`src/lib/plugins.ts`**: Core plugin and skill management functions
- **`src/lib/tools/SkillTool.ts`**: AI tool for loading skill content
- **`src/hooks/usePlugins.ts`**: React hook for plugin CRUD operations
- **`src/components/PluginsSection.tsx`**: UI component for managing plugins
- **`src/lib/system.ts`**: Updated to include skills in system prompt
### API
#### `getPlugins(fs, pluginsPath)`
Returns array of plugin names (directory basenames).
#### `getAllSkills(fs, pluginsPath)`
Returns array of all skills from all plugins.
#### `findSkill(fs, pluginsPath, skillName)`
Finds a skill by name across all plugins.
#### `readSkillContent(fs, skill)`
Reads the SKILL.md content for a skill.
#### `deletePlugin(fs, pluginsPath, pluginName)`
Recursively deletes a plugin directory.
### Skill Tool
The `SkillTool` is exposed to the AI as the `skill` function:
```typescript
{
name: "skill",
description: "Load and execute a skill from the configured plugins",
parameters: {
name: "The name of the skill to execute"
}
}
```
When called, it:
1. Searches all plugins for a skill with the matching name
2. Returns the full SKILL.md content
3. Includes metadata (plugin name, description, path)
### Storage
Plugins are stored in the configured plugins directory:
- **Browser**: `/plugins` (IndexedDB via LightningFS)
## System Prompt Integration
The system prompt now includes a **Skills** section that:
1. Lists all available skills with their names, descriptions, plugins, and paths
2. Instructs the AI to use skills whenever applicable
3. Provides the Settings > AI URL for users to configure skills
4. Includes this section even when no skills are configured (to inform users about the feature)
Example system prompt section:
```
## Skills
You have access to the following skills. **Skills MUST be used whenever applicable** by calling the `skill` tool with the skill name.
Available skills:
- **nostrmarket**: Build a Nostr marketplace application
- Plugin: nostr-skills
- Path: /plugins/nostr-skills/skills/nostrmarket
**Important**: When a task matches a skill's description, you MUST use that skill by calling the skill tool. Skills contain specialized workflows and best practices for specific tasks.
Users can configure skills in Settings > AI (https://shakespeare.diy/settings/ai) by adding plugins that contain skills.
```
## Creating Your Own Plugin
1. **Create a Git repository** with the plugin structure
2. **Add skills** in the `skills/` directory
3. **Write SKILL.md files** with frontmatter and content
4. **Push to GitHub/GitLab** or any Git hosting service
5. **Share the Git URL** with others to install your plugin
### Example Plugin Repository
```
my-shakespeare-skills/
├── README.md
└── skills/
├── webdesign/
│ └── SKILL.md
└── database/
└── SKILL.md
```
**skills/webdesign/SKILL.md**:
```markdown
---
name: webdesign
description: Create beautiful, modern web designs with best practices
---
# Web Design Skill
When designing web interfaces, follow these principles:
1. **Use a consistent color palette** (3-5 colors + neutrals)
2. **Implement proper spacing** (8px grid system)
3. **Choose readable fonts** (18px+ for body text)
4. **Ensure accessibility** (WCAG 2.1 AA compliance)
[... detailed instructions ...]
```
## Configuration
### Plugins Directory Path
Configure in **Settings > System > Filesystem Paths**:
- Default: `/plugins`
- Custom: Any absolute path
Changes take effect immediately.
## Limitations
- Plugins must be Git repositories (no ZIP uploads)
- Skills must be in `skills/` subdirectory
- Skill names must be alphanumeric lowercase only
- Each skill must have a `SKILL.md` file with required frontmatter
- No automatic skill updates (users must manually sync)
## Future Enhancements
Potential future features:
- Plugin marketplace/registry
- Automatic skill updates
- Skill versioning
- Skill dependencies
- Plugin configuration files
- Skill categories/tags
- Skill search functionality
- Plugin publishing workflow
+1 -8
View File
@@ -8,7 +8,7 @@ import htmlParser from "@html-eslint/parser";
import customRules from "./eslint-rules/index.js";
export default tseslint.config(
{ ignores: ["dist", "android"] },
{ ignores: ["dist"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ["**/*.{ts,tsx}"],
@@ -40,18 +40,11 @@ export default tseslint.config(
"ignoreRestSiblings": true,
},
],
"indent": [
"warn",
2,
{ SwitchCase: 1 },
],
"no-tabs": "warn",
"custom/no-placeholder-comments": "error",
"no-warning-comments": [
"error",
{ terms: ["fixme"] },
],
"no-control-regex": "off", // Allow ANSI escape sequences in regex
},
},
{
+374
View File
@@ -0,0 +1,374 @@
# iframe Fetch Client Messaging Protocol (JSON-RPC)
This document describes the simplified JSON-RPC based communication protocol
between the parent page and the iframe fetch client.
## Overview
The iframe fetch client uses JSON-RPC 2.0 over `postMessage` for communication.
The ServiceWorker makes JSON-RPC calls directly, with the main thread acting as
a relay between the ServiceWorker and parent page. The only required method is
`fetch` for handling HTTP requests.
## Architecture
```
┌─────────────────┐ JSON-RPC over ┌──────────────────────┐
│ Parent Page │ postMessage │ Main Thread │
│ │ ←─────────────────→ │ (relay only) │
│ - Request │ │ │
│ handling │ │ ↕ │
└─────────────────┘ │ JSON-RPC over │
│ postMessage │
│ │
│ ┌──────────────────┐ │
│ │ ServiceWorker │ │
│ │ │ │
│ │ - Makes JSON-RPC │ │
│ │ calls directly │ │
│ │ - Handles │ │
│ │ requests │ │
│ └──────────────────┘ │
└──────────────────────┘
```
## JSON-RPC Structure
All messages follow JSON-RPC 2.0 specification:
```javascript
// GET Request
{
"jsonrpc": "2.0",
"method": "fetch",
"params": {
"request": {
"url": "https://app123.example.com/assets/main.js",
"method": "GET",
"headers": {
"Accept": "application/javascript"
},
"body": null
}
},
"id": 123
}
// POST Request with JSON body
{
"jsonrpc": "2.0",
"method": "fetch",
"params": {
"request": {
"url": "https://app123.example.com/api/data",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"body": "eyJuYW1lIjoiSm9obiIsImFnZSI6MzB9" // base64 encoded: {"name":"John","age":30}
}
},
"id": 124
}
// Success Response
{
"jsonrpc": "2.0",
"result": {
"status": 200,
"statusText": "OK",
"headers": {
"Content-Type": "application/javascript",
"Cache-Control": "no-cache"
},
"body": "Y29uc29sZS5sb2coJ2hlbGxvJyk7" // base64 encoded: console.log('hello');
},
"id": 123
}
// Error Response (still uses JSON-RPC error format for protocol errors)
{
"jsonrpc": "2.0",
"error": {
"code": -32001,
"message": "Invalid request format",
"data": { "url": "/assets/main.js" }
},
"id": 123
}
```
## Methods
### `fetch`
**Purpose:** Handle HTTP requests, including GET, POST, PUT, DELETE, etc. with
full request body support
**Parameters:**
- `request` (object): Serialized fetch request
- `url` (string): Full URL of the request
- `method` (string): HTTP method (GET, POST, etc.)
- `headers` (object): Request headers as key-value pairs
- `body` (string|null): Request body as base64 encoded string, or null if no body
**Result:**
- `status` (number): HTTP status code (200, 404, etc.)
- `statusText` (string): HTTP status text ("OK", "Not Found", etc.)
- `headers` (object): Response headers as key-value pairs
- `body` (string|null): Response body content as base64 encoded string (null if status is 204)
**Error Codes:**
- `-32001`: Invalid request format
- `-32002`: Request processing error
- `-32003`: Invalid URL
**Request Body Support:** The system fully supports request bodies, enabling:
- POST/PUT requests with JSON data
- Form submissions
- API calls with payloads
- File uploads (as base64 strings)
- Any HTTP method with body content
Request bodies must be base64-encoded strings when not null. This ensures
consistent handling of both text and binary data across the messaging protocol.
### `console`
**Purpose:** Forward console messages from iframe to parent for display
**Parameters:**
- `level` (string): Log level - "log", "warn", "error", "info", "debug"
- `message` (string): The log message
**Result:** None (notification only, no response expected)
## Implementation
### Parent Page
The parent page acts as a static file server and console log collector:
```javascript
class FetchClientParent {
constructor(files) {
this.files = files; // Map of path -> {content, contentType}
this.consoleLogs = []; // Store console messages
this.setupMessageListener();
}
setupMessageListener() {
window.addEventListener("message", (event) => {
// Verify origin for security
if (event.origin !== "https://app123.example.com") return;
const message = event.data;
// Handle fetch requests
if (message.jsonrpc === "2.0" && message.method === "fetch") {
this.handleFetch(message);
}
// Handle console messages
if (message.jsonrpc === "2.0" && message.method === "console") {
this.handleConsoleMessage(message);
}
});
}
handleConsoleMessage(message) {
const { params } = message;
const { level, message: logMessage } = params;
// Store the log message
this.consoleLogs.push({
level,
message: logMessage,
timestamp: Date.now(),
id: Date.now()
});
// Update UI to show new logs
this.updateConsoleUI();
// Also log to parent's console for debugging
console[level](`[IFRAME] ${logMessage}`);
}
updateConsoleUI() {
// Implementation depends on your UI framework
console.log(`Total console logs: ${this.consoleLogs.length}`);
}
handleFetch(request) {
const { params, id } = request;
const { request: fetchRequest } = params;
// Extract path from URL
const url = new URL(fetchRequest.url);
const path = url.pathname;
const file = this.files.get(path);
if (file) {
this.sendResponse({
id,
jsonrpc: "2.0",
result: {
status: 200,
statusText: "OK",
headers: {
"Content-Type": file.contentType,
"Cache-Control": "no-cache",
},
body: btoa(file.content),
},
});
} else {
this.sendResponse({
id,
jsonrpc: "2.0",
result: {
status: 404,
statusText: "Not Found",
headers: {
"Content-Type": "text/plain",
},
body: btoa(`File not found: ${path}`),
},
});
}
}
sendResponse(message) {
const iframe = document.getElementById("preview-iframe");
iframe.contentWindow.postMessage(message, "https://app123.example.com");
}
}
```
### iframe Client Communication
The iframe client uses a simplified JSON-RPC client for communication. In the actual implementation, the ServiceWorker makes requests and the main thread acts as a relay:
```javascript
// Simplified JSON-RPC client (actual implementation in _iframe-client/main.js)
class JSONRPCClient {
constructor() {
this.requestId = 0;
this.pendingRequests = new Map();
this.setupMessageListener();
}
setupMessageListener() {
window.addEventListener("message", (event) => {
const message = event.data;
if (message.jsonrpc === "2.0" && message.id !== undefined) {
this.handleResponse(message);
}
});
}
async fetch(request) {
const id = ++this.requestId;
return new Promise((resolve, reject) => {
this.pendingRequests.set(id, { resolve, reject });
window.parent.postMessage({
jsonrpc: "2.0",
method: "fetch",
params: { request },
id,
}, "*");
setTimeout(() => {
if (this.pendingRequests.has(id)) {
this.pendingRequests.delete(id);
reject(new Error(`Timeout fetching: ${request.url}`));
}
}, 10000);
});
}
handleResponse(message) {
const { id, result, error } = message;
const pending = this.pendingRequests.get(id);
if (!pending) return;
this.pendingRequests.delete(id);
if (error) {
pending.reject(new Error(`${error.message} (code: ${error.code})`));
} else {
pending.resolve(result);
}
}
}
```
## Base64 Encoding
All request and response bodies are base64 encoded when not null to ensure proper transmission through JSON-RPC:
- **Consistent Data Handling:** Both text and binary data are handled uniformly
- **JSON Compatibility:** Avoids issues with special characters in JSON messages
- **Binary Data Support:** Enables transmission of images, files, and other binary content
**Encoding/Decoding:**
```javascript
// Encoding text content (parent side)
const encodedBody = btoa(textContent);
// Encoding binary content (ServiceWorker side)
const bytes = new Uint8Array(arrayBuffer);
const encodedBody = btoa(String.fromCharCode(...bytes));
// Decoding (receiver side)
const decodedText = atob(encodedBody);
const decodedBytes = new Uint8Array(atob(encodedBody).split('').map(c => c.charCodeAt(0)));
```
## Security
- **Origin Validation:** Always verify message origin
- **Path Validation:** Validate file paths to prevent directory traversal
- **Timeout:** Requests timeout after 10 seconds
- **Error Handling:** Proper JSON-RPC error responses
## Example Usage
```html
<iframe
id="preview-iframe"
src="https://app123.example.com"
sandbox="allow-scripts allow-same-origin"
>
</iframe>
<script>
const files = new Map([
["/", {
content: "<!DOCTYPE html><html><body>Hello world!</body></html>",
contentType: "text/html",
}],
["/app.js", {
content: "console.log('App loaded');",
contentType: "application/javascript",
}],
]);
// Initialize the fetch client parent
new FetchClientParent(files);
</script>
```
## Console Logging Implementation
The iframe client automatically intercepts console messages and forwards them to the parent. The implementation (in `_iframe-client/main.js`) overrides console methods.
+337
View File
@@ -0,0 +1,337 @@
# iframe Fetch Client
An iframe preview system for **Single Page Applications (SPAs)**.
## Why?
We want to display a preview of a project built with Vite, Webpack, etc in an
iframe, but the SPA uses root-relative paths (like `/assets/main.js`). This
means we can't just load it directly from a file system or a local server
without deploying it to a web server.
To work around this, we can instead deploy this "iframe Fetch Client" to a
subdomain, embed it in an iframe, and then respond to its `postMessage` requests
from the parent to serve it the files it needs.
This "iframe Fetch Client" is entirely static files, and only needs to be
deployed once. As long as the parent page implements its JSON-RPC protocol, it
can serve any web application.
## Architecture
```
┌─────────────────┐ JSON-RPC over ┌──────────────────────┐
│ Parent Page │ postMessage │ iframe Client │
│ (example.com) │ ←─────────────────→ │ (*.example.com) │
│ │ fetch() │ │
│ - Request │ │ ┌──────────────────┐ │
│ handling │ │ │ Main Thread │ │
└─────────────────┘ │ │ (relay only) │ │
│ │ ↕ │ │
│ │ JSON-RPC over │ │
│ │ postMessage │ │
│ │ ↕ │ │
│ │ ┌──────────────┐ │ │
│ │ │ServiceWorker │ │ │
│ │ │ │ │ │
│ │ │- Makes │ │ │
│ │ │ JSON-RPC │ │ │
│ │ │ calls │ │ │
│ │ │- Handles │ │ │
│ │ │ requests │ │ │
│ │ └──────────────┘ │ │
│ └──────────────────┘ │
└──────────────────────┘
```
## Limitations
This system uses a ServiceWorker to serve requests, which means the preview site
cannot itself register a ServiceWorker. If it tries, the attempt will be
blocked.
## Files Structure
```
/
├── index.html # Main iframe client page
├── _iframe-client/
│ ├── main.js # Main coordination script
│ └── client.css # Styles for the iframe client
├── sw.js # ServiceWorker
├── MESSAGING_PROTOCOL.md # Communication protocol docs
└── README.md # This file
```
## Simplified JSON-RPC Protocol
The system now uses a simplified JSON-RPC 2.0 protocol with two methods:
- **`fetch(request)`** - Handle HTTP requests with serialized fetch
request/response
- **`console(level, message)`** - Forward console messages from
iframe to parent for display
**Request:**
```javascript
{
"jsonrpc": "2.0",
"method": "fetch",
"params": {
"request": {
"url": "https://app123.example.com/assets/main.js",
"method": "GET",
"headers": {},
"body": null
}
},
"id": 123
}
```
**Response:**
```javascript
{
"jsonrpc": "2.0",
"result": {
"status": 200,
"statusText": "OK",
"headers": {
"Content-Type": "application/javascript"
},
"body": "console.log('hello');"
},
"id": 123
}
```
**Console Message:**
```javascript
{
"jsonrpc": "2.0",
"method": "console",
"params": {
"level": "error",
"message": "Failed to load module"
}
}
```
## How It Works
1. **Initialization:**
- iframe client loads at `app123.example.com`
- Registers ServiceWorker at `/sw.js` with scope `/`
- Blocks future ServiceWorker registrations
- Main thread sets up relay between ServiceWorker and parent
2. **Request Handling:**
- ServiceWorker intercepts all requests (except iframe client system files)
- ServiceWorker makes JSON-RPC `fetch()` calls directly with serialized
requests
- Main thread relays JSON-RPC messages between ServiceWorker and parent
- Parent responds with serialized HTTP responses
- ServiceWorker creates Response objects and returns them to the client app
3. **Content Replacement:**
- Main thread requests `/` from parent via JSON-RPC fetch
- Replaces its own content with the site index
- Site runs normally, with all requests handled by SW via JSON-RPC
## Deployment
### iframe Client Domain (`*.example.com`)
Deploy these files to your iframe client subdomain:
```
https://*.example.com/
├── index.html
├── _iframe-client/
│ ├── main.js
│ └── client.css
└── sw.js
```
**Security Note:** It is recommended to serve the client on a wildcard subdomain
(like `*.example.com`) if you wish to support multiple projects. That way
projects won't share the same localStorage and IndexedDB.
### Parent Page Integration
Include the iframe client in your parent page:
```html
<iframe
id="preview-iframe"
src="https://app123.example.com/"
sandbox="allow-scripts allow-same-origin"
>
</iframe>
```
Implement the JSON-RPC protocol:
```javascript
class FetchClientParent {
constructor(files) {
this.files = files; // Map of path -> {content, contentType}
this.setupMessageListener();
}
setupMessageListener() {
window.addEventListener("message", (event) => {
if (event.origin !== "https://example.com") return;
const message = event.data;
if (message.jsonrpc === "2.0" && message.method === "fetch") {
this.handleFetch(message);
}
});
}
handleFetch(request) {
const { params, id } = request;
const { request: fetchRequest } = params;
// Extract path from URL
const url = new URL(fetchRequest.url);
const path = url.pathname;
const file = this.files.get(path);
if (file) {
this.sendResponse({
id,
jsonrpc: "2.0",
result: {
status: 200,
statusText: "OK",
headers: {
"Content-Type": file.contentType,
"Cache-Control": "no-cache",
},
body: file.content,
},
});
} else {
// Return 404 response
this.sendResponse({
id,
jsonrpc: "2.0",
result: {
status: 404,
statusText: "Not Found",
headers: {
"Content-Type": "text/plain",
},
body: `File not found: ${path}`,
},
});
}
}
sendResponse(message) {
const iframe = document.getElementById("preview-iframe");
iframe.contentWindow.postMessage(message, "https://app123.example.com");
}
}
```
## Request Handling
Handle requests by providing responses as a Map or object for static files, or
implement custom logic for dynamic requests:
```javascript
const staticFiles = new Map([
["/", {
content: "<!DOCTYPE html>...",
contentType: "text/html",
}],
["/assets/main.js", {
content: 'console.log("app");',
contentType: "application/javascript",
}],
["/assets/style.css", {
content: "body { margin: 0; }",
contentType: "text/css",
}],
]);
// Or handle dynamic requests like APIs
function handleRequest(fetchRequest) {
const url = new URL(fetchRequest.url);
if (url.pathname.startsWith("/api/")) {
// Handle API requests
return handleAPIRequest(fetchRequest);
} else {
// Serve static files
return serveStaticFile(url.pathname);
}
}
```
## Security Features
- **Origin Validation:** Messages are validated by origin
- **Sandboxed Iframe:** Client runs in a sandboxed environment
- **Isolated ServiceWorker:** SW only affects the iframe client domain
- **No Direct Access:** Parent controls all request handling
## Testing
1. Create a parent page implementing the JSON-RPC protocol (see example in MESSAGING_PROTOCOL.md)
2. Load the iframe client in an iframe pointing to your deployed client domain
3. The iframe client should load and display the served content
4. Test navigation and functionality within the iframe client
## Browser Support
- **ServiceWorker:** Required (supported in all modern browsers)
- **postMessage:** Required (universal support)
- **iframe sandbox:** Recommended (modern browsers)
## Limitations
- Request/response bodies must be JSON-serializable strings (no binary support)
- All requests go through the parent page (potential performance impact)
- Requires HTTPS for ServiceWorker (except localhost)
- Limited to same-origin communication patterns within the iframe
## Troubleshooting
### iframe client doesn't load
- Check browser console for ServiceWorker errors
- Verify HTTPS is used (required for ServiceWorker)
- Ensure parent page implements the messaging protocol
### Requests fail
- Check that request paths match your handling logic (case-sensitive)
- Verify parent page is responding to JSON-RPC `fetch` requests
- Check browser network tab for failed requests
### Communication issues
- Verify iframe src points to correct preview domain
- Check that JSON-RPC messages are properly formatted
- Ensure iframe has appropriate sandbox permissions
## Development
To modify the system:
1. **iframe Client:** Edit `index.html`, `_iframe-client/main.js`,
`_iframe-client/client.css`, `sw.js`
2. **Protocol:** Update `MESSAGING_PROTOCOL.md` for any changes
3. **Testing:** Create a parent page implementing the JSON-RPC protocol for testing changes
## License
This system is designed for development and testing purposes. Ensure appropriate
security measures for production use.
@@ -0,0 +1,39 @@
body {
margin: 0;
padding: 20px;
font-family: system-ui, -apple-system, sans-serif;
background: #f5f5f5;
}
.loading {
text-align: center;
padding: 50px;
}
.spinner {
border: 4px solid #f3f3f3;
border-top: 4px solid #3498db;
border-radius: 50%;
width: 40px;
height: 40px;
animation: spin 2s linear infinite;
margin: 0 auto 20px;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.error {
color: #e74c3c;
background: #fdf2f2;
border: 1px solid #fecaca;
border-radius: 4px;
padding: 15px;
margin: 20px 0;
}
+350
View File
@@ -0,0 +1,350 @@
/**
* iframe Fetch Client - Simplified Implementation
* Implements JSON-RPC 2.0 messaging protocol per MESSAGING_PROTOCOL.md
*/
// JSON-RPC Client for communication with parent
class JSONRPCClient {
constructor() {
this.requestId = 0;
this.pendingRequests = new Map();
this.setupMessageListener();
}
setupMessageListener() {
window.addEventListener("message", (event) => {
const message = event.data;
// Check if this is a response to our own request or a ServiceWorker request
if (message.jsonrpc === "2.0" && message.id !== undefined) {
if (this.pendingRequests.has(message.id)) {
this.handleResponse(message);
} else {
// This is a response to a ServiceWorker request, relay it back
this.relayToServiceWorker(message);
}
}
});
}
relayToServiceWorker(response) {
// Forward the JSON-RPC response to ServiceWorker
if (navigator.serviceWorker.controller) {
navigator.serviceWorker.controller.postMessage(response);
}
}
async fetch(request) {
const id = ++this.requestId;
return new Promise((resolve, reject) => {
this.pendingRequests.set(id, { resolve, reject });
// Send JSON-RPC request to parent
window.parent.postMessage({
jsonrpc: "2.0",
method: "fetch",
params: { request },
id,
}, "*");
// Timeout after 10 seconds
setTimeout(() => {
if (this.pendingRequests.has(id)) {
this.pendingRequests.delete(id);
reject(new Error(`Timeout fetching: ${request.url}`));
}
}, 10000);
});
}
handleResponse(message) {
const { id, result, error } = message;
const pending = this.pendingRequests.get(id);
if (!pending) return;
this.pendingRequests.delete(id);
if (error) {
pending.reject(new Error(`${error.message} (code: ${error.code})`));
} else {
pending.resolve(result);
}
}
}
// Console Interceptor - forwards console messages to parent
class ConsoleInterceptor {
constructor() {
this.originalConsole = {};
this.methods = ['log', 'warn', 'error', 'info', 'debug'];
this.init();
}
init() {
// Store original methods and override in single pass
this.methods.forEach((method) => {
if (typeof console[method] === 'function') {
this.originalConsole[method] = console[method];
console[method] = (...args) => {
// Call original method
try {
this.originalConsole[method](...args);
} catch (e) {
// Continue if original fails
}
// Send to parent
this.sendConsoleMessage(method, ...args);
};
}
});
}
sendConsoleMessage(level, ...args) {
const message = args.map((arg) => {
if (arg === undefined) return 'undefined';
if (arg === null) return 'null';
if (typeof arg === 'object') {
try {
return JSON.stringify(arg, (key, value) => {
if (value instanceof Error) {
return {
name: value.name,
message: value.message,
stack: value.stack
};
}
return value;
});
} catch {
return String(arg);
}
}
return String(arg);
}).join(' ');
try {
window.parent.postMessage({
jsonrpc: "2.0",
method: "console",
params: { level, message }
}, "*");
} catch (error) {
// Retry once after delay if postMessage fails
setTimeout(() => {
try {
window.parent.postMessage({
jsonrpc: "2.0",
method: "console",
params: { level: "error", message: `[DELAYED] ${message}` }
}, "*");
} catch {
// Give up if retry fails
}
}, 100);
}
}
}
// Main Fetch Client
class FetchClient {
constructor() {
this.rpcClient = new JSONRPCClient();
this.consoleInterceptor = new ConsoleInterceptor();
this.init();
}
async init() {
try {
await this.setupServiceWorker();
await this.loadSiteIndex();
} catch (error) {
this.showError("Failed to initialize fetch client", error);
}
}
async setupServiceWorker() {
if (!("serviceWorker" in navigator)) {
throw new Error("ServiceWorker not supported");
}
// Check if already registered
const existing = await navigator.serviceWorker.getRegistration();
if (existing) {
console.log("ServiceWorker already registered");
this.setupServiceWorkerCommunication();
return;
}
// Register new ServiceWorker
const registration = await navigator.serviceWorker.register("/sw.js", { scope: "/" });
console.log("ServiceWorker registered:", registration);
await navigator.serviceWorker.ready;
this.setupServiceWorkerCommunication();
this.blockFutureRegistrations(); // Block future registrations to prevent site from registering its own SW
}
setupServiceWorkerCommunication() {
// Relay JSON-RPC requests from ServiceWorker to parent
navigator.serviceWorker.addEventListener("message", (event) => {
const { data } = event;
if (data.jsonrpc === "2.0" && data.method && data.id !== undefined) {
window.parent.postMessage(data, "*");
}
});
}
blockFutureRegistrations() {
navigator.serviceWorker.register = () => {
console.log("Blocked ServiceWorker registration attempt");
return Promise.resolve({
scope: "/",
active: navigator.serviceWorker.controller,
installing: null,
waiting: null,
addEventListener: () => {},
removeEventListener: () => {},
});
};
}
async loadSiteIndex() {
const serializedRequest = {
url: `${location.origin}/`,
method: "GET",
body: null,
headers: {},
};
const response = await this.rpcClient.fetch(serializedRequest);
if (response?.status !== 200) {
throw new Error(`Failed to fetch site index: ${response?.status || 'Invalid response from site: ' + response} ${response?.statusText || ''}`);
}
if (response.headers["Content-Type"] !== "text/html") {
throw new Error(`Unexpected Content-Type: ${response.headers["Content-Type"]}`);
}
const bytes = new Uint8Array(atob(response.body).split('').map(c => c.charCodeAt(0)));
const text = new TextDecoder().decode(bytes);
this.replaceDocument(text);
}
replaceDocument(htmlContent) {
// Create a new document from the HTML content
const parser = new DOMParser();
const newDoc = parser.parseFromString(htmlContent, "text/html");
// Extract scripts for re-execution
const scripts = [];
newDoc.querySelectorAll("script").forEach((script) => {
scripts.push({
src: script.src,
type: script.type,
async: script.hasAttribute("async"),
defer: script.hasAttribute("defer"),
});
script.remove();
});
// Replace document content
document.head.innerHTML = newDoc.head.innerHTML;
document.body.innerHTML = newDoc.body.innerHTML;
// Re-add scripts to execute them
scripts.forEach((script) => {
const newScript = document.createElement("script");
newScript.src = script.src;
newScript.type = script.type;
if (script.async) newScript.async = true;
if (script.defer) newScript.defer = true;
document.body.appendChild(newScript);
});
console.log("Document replaced with site content");
}
showError(message, error) {
console.error(message, error);
document.body.innerHTML = `
<div style="
font-family: system-ui, -apple-system, sans-serif;
max-width: 600px;
margin: 50px auto;
padding: 20px;
background: #f8f9fa;
border-radius: 8px;
border-left: 4px solid #dc3545;
">
<h2 style="color: #dc3545; margin-top: 0;">Fetch Client Error</h2>
<p><strong>${message}</strong></p>
<p style="color: #6c757d;">${error.message || error}</p>
<details style="margin-top: 20px;">
<summary style="cursor: pointer; color: #007bff;">Technical Details</summary>
<pre style="
background: #f1f3f4;
padding: 10px;
border-radius: 4px;
overflow-x: auto;
font-size: 12px;
margin-top: 10px;
">${error.stack || JSON.stringify(error, null, 2)}</pre>
</details>
</div>
`;
}
}
// Global error handlers
const setupGlobalErrorHandlers = () => {
window.addEventListener('error', (event) => {
try {
window.parent.postMessage({
jsonrpc: "2.0",
method: "console",
params: {
level: "error",
message: `Uncaught Error: ${event.message}`,
source: event.filename,
lineno: event.lineno,
colno: event.colno,
stack: event.error?.stack
}
}, "*");
} catch {
// Ignore postMessage errors
}
});
window.addEventListener('unhandledrejection', (event) => {
try {
window.parent.postMessage({
jsonrpc: "2.0",
method: "console",
params: {
level: "error",
message: "Unhandled Promise Rejection",
reason: event.reason,
promise: event.promise ? 'Promise object' : 'No promise object'
}
}, "*");
} catch {
// Ignore postMessage errors
}
});
};
// Initialize
setupGlobalErrorHandlers();
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", () => new FetchClient());
} else {
new FetchClient();
}
+17
View File
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Site Preview</title>
<link rel="stylesheet" href="/_iframe-client/client.css">
</head>
<body>
<div class="loading">
<div class="spinner"></div>
<p>Loading preview...</p>
<p><small>Waiting for ServiceWorker and parent communication</small></p>
</div>
<script type="module" src="/_iframe-client/main.js"></script>
</body>
</html>
+159
View File
@@ -0,0 +1,159 @@
/**
* iframe Fetch Client ServiceWorker
* Intercepts requests and handles them via JSON-RPC communication
*/
let pendingRequests = new Map();
let requestIdCounter = 0;
// Install event
self.addEventListener("install", (event) => {
console.log("ServiceWorker installing");
self.skipWaiting();
});
// Activate event
self.addEventListener("activate", (event) => {
console.log("ServiceWorker activating");
event.waitUntil(self.clients.claim());
});
// Message handling from main thread (JSON-RPC responses)
self.addEventListener("message", (event) => {
handleMainThreadMessage(event.data);
});
function handleMainThreadMessage(data) {
// Handle JSON-RPC responses relayed from main thread
if (data.jsonrpc === "2.0" && data.id !== undefined) {
handleJSONRPCResponse(data);
}
}
function handleJSONRPCResponse(message) {
const { id, result, error } = message;
const pendingRequest = pendingRequests.get(id);
if (!pendingRequest) {
console.warn("No pending request found for ID:", id);
return;
}
pendingRequests.delete(id);
if (error) {
pendingRequest.reject(new Error(`${error.message} (code: ${error.code})`));
return;
}
// Create response from serialized response
const { status, statusText, headers, body } = result;
// Decode base64 body if present
let decoded = null;
if (typeof body === "string") {
decoded = new Uint8Array(atob(body).split('').map(c => c.charCodeAt(0)));
}
const response = new Response(decoded, {
status: status || 200,
statusText: statusText || "OK",
headers: headers || {},
});
pendingRequest.resolve(response);
}
async function requestViaJSONRPC(request) {
return new Promise(async (resolve, reject) => {
const id = ++requestIdCounter;
// Serialize the fetch request
let body = null;
if (request.body) {
try {
// Convert body to Uint8Array then base64 encode
const bytes = await request.bytes();
body = btoa(String.fromCharCode(...bytes));
} catch (error) {
reject(new Error(`Failed to serialize request body: ${error.message}`));
return;
}
}
const serializedRequest = {
url: request.url,
method: request.method,
headers: Object.fromEntries(request.headers.entries()),
body: body,
};
pendingRequests.set(id, { resolve, reject, originalRequest: request });
// Send JSON-RPC request to main thread for relay to parent
self.clients.matchAll().then((clients) => {
if (clients.length > 0) {
clients[0].postMessage({
jsonrpc: "2.0",
method: "fetch",
params: { request: serializedRequest },
id,
});
} else {
pendingRequests.delete(id);
reject(new Error("No clients available"));
}
});
// Timeout after 10 seconds
setTimeout(() => {
if (pendingRequests.has(id)) {
pendingRequests.delete(id);
reject(new Error(`Timeout requesting: ${request.url}`));
}
}, 10000);
});
}
// Fetch event - intercept all requests
self.addEventListener("fetch", (event) => {
const url = new URL(event.request.url);
// Ignore requests to other origins
if (url.origin !== location.origin) {
return;
}
// Let iframe client system files be handled normally
if (url.pathname.startsWith("/_") || url.pathname === "/sw.js") {
return;
}
// Let root path be handled normally (loads the iframe client page)
if (url.pathname === "/") {
return;
}
// Handle all other requests through JSON-RPC communication
event.respondWith(handleRequest(event.request));
});
async function handleRequest(request) {
try {
console.log("ServiceWorker handling request for:", request.url);
return await requestViaJSONRPC(request);
} catch (error) {
console.error("Failed to handle request:", request.url, error);
// Return 404 for failed requests
return new Response(`Request failed: ${request.url}`, {
status: 404,
statusText: "Not Found",
headers: {
"Content-Type": "text/plain",
},
});
}
}
console.log("ServiceWorker script loaded");
+7 -12
View File
@@ -2,19 +2,14 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<title>Shakespeare - Open Source AI Builder</title>
<meta name="description" content="Build custom apps with AI assistance using Shakespeare, an open-source development environment">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Shakespeare - AI-Powered Nostr Development</title>
<meta name="description" content="Build custom Nostr websites with AI assistance using Shakespeare, an AI-powered development environment">
<meta property="og:type" content="website">
<meta property="og:title" content="Shakespeare - Open Source AI Builder">
<meta property="og:description" content="Build custom apps with AI assistance using Shakespeare, an open-source development environment">
<meta property="og:image" content="https://shakespeare.diy/og-image.png">
<meta http-equiv="content-security-policy" content="default-src 'none'; script-src 'self' 'unsafe-eval' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src 'self' https:; font-src 'self'; worker-src 'self' blob:; base-uri 'self'; manifest-src 'self'; connect-src 'self' blob: https: http: wss: ws:; img-src 'self' data: blob: https:; media-src 'self' https:">
<link rel="icon" type="image/png" href="/shakespeare-192x192.png">
<link rel="apple-touch-icon" href="/shakespeare-192x192.png" sizes="192x192">
<meta name="theme-color" content="#2b0037">
<meta property="og:title" content="Shakespeare - AI-Powered Nostr Development">
<meta property="og:description" content="Build custom Nostr websites with AI assistance using Shakespeare, an AI-powered development environment">
<!-- <meta http-equiv="content-security-policy" content="default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; frame-src 'self' https:; font-src 'self'; base-uri 'self'; manifest-src 'self'; connect-src 'self' blob: https: wss:; img-src 'self' data: blob: https:; media-src 'self' https:"> -->
<link rel="icon" type="image/png" href="/favicon.png">
<link rel="manifest" href="/manifest.webmanifest">
</head>
<body>
-9
View File
@@ -1,9 +0,0 @@
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"nostr": {
"type": "local",
"command": ["npx", "-y", "@nostrbook/mcp@latest"]
}
}
}
+552 -6946
View File
File diff suppressed because it is too large. Load diff
+12 -48
View File
@@ -1,43 +1,26 @@
{
"name": "shakespeare.diy",
"description": "Build custom apps with AI assistance using Shakespeare, an open-source development environment",
"homepage": "https://shakespeare.diy",
"license": "AGPL-3.0-or-later",
"version": "9.16.4",
"name": "mkstack",
"private": true,
"version": "0.0.0",
"type": "module",
"author": {
"name": "shakespeare.diy",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "https://gitlab.com/soapbox-pub/shakespeare.git"
},
"scripts": {
"dev": "npm i --silent && vite",
"build": "npm i --silent && vite build -l error && cp dist/index.html dist/404.html && echo 'Project built successfully!'",
"typecheck": "npm i --silent && tsc --noEmit",
"test": "npm i --silent && eslint && vitest run --reporter=dot --silent && echo 'All tests passed!'",
"keygen": "keytool -genkey -v -keystore android/app/my-upload-key.keystore -keyalg RSA -keysize 2048 -validity 10000 -alias upload",
"icons": "bash scripts/generate-icons.sh"
"deploy": "npm run build && npx -y nostr-deploy-cli deploy --skip-setup"
},
"dependencies": {
"@capacitor/app": "^8.1.0",
"@capacitor/core": "^8.3.0",
"@capacitor/status-bar": "^8.0.2",
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@fontsource-variable/inter": "^5.2.6",
"@getalby/sdk": "^6.0.1",
"@hookform/resolvers": "^5.2.2",
"@hookform/resolvers": "^3.9.0",
"@isomorphic-git/lightning-fs": "^4.6.2",
"@modelcontextprotocol/sdk": "^1.22.0",
"@mozilla/readability": "^0.6.0",
"@nostrify/nostrify": "^0.54.1",
"@nostrify/react": "^0.6.6",
"@opensecret/react": "^1.5.4",
"@plausible-analytics/tracker": "^0.4.4",
"@nostrify/nostrify": "npm:@jsr/nostrify__nostrify@^0.46.5",
"@nostrify/react": "npm:@jsr/nostrify__react@^0.2.9",
"@radix-ui/react-accordion": "^1.2.0",
"@radix-ui/react-alert-dialog": "^1.1.1",
"@radix-ui/react-aspect-ratio": "^1.1.0",
@@ -65,13 +48,10 @@
"@radix-ui/react-toggle": "^1.1.0",
"@radix-ui/react-toggle-group": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.4",
"@sentry/react": "^10.22.0",
"@std/encoding": "npm:@jsr/std__encoding@^1.0.10",
"@tanstack/react-query": "^5.56.2",
"@unhead/addons": "^2.0.10",
"@unhead/react": "^2.0.10",
"acorn": "^8.16.0",
"acorn-jsx": "^5.3.2",
"buffer": "^6.0.3",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
@@ -79,26 +59,20 @@
"decimal.js": "^10.6.0",
"embla-carousel-react": "^8.3.0",
"esbuild-wasm": "^0.25.8",
"gray-matter": "^4.0.3",
"i18next": "^25.5.2",
"ignore": "^7.0.5",
"input-otp": "^1.2.4",
"isomorphic-git": "^1.32.1",
"jsonc-parser": "^3.3.1",
"jszip": "^3.10.1",
"lucide-react": "^0.562.0",
"mime": "^4.1.0",
"lucide-react": "^0.525.0",
"nostr-tools": "^2.15.2",
"nunjucks": "^3.2.4",
"openai": "^6.16.0",
"openai": "^5.15.0",
"path-browserify": "^1.0.1",
"prismjs": "^1.30.0",
"qrcode": "^1.5.4",
"react": "^18.3.1",
"react-day-picker": "^8.10.1",
"react-dom": "^18.3.1",
"react-error-boundary": "^6.0.0",
"react-hook-form": "^7.71.1",
"react-hook-form": "^7.53.0",
"react-i18next": "^15.7.3",
"react-markdown": "^10.1.0",
"react-resizable-panels": "^3.0.3",
@@ -108,18 +82,13 @@
"streamdown": "~1.0.0",
"tailwind-merge": "^2.5.2",
"tailwindcss-animate": "^1.0.7",
"tailwindcss-safe-area": "^0.8.0",
"turndown": "^7.2.1",
"uri-templates": "^0.2.0",
"use-stick-to-bottom": "^1.1.1",
"vaul": "^0.9.3",
"webln": "^0.3.2",
"workbox-window": "^7.3.0",
"zod": "^4.3.6"
"zod": "^3.25.76"
},
"devDependencies": {
"@capacitor/android": "^8.3.0",
"@capacitor/cli": "^8.3.0",
"@eslint/js": "^9.9.0",
"@html-eslint/eslint-plugin": "^0.41.0",
"@html-eslint/parser": "^0.41.0",
@@ -127,17 +96,13 @@
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/jsdom": "^27.0.0",
"@types/jszip": "^3.4.0",
"@types/node": "^22.5.5",
"@types/nunjucks": "^3.2.6",
"@types/path-browserify": "^1.0.3",
"@types/prismjs": "^1.26.5",
"@types/qrcode": "^1.5.5",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.1",
"@types/turndown": "^5.0.5",
"@types/uri-templates": "^0.1.34",
"@vitejs/plugin-react-swc": "^3.5.0",
"autoprefixer": "^10.4.20",
"eslint": "^9.9.0",
@@ -150,7 +115,6 @@
"typescript": "^5.5.3",
"typescript-eslint": "^8.0.1",
"vite": "^6.3.5",
"vite-plugin-pwa": "^1.1.0",
"vitest": "^4.1.8"
"vitest": "^3.1.4"
}
}
-186
View File
@@ -1,186 +0,0 @@
# Changelog
## [9.16.4] - 2026-09-16
### Changed
- Published sites carry only the tags the nsite spec defines — the relay hints Shakespeare used to attach were read by nothing, and taking a site back no longer rewrites them
## [9.16.3] - 2026-09-14
### Added
- Take back your sites one at a time — every name waiting for you now has its own Publish, Show, and Delete buttons, so you can keep the few you want and clear out the rest
- Show opens a site by its Nostr address before you decide about it, so you can look at names that never loaded in a browser
### Changed
- Deleting a name only gives it up on shakespeare.wtf — anything published to Nostr stays yours
- Names that couldn't be taken back safely can now be cleared out, instead of only explaining why they were stuck
## [9.16.2] - 2026-09-13
### Changed
- Deploy settings now says how many of your names are waiting to be taken back, and stays quiet when there are none
### Fixed
- Names you published before shakespeare.wtf changed hands are recognized as yours as you type them — the Deploy screen offers to hand them back instead of reporting them taken by somebody else
## [9.16.1] - 2026-09-13
### Fixed
- Deploying to a name you already own works again — names you took back in the migration were reported as taken by somebody else, and the Deploy button refused to publish to your own site
## [9.16.0] - 2026-09-13
### Added
- Take back the sites you published before shakespeare.wtf changed hands — Deploy settings now lists every name that's waiting for you and hands them all back at once, republished under your own key
- Deploys report which relays accepted your site, and can fill in any that missed it without republishing
### Changed
- Deploying to Shakespeare now publishes your site to Nostr under your own key, so it stays readable by any Nostr site viewer with or without shakespeare.wtf
- Recovered sites are titled whatever they call themselves rather than after their web address
### Fixed
- Deploying to Shakespeare works again — it had been reporting success while changing nothing, because the host it uploaded to no longer serves those addresses
- New accounts start with Shakespeare set up as a deployment target instead of an empty screen
- Deployment provider settings now scroll, so Save is always reachable
## [9.15.0] - 2026-08-19
### Added
- Connect to Meridian as an AI provider — available as a one-click preset with streamlined setup
- Optimize Repository action in the project menu that consolidates git history to reclaim space and repair bloated repositories
### Fixed
- Zaps now verify the invoice amount before paying, so you're never charged more than you approved
## [9.14.0] - 2026-06-05
### Added
- Log in with a remote signer by scanning a QR code — connect your NIP-46 mobile signer to Shakespeare without copying and pasting bunker strings
### Changed
- Unified the login dialog into a single, streamlined experience across sign-in methods
### Fixed
- Custom fonts now load correctly in previews instead of triggering a runtime error
- Builds no longer fail when a project depends on types-only packages
- Resolved all known security vulnerabilities in dependencies
## [9.13.2] - 2026-04-29
### Changed
- Preview pane now uses the new iframe.diy sandboxing service for a faster, more reliable preview experience
## [9.13.1] - 2026-04-27
### Changed
- AI agents now run commands through a real POSIX-style shell with proper quoting, pipes, redirects, and glob expansion, making multi-step project edits more reliable
- Overhauled the built-in `git` commands used by AI agents, adding `ls-files`, `merge`, `mv`, `restore`, `rev-parse`, `revert`, `rm`, and `switch` alongside improvements across existing git operations
- Overhauled core shell commands (`cat`, `cp`, `find`, `grep`, `ls`, `sed`, `sort`, and more) for closer POSIX behavior and better ergonomics when AI agents work on your project
## [9.13.0] - 2026-04-26
### Added
- Build projects with Tailwind CSS v4, including `@import "tailwindcss"` entry files and third-party v4 plugins like `tw-animate-css`
## [9.12.0] - 2026-04-25
### Added
- Build support for module workers and static asset URLs — projects using `new Worker(new URL('./w.ts', import.meta.url), { type: 'module' })`, `SharedWorker`, and `new URL('./logo.svg', import.meta.url)` now build and run correctly in the preview
- Preview pane grants microphone, ambient-light-sensor, and other device permissions so richer apps can run inside the preview
## [9.11.4] - 2026-04-17
### Fixed
- Preview pane no longer gets stuck on stale builds during rapid edits
### Changed
- Reduce AI costs for Anthropic models via OpenRouter by caching tool definitions across turns
## [9.11.3] - 2026-04-12
### Fixed
- App publish dialog now appears on mobile devices
- Changelog available offline via ServiceWorker precache
## [9.11.2] - 2026-04-06
### Fixed
- Derive private preview subdomains with HMAC to prevent cross-project origin collisions on iframe.diy
## [9.11.1] - 2026-04-05
### Changed
- Switch preview pane to iframe.diy for improved reliability and compatibility
- New users start with OpenCode Zen pre-configured for a zero-setup first experience
- Default nsite gateway changed to shakespeare.to with vanity subdomain support
- Update default Blossom servers and relay lists across deployments and uploads
### Fixed
- Default settings no longer override existing users' recently used models
- Showcase card clone URLs now use proper Nostr URI encoding
- Service worker no longer blocks SvelteKit nsite routes
## [9.11.0] - 2026-04-03
### Added
- Upload a banner image for your app directly from the App dialog
- T-tag editor in the App dialog Advanced section for tagging your app by category
- Delete App button in the App dialog Advanced section when editing an existing app
- Ngit repo and nsite deployment address fields in the App dialog Advanced section
- Auto-fill app name, description, and images from your project's OG tags and web manifest on first publish
### Changed
- Redesigned App dialog with an overlapping banner and avatar card layout
- Reorganized App dialog Advanced section into General, Handlers, and Tags tabs
- Showcase cards now show banner and icon images, and require both to appear in the showcase
- Validation summary above the Save button replaces per-field "Required" labels
- Updated showcase curator to the Shakespeare Builders community list
### Fixed
- Upgrade Nostrify to fix bunker connection issues
## [9.10.4] - 2026-04-02
### Fixed
- Fix Android splash screen showing logo masked to white silhouette instead of full color
## [9.10.3] - 2026-04-02
### Fixed
- Fix Android app showing default Capacitor splash screen and icon colors
## [9.10.2] - 2026-04-02
### Fixed
- Fix Android app showing default Capacitor icon instead of Shakespeare logo in app drawer
## [9.10.1] - 2026-04-02
### Fixed
- Replace default Capacitor vector drawable icons with Shakespeare logo
## [9.10.0] - 2026-04-02
### Added
- Android app powered by Capacitor with deep links, splash screen, and signed release builds
- CI pipeline for building APKs, publishing to GitLab releases, and distributing via Zapstore
- Nsite deployment for decentralized hosting via Nostr
### Changed
- Make version number on mobile settings a clickable link to the changelog with build date
## [9.9.2] - 2026-04-02
### Changed
- Simplify nsite deployment to always use named sites, removing the root site option
### Fixed
- Fix crash in "What's new" toast when used outside the router context
- Truncate long changelog excerpts in update notifications so they fit neatly in the toast
- Left-align changelog page content for better readability
## [9.9.1] - 2026-04-02
### Added
- Changelog page and versioning system with "What's new" toast notifications on updates
- Release skill for managing versioned releases with changelog generation and git tagging
+234 -261
View File
@@ -1,45 +1,35 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- saved from url=(0053)https://www.gnu.org/licenses/agpl-3.0-standalone.html -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GNU Affero General Public License - GNU Project - Free Software Foundation (FSF)</title>
<link rel="alternate" type="application/rdf+xml" href="http://www.gnu.org/licenses/agpl-3.0.rdf">
</head>
<body>
<h3 style="text-align: center;">GNU AFFERO GENERAL PUBLIC LICENSE</h3>
<p style="text-align: center;">Version 3, 19 November 2007</p>
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
<p>Copyright © 2007 Free Software Foundation,
Inc. &lt;<a href="https://fsf.org/">https://fsf.org/</a>&gt;
<br>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.</p>
of this license document, but changing it is not allowed.
<h4 id="preamble">Preamble</h4>
Preamble
<p>The GNU Affero General Public License is a free, copyleft license
for software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.</p>
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
<p>The licenses for most software and other practical works are
designed to take away your freedom to share and change the works. By
contrast, our General Public Licenses are intended to guarantee your
freedom to share and change all versions of a program--to make sure it
remains free software for all its users.</p>
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
<p>When we speak of free software, we are referring to freedom, not
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.</p>
free programs, and that you know you can do these things.
<p>Developers that use our General Public Licenses protect your rights
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.</p>
and/or modify the software.
<p>A secondary benefit of defending all users' freedom is that
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
@@ -47,79 +37,78 @@ encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.</p>
source code to the public.
<p>The GNU Affero General Public License is designed specifically to
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.</p>
code of the modified version.
<p>An older license, called the Affero General Public License and
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.</p>
this license.
<p>The precise terms and conditions for copying, distribution and
modification follow.</p>
The precise terms and conditions for copying, distribution and
modification follow.
<h4 id="terms">TERMS AND CONDITIONS</h4>
TERMS AND CONDITIONS
<h4 id="section0">0. Definitions.</h4>
0. Definitions.
<p>"This License" refers to version 3 of the GNU Affero General Public
License.</p>
"This License" refers to version 3 of the GNU Affero General Public License.
<p>"Copyright" also means copyright-like laws that apply to other kinds
of works, such as semiconductor masks.</p>
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
<p>"The Program" refers to any copyrightable work licensed under this
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.</p>
"recipients" may be individuals or organizations.
<p>To "modify" a work means to copy from or adapt all or part of the work
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.</p>
earlier work or a work "based on" the earlier work.
<p>A "covered work" means either the unmodified Program or a work based
on the Program.</p>
A "covered work" means either the unmodified Program or a work based
on the Program.
<p>To "propagate" a work means to do anything with it that, without
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.</p>
public, and in some countries other activities as well.
<p>To "convey" a work means any kind of propagation that enables other
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.</p>
a computer network, with no transfer of a copy, is not conveying.
<p>An interactive user interface displays "Appropriate Legal Notices"
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.</p>
menu, a prominent item in the list meets this criterion.
<h4 id="section1">1. Source Code.</h4>
1. Source Code.
<p>The "source code" for a work means the preferred form of the work
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.</p>
form of a work.
<p>A "Standard Interface" means an interface that either is an official
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.</p>
is widely used among developers working in that language.
<p>The "System Libraries" of an executable work include anything, other
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
@@ -128,9 +117,9 @@ implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.</p>
produce the work, or an object code interpreter used to run it.
<p>The "Corresponding Source" for a work in object code form means all
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
@@ -141,26 +130,26 @@ includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.</p>
subprograms and other parts of the work.
<p>The Corresponding Source need not include anything that users
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.</p>
Source.
<p>The Corresponding Source for a work in source code form is that
same work.</p>
The Corresponding Source for a work in source code form is that
same work.
<h4 id="section2">2. Basic Permissions.</h4>
2. Basic Permissions.
<p>All rights granted under this License are granted for the term of
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.</p>
rights of fair use or other equivalent, as provided by copyright law.
<p>You may make, run and propagate covered works that you do not
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
@@ -169,73 +158,69 @@ the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.</p>
your copyrighted material outside their relationship with you.
<p>Conveying under any other circumstances is permitted solely under
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.</p>
makes it unnecessary.
<h4 id="section3">3. Protecting Users' Legal Rights From Anti-Circumvention Law.</h4>
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
<p>No covered work shall be deemed part of an effective technological
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.</p>
measures.
<p>When you convey a covered work, you waive any legal power to forbid
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.</p>
technological measures.
<h4 id="section4">4. Conveying Verbatim Copies.</h4>
4. Conveying Verbatim Copies.
<p>You may convey verbatim copies of the Program's source code as you
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.</p>
recipients a copy of this License along with the Program.
<p>You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.</p>
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
<h4 id="section5">5. Conveying Modified Source Versions.</h4>
5. Conveying Modified Source Versions.
<p>You may convey a work based on the Program, or the modifications to
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:</p>
terms of section 4, provided that you also meet all of these conditions:
<ul>
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
<li>a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.</li>
<li>b) The work must carry prominent notices stating that it is
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".</li>
"keep intact all notices".
<li>c) You must license the entire work, as a whole, under this
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.</li>
invalidate such permission if you have separately received it.
<li>d) If the work has interactive user interfaces, each must display
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.</li>
work need not make them do so.
</ul>
<p>A compilation of a covered work with other separate and independent
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
@@ -243,23 +228,21 @@ in or on a volume of a storage or distribution medium, is called an
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.</p>
parts of the aggregate.
<h4 id="section6">6. Conveying Non-Source Forms.</h4>
6. Conveying Non-Source Forms.
<p>You may convey a covered work in object code form under the terms
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:</p>
in one of these ways:
<ul>
<li>a) Convey the object code in, or embodied in, a physical product
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.</li>
customarily used for software interchange.
<li>b) Convey the object code in, or embodied in, a physical product
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
@@ -269,15 +252,15 @@ in one of these ways:</p>
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.</li>
Corresponding Source from a network server at no charge.
<li>c) Convey individual copies of the object code with a copy of the
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.</li>
with subsection 6b.
<li>d) Convey the object code by offering access from a designated
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
@@ -288,20 +271,18 @@ in one of these ways:</p>
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.</li>
available for as long as needed to satisfy these requirements.
<li>e) Convey the object code using peer-to-peer transmission, provided
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.</li>
charge under subsection 6d.
</ul>
<p>A separable portion of the object code, whose source code is excluded
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.</p>
included in conveying the object code work.
<p>A "User Product" is either (1) a "consumer product", which means any
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
@@ -312,17 +293,17 @@ of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.</p>
the only significant mode of use of the product.
<p>"Installation Information" for a User Product means any methods,
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.</p>
modification has been made.
<p>If you convey an object code work under this section in, or with, or
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
@@ -331,137 +312,133 @@ Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).</p>
been installed in ROM).
<p>The requirement to provide Installation Information does not include a
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.</p>
protocols for communication across the network.
<p>Corresponding Source conveyed, and Installation Information provided,
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.</p>
unpacking, reading or copying.
<h4 id="section7">7. Additional Terms.</h4>
7. Additional Terms.
<p>"Additional permissions" are terms that supplement the terms of this
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.</p>
this License without regard to the additional permissions.
<p>When you convey a copy of a covered work, you may at your option
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.</p>
for which you have or can give appropriate copyright permission.
<p>Notwithstanding any other provision of this License, for material you
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:</p>
that material) supplement the terms of this License with terms:
<ul>
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
<li>a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or</li>
<li>b) Requiring preservation of specified reasonable legal notices or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or</li>
Notices displayed by works containing it; or
<li>c) Prohibiting misrepresentation of the origin of that material, or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or</li>
reasonable ways as different from the original version; or
<li>d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or</li>
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
<li>e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or</li>
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
<li>f) Requiring indemnification of licensors and authors of that
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.</li>
those licensors and authors.
</ul>
<p>All other non-permissive additional terms are considered "further
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further restriction,
you may remove that term. If a license document contains a further
restriction but permits relicensing or conveying under this License, you
may add to a covered work material governed by the terms of that license
document, provided that the further restriction does not survive such
relicensing or conveying.</p>
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
<p>If you add terms to a covered work in accord with this section, you
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.</p>
where to find the applicable terms.
<p>Additional terms, permissive or non-permissive, may be stated in the
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.</p>
the above requirements apply either way.
<h4 id="section8">8. Termination.</h4>
8. Termination.
<p>You may not propagate or modify a covered work except as expressly
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).</p>
paragraph of section 11).
<p>However, if you cease all violation of this License, then your
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.</p>
prior to 60 days after the cessation.
<p>Moreover, your license from a particular copyright holder is
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.</p>
your receipt of the notice.
<p>Termination of your rights under this section does not terminate the
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.</p>
material under section 10.
<h4 id="section9">9. Acceptance Not Required for Having Copies.</h4>
9. Acceptance Not Required for Having Copies.
<p>You are not required to accept this License in order to receive or
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.</p>
covered work, you indicate your acceptance of this License to do so.
<h4 id="section10">10. Automatic Licensing of Downstream Recipients.</h4>
10. Automatic Licensing of Downstream Recipients.
<p>Each time you convey a covered work, the recipient automatically
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.</p>
for enforcing compliance by third parties with this License.
<p>An "entity transaction" is a transaction transferring control of an
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
@@ -469,23 +446,23 @@ transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.</p>
the predecessor has it or can get it with reasonable efforts.
<p>You may not impose any further restrictions on the exercise of the
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.</p>
sale, or importing the Program or any portion of it.
<h4 id="section11">11. Patents.</h4>
11. Patents.
<p>A "contributor" is a copyright holder who authorizes use under this
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".</p>
work thus licensed is called the contributor's "contributor version".
<p>A contributor's "essential patent claims" are all patent claims
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
@@ -493,21 +470,21 @@ but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.</p>
this License.
<p>Each contributor grants you a non-exclusive, worldwide, royalty-free
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.</p>
propagate the contents of its contributor version.
<p>In the following three paragraphs, a "patent license" is any express
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.</p>
patent against the party.
<p>If you convey a covered work, knowingly relying on a patent license,
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
@@ -519,17 +496,17 @@ license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.</p>
country that you have reason to believe are valid.
<p>If, pursuant to or in connection with a single transaction or
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.</p>
work and works based on it.
<p>A patent license is "discriminatory" if it does not include within
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
@@ -542,15 +519,15 @@ patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.</p>
or that patent license was granted, prior to 28 March 2007.
<p>Nothing in this License shall be construed as excluding or limiting
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.</p>
otherwise be available to you under applicable patent law.
<h4 id="section12">12. No Surrender of Others' Freedom.</h4>
12. No Surrender of Others' Freedom.
<p>If conditions are imposed on you (whether by court order, agreement or
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
@@ -558,11 +535,11 @@ License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.</p>
License would be to refrain entirely from conveying the Program.
<h4 id="section13">13. Remote Network Interaction; Use with the GNU General Public License.</h4>
13. Remote Network Interaction; Use with the GNU General Public License.
<p>Notwithstanding any other provision of this License, if you modify the
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
@@ -571,56 +548,56 @@ from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.</p>
following paragraph.
<p>Notwithstanding any other provision of this License, you have permission
to link or combine any covered work with a work licensed under version 3
of the GNU General Public License into a single combined work, and to
convey the resulting work. The terms of this License will continue to
apply to the part which is the covered work, but the work with which it is
combined will remain governed by version 3 of the GNU General Public
License.</p>
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
<h4 id="section14">14. Revised Versions of this License.</h4>
14. Revised Versions of this License.
<p>The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may differ
in detail to address new problems or concerns.</p>
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
<p>Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero
General Public License "or any later version" applies to it, you have
the option of following the terms and conditions either of that
numbered version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number
of the GNU Affero General Public License, you may choose any version
ever published by the Free Software Foundation.</p>
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
<p>If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that
proxy's public statement of acceptance of a version permanently
authorizes you to choose that version for the Program.</p>
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
<p>Later license versions may give you additional or different
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.</p>
later version.
<h4 id="section15">15. Disclaimer of Warranty.</h4>
15. Disclaimer of Warranty.
<p>THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</p>
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
<h4 id="section16">16. Limitation of Liability.</h4>
16. Limitation of Liability.
<p>IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
@@ -628,37 +605,37 @@ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.</p>
SUCH DAMAGES.
<h4 id="section17">17. Interpretation of Sections 15 and 16.</h4>
17. Interpretation of Sections 15 and 16.
<p>If the disclaimer of warranty and limitation of liability provided
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.</p>
copy of the Program in return for a fee.
<p>END OF TERMS AND CONDITIONS</p>
END OF TERMS AND CONDITIONS
<h4 id="howto">How to Apply These Terms to Your New Programs</h4>
How to Apply These Terms to Your New Programs
<p>If you develop a new program, and you want it to be of the greatest
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.</p>
free software which everyone can redistribute and change under these terms.
<p>To do so, attach the following notices to the program. It is safest
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.</p>
the "copyright" line and a pointer to where the full notice is found.
<pre> &lt;one line to give the program's name and a brief idea of what it does.&gt;
Copyright (C) &lt;year&gt; &lt;name of author&gt;
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -666,23 +643,19 @@ the "copyright" line and a pointer to where the full notice is found.</p>
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see &lt;https://www.gnu.org/licenses/&gt;.
</pre>
along with this program. If not, see <https://www.gnu.org/licenses/>.
<p>Also add information on how to contact you by electronic and paper mail.</p>
Also add information on how to contact you by electronic and paper mail.
<p>If your software can interact with users remotely through a computer
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.</p>
specific requirements.
<p>You should also get your employer (if you work as a programmer) or school,
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
&lt;<a href="https://www.gnu.org/licenses/">https://www.gnu.org/licenses/</a>&gt;.</p>
</body></html>
<https://www.gnu.org/licenses/>.
+1 -2
View File
@@ -1,2 +1 @@
/assets/* /assets/:splat 200
/* /index.html 200
/* /index.html 200
-27
View File
@@ -1,27 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="166" height="20" role="img" aria-label="🎭 Edit with: Shakespeare">
<title>🎭 Edit with: Shakespeare</title>
<defs>
<mask id="round">
<rect width="166" height="20" rx="3" fill="#fff"/>
</mask>
<linearGradient id="shine" x2="0" y2="100%">
<stop offset="0" stop-color="#fff" stop-opacity=".2"/>
<stop offset="0.1" stop-color="#fff" stop-opacity=".05"/>
<stop offset="1" stop-color="#fff" stop-opacity="0"/>
</linearGradient>
</defs>
<g mask="url(#round)">
<!-- Left label background -->
<rect width="78" height="20" fill="#555"/>
<!-- Right label background -->
<rect x="78" width="88" height="20" fill="#6f42c1"/>
<rect width="166" height="20" fill="url(#shine)"/>
</g>
<!-- Text -->
<g fill="#fff" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,Ubuntu,Cantarell,Noto Sans,sans-serif" font-size="11">
<text x="39" y="14">🎭 Edit with</text>
<text x="122" y="14" font-weight="600">Shakespeare</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

+8 -57
View File
@@ -1,70 +1,21 @@
{
"$schema": "https://json.schemastore.org/web-manifest-combined.json",
"name": "Shakespeare - Open Source AI Builder",
"name": "Shakespeare - AI-Powered Nostr Development",
"short_name": "Shakespeare",
"description": "Build custom apps with AI assistance using Shakespeare, an open-source development environment",
"categories": ["productivity", "devtools"],
"id": "/",
"scope": "/",
"description": "Build custom Nostr websites with AI assistance",
"start_url": "/",
"display": "standalone",
"orientation": "any",
"background_color": "#2b0037",
"theme_color": "#2b0037",
"background_color": "#ffffff",
"theme_color": "#000000",
"icons": [
{
"src": "/shakespeare-192x192.png",
"src": "/favicon.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
"type": "image/png"
},
{
"src": "/shakespeare-512x512.png",
"src": "/favicon.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any"
},
{
"src": "/shakespeare-maskable-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/shakespeare-maskable-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
],
"screenshots": [
{
"label": "Home",
"src": "/screenshot-mobile-home.png",
"sizes": "1179x2556",
"type": "image/png",
"form_factor": "narrow"
},
{
"label": "Project",
"src": "/screenshot-mobile-project.png",
"sizes": "1179x2556",
"type": "image/png",
"form_factor": "narrow"
},
{
"label": "Preview",
"src": "/screenshot-mobile-preview.png",
"sizes": "1179x2556",
"type": "image/png",
"form_factor": "narrow"
},
{
"label": "Desktop",
"src": "/screenshot-desktop.png",
"sizes": "1920x1080",
"type": "image/png",
"form_factor": "wide"
"type": "image/png"
}
]
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

-2
View File
@@ -1,2 +0,0 @@
User-agent: *
Allow: /
Loaded 100 of 668 files, more files were not shown because too many files have changed in this diff. Show more