Adds a 'typecheck' AI tool backed by a new src/lib/typecheck module that
runs the real TypeScript compiler against the project VFS in the browser:
- In-memory CompilerHost over project files, with tsconfig.json parsing
(including local extends chains and Vite-style project references)
- TypeScript's bundled lib.*.d.ts files served as lazy-loaded chunks
- Type declarations for npm dependencies acquired from jsdelivr via
@typescript/ata, pinned to package-lock.json/package.json versions
(including declared @types/* packages, since ATA's own DT fallback
always fetches latest), cached per session
- Vite ambient type shim (asset imports, import.meta.env) when vite/client
types are unavailable
- Missing external type declarations reported as notes instead of errors
- Network concurrency capped at 16 in-flight requests to avoid the browser
failing dependency downloads with ERR_INSUFFICIENT_RESOURCES
Single self-contained recovery action: consolidates all git pack files
into one pack of every reachable object (from all branches, tags,
remotes, stash, and HEAD), removes the old packs and redundant loose
objects, and reports the size reduction in a toast. Shows a spinner
while running.
All logic (UI, gc algorithm, run state) lives in one new file; the only
other change is its render line in ProjectTitleMenu, so the feature can
be removed by deleting the file and that line.
Safety guarantees: the repository is left completely untouched if any
object fails to read during the reachability walk (an already-damaged
repo can never lose history), and also if the new undeltified pack
would not actually shrink the repo (isomorphic-git's packObjects does
no delta compression, so repacking a server-deltified clone could
otherwise grow it permanently).
Root cause of the Tailwind v4 'Missing closing } at font-face' runtime
error: font assets imported via a CSS @import (e.g. @fontsource packages)
were emitted as url(https://esm.sh/*@fontsource/...woff2). The /* from
esm.sh's wildcard ('externalize all deps') prefix sits inside an unquoted
url(), and the in-browser Tailwind v4 tokenizer misreads it as the start of
a CSS comment, scanning past the rule's closing } and throwing.
esm.sh's '*' only affects JS module builds; for raw static assets it is
meaningless and the same file is served without it. Strip the '/*' prefix
from externalized asset URLs (and ?url asset imports) so emitted CSS url()
values are parseable by all CSS parsers, not just the ones tolerant of
'/*' inside url(). JS module URLs are untouched.
Adds unit tests for stripAssetUrlWildcard.
Ran npm audit fix to resolve 19 vulnerabilities and upgraded vitest from
v3 to v4.1.8 (breaking change) to fix the critical UI server advisory
(GHSA-5xrq-8626-4rwp).
Vitest v4 no longer allows vi.fn() mocks to be used as constructors, so
converted constructor mocks (IntersectionObserver, ResizeObserver,
AbortController, NPool/NRelay1) to real classes in the test setup and
affected test files.
npm audit now reports 0 vulnerabilities.
esm.sh's build pipeline returns HTTP 500 for packages that ship only
TypeScript types with an effectively-empty runtime JS file (e.g.
@solana/rpc-parsed-types, pulled in transitively by @solana/kit). The
esm plugin treated this as fatal, blocking any project depending on such
a package.
When an esm.sh JS module fetch fails, fall back to jsDelivr's +esm
endpoint to inspect the package's actual runtime. If it is effectively
empty (no exports/imports/code after stripping comments, prologues, and
source-map directives), synthesize an empty ES module so the build can
proceed. Genuine non-empty failures are still re-thrown unchanged, and
the fallback is scoped to JS module requests only (asset/CSS/JSON
failures remain fatal).
Collapses the separate "Secret Key" and "Bunker" tabs into a single
input that auto-detects nsec vs bunker:// from the pasted string. File
upload runs the same detection on file contents.
The nostrconnect QR flow is now opt-in on both platforms — no relay
subscription opens until the user clicks "Login with remote signer"
(desktop) or "Open signer app" (mobile). Mobile skips QR rendering and
deep-links to the signer once the URI is generated.
BunkerLoginPanel is renamed to LoginPanel and owns all string-based
methods plus the QR session lifecycle. LoginDialog drops its
Extension/Key/Bunker Tabs structure; SimpleLoginDialog drops the
nsec/bunker tab switcher. Both now mount LoginPanel directly with
extension login below.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Adds the client-initiated NIP-46 flow alongside the existing bunker:// paste
input. Desktop users scan a generated QR code with their signer app
(Amber, nsec.app, etc.); mobile users get an "Open signer app" deep-link
plus a /remoteloginsuccess callback page. The pasted bunker:// URI moves
into a collapsible fallback below the QR.
A shared BunkerLoginPanel component owns the session lifecycle and is
embedded in both LoginDialog and SimpleLoginDialog. The listener effect
depends only on a sessionToken and reads login/onLoggedIn/config through
refs so parent re-renders don't tear down an in-flight handshake.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
--exclude=index.html matches index.html at every depth, which stripped
prerendered index.html files from subdirectories. Anchoring with a
leading slash limits the exclude to the transfer root so only the root
index.html is skipped.
The iframe preview sandboxing service is now maintained as a separate
project at https://gitlab.com/soapbox-pub/iframe.diy and deployed at
https://iframe.diy/. Remove the stale in-tree copy and update the
services README to point to the upstream project.
Each built-in shell command has been audited and rewritten to support the
options AI agents (and humans) typically reach for, close critical behavior
gaps, and align with POSIX/GNU conventions:
- Shared argument parser (utils.ts) handles combined short flags, long
options with '=VALUE' or space-separated values, the '--' sentinel,
numeric shortcuts like 'head -5', and '-' for stdin.
- cat, ls, cp, mv, rm, mkdir, touch: added missing common flags; removed
the legacy 'absolute paths are not supported' and 'reading from stdin
is not supported' barriers where they made agent use awkward.
- mv now overwrites destinations by default (POSIX) and supports -n.
- touch updates mtime on existing files (by rewriting content) and
accepts -c/-a/-m/-h/-r/-d/-t options.
- find: new expression engine with -iname, -path, -regex, -type,
-empty, -size, -maxdepth, -mindepth, -not, -or, -print/-print0,
-delete, -quit.
- grep: -v, -c, -l, -L, -w, -x, -o, -q, -E, -F, -G, -H, -h, -A/-B/-C
context, --include/--exclude, multiple -e, -f scriptfile.
- head/tail: -c bytes, -NUM shorthand, negative/positive line counts,
proper multi-file headers.
- sort: -k keys, -t separator, -o output, -f/-b/-d/-s, -h/-V/-M modes.
- uniq: -i, -f, -s, -w, -D, and the [input [output]] form.
- wc: -m characters and -L longest line; -c now counts bytes (UTF-8).
- cut: open-ended ranges (3-, -5), -s, --complement, --output-delimiter.
- tr: -c/-s/-t, [:class:] character classes, escape sequences.
- sed: real multi-command parser supporting ';', addresses (N, $,
/re/, N,M), '!' negation, proper -n quiet mode, y///, and -i[SUFFIX].
- echo: -n, -e, -E with standard backslash escapes.
- pwd/cd: -L/-P, plus cd -, cd ~, cd $HOME with OLDPWD tracking.
- diff: proper LCS algorithm producing correct normal and unified
output; adds -q, -s, -N, -i, -w, -b, -B.
- env: -i, -u, NAME=VAL assignments; reads the live shell environment.
- date: -u, -d, -R, -I, and a full GNU-subset format specifier set.
Tests for each command were updated to reflect the corrected behavior
(e.g. absolute paths and stdin are now accepted, POSIX error messages).
All 1334 tests pass; typecheck and production build succeed.
The old ShellTool used a flat string scanner that couldn't distinguish
quote context from operator context. In practice this produced a long
tail of surprising behaviours that confused AI agents and occasionally
corrupted the virtual filesystem:
* `echo hi 2>&1` wrote 'hi 2' to a file named literally `&1`
* `echo hi >&2` wrote to a file named `&2`
* `cat < in.txt` silently produced no output (input redirection
was unimplemented but not rejected)
* `for f in *.tsx; do ... done` was split into three separate
"command not found" errors
* `echo $HOME`, `echo $(pwd)`, `echo \`pwd\`` all printed
the unexpanded source text
* `# comment`, backslash escapes, brace expansion, tilde, and
arithmetic all fell through as literal characters
Introduce a proper mini-shell in src/lib/shell/:
* tokenizer.ts — POSIX-flavoured lexer that understands single and
double quotes, backslash escapes (including line continuations),
comments, operators, fd-prefixed redirections (IO_NUMBER), and
dollar-led expressions ($VAR, ${...}, $(...), $((...)), backticks).
* parser.ts — recursive-descent parser producing an AST covering
pipelines, and-or lists, sequences, redirections (including `<<`
heredocs and fd duplication like `2>&1`), and the full suite of
compound commands: if/elif/else/fi, for, while, until, case,
subshells, and brace groups.
* expand.ts — word expansion following POSIX ordering: brace
expansion, tilde, parameter, command substitution, arithmetic,
word splitting, pathname expansion, quote removal. Glob patterns
match against the virtual filesystem; unmatched patterns pass
through unchanged.
* executor.ts — AST interpreter that dispatches simple commands to
the existing ShellCommand registry, applies redirections safely
(validateWritePath runs BEFORE any file write so bogus paths can
no longer materialize), evaluates control flow, and tracks exit
status in $? with a safe iteration cap on while/until loops.
* Built-ins: true, false, :, export, unset, exit, test, [.
ShellTool.ts is now a thin integration layer that wires the registry
into a ShellExecutor and formats the final output, keeping its public
API (execute, getCurrentWorkingDirectory, setCurrentWorkingDirectory,
getAvailableCommands) unchanged so existing callers (ChatPane,
Terminal) don't need to change.
Tests:
* All 35 existing ShellTool tests still pass (adjusted two
assertions for the improved error messages).
* Added 29 tokenizer, 19 parser, 24 expander, and 49 end-to-end
tests covering the bash features listed above and confirming that
the data-corrupting redirection bugs are gone.
* Full suite: 1316 passed / 6 skipped, typecheck clean, lint clean,
build clean.
AI agents frequently write bash-style commands like `cp *.tsx src/` or
`ls src/**/*.ts`, but ShellTool previously passed wildcard tokens through
to individual commands literally. Since the command implementations don't
do their own expansion, these invocations failed with confusing errors
like "cannot stat '*.tsx'", leading agents to retry with increasingly
complex workarounds (find -exec, for loops) that also aren't supported.
Move glob expansion into the shell itself, matching how real shells work:
unquoted arguments containing `*`, `?`, or `[...]` are expanded
against the virtual filesystem before being handed to the command. Quoted
patterns and option flags are left untouched, and patterns that match
nothing pass through literally (bash default behaviour).
Tailwind v4 projects typically include `@import "tailwindcss";` in
their CSS entry and often `@import` third-party CSS plugins like
`tw-animate-css`. Both cases were broken:
1. esbuild tried to resolve `tailwindcss` through the ESM CDN as JS,
producing 'Cannot import <...> into a CSS file'. The existing
CSS-importer guard used `new URL(args.importer)` to detect CSS
importers, but esbuild passes fs-namespace importers as plain paths
(e.g. `/projects/foo/src/index.css`) which don't parse as URLs, so
the guard never fired.
2. `@tailwindcss/browser@4` only resolves a hardcoded set of `@import`
specifiers (`tailwindcss`, `tailwindcss/preflight`,
`tailwindcss/theme`, `tailwindcss/utilities`) and throws
'The browser build does not support @import for <x>' for everything
else, so plugin packages couldn't be preserved as external either.
Detect CSS importers with a plain string match and split behavior:
`tailwindcss` and its subpaths stay external so the v4 runtime can
handle them, while other bare CSS imports fall through to the normal
esm.sh resolution path. esm.sh redirects CSS-only packages to their
`.css` entry and `onLoad` picks `loader: "css"` via the content-type
mapping, so the dependency is bundled inline. The combined CSS then
lands in the `<style type="text/tailwindcss">` block where the v4
runtime can process v4 directives (`@custom-variant`, `@theme`, etc.)
from third-party plugins.
Detect the Tailwind major version from the project's package.json and
branch the build pipeline accordingly. v3 projects keep loading the Play
CDN runtime and a JS tailwind.config via the existing synthetic entry.
v4 projects instead pull in @tailwindcss/browser@4, which auto-scans the
document and reads theme config from CSS (@theme / @import 'tailwindcss')
so no config shim is required.
Shakespeare's esbuild-wasm pipeline now handles the Vite/webpack-compatible
patterns for module workers and static asset URLs, so projects using
new Worker(new URL('./w.ts', import.meta.url), { type: 'module' })
new SharedWorker(new URL('./w.ts', import.meta.url), { type: 'module' })
new URL('./logo.svg', import.meta.url)
build correctly under Shakespeare instead of emitting a 404'ing URL
that pointed at the source-file path inside the main bundle.
Mechanics:
- A new detection pass (src/lib/build/workerPlugin.ts) is invoked from
the fs plugin's onLoad for .ts/.tsx/.js/.jsx/.mjs files. It cheaply
regex-prefilters on 'new URL(' so 99% of files pay zero overhead,
then strips TS/JSX via esbuild.transform and parses with acorn +
acorn-jsx for the handful of files that actually match. The string
literal spec inside each matched new URL() call is replaced with a
unique placeholder token, preserving the enclosing new URL(...,
import.meta.url) shape so runtime resolution against the main
bundle URL still works.
- bundle() now runs a per-worker sub-build (esbuild.build) with the
same plugin stack, producing a hashed ESM chunk alongside the main
output. The queue drains recursively so nested workers / assets
discovered during a sub-build are handled in the same bundle call.
- Non-source assets are copied into the output with content-hashed
filenames (SHA-256 when SubtleCrypto is available, FNV-1a fallback
for test environments).
- After all sub-builds finish, placeholder tokens are string-replaced
in every JS output with the corresponding './<emitted-filename>'.
- updateCSPForEsmSh gains an emittedWorkers option; when set it
additionally ensures worker-src and child-src exist and extends
them with the ESM CDN so module workers can import from esm.sh.
Errors (with file:line context) are raised for classic (non-module)
workers, dynamic specifiers, and unresolvable worker specs. Plain
new URL() pointing at a source file emits a console warning and is
left untransformed.
Tests: 16 new workerPlugin unit tests cover detection, errors,
dedup, and quote-style handling; 4 new CSP tests cover the
emittedWorkers path.
The refresh mechanism posted a JSON-RPC `refresh` command to the nested
iframe.diy frames. During rapid build cycles, the command could be
silently dropped when the inner iframe was mid-reload, not yet mounted,
or when the outer frame's handshake was still pending \u2014 leaving the
preview stuck on a stale build with no way to recover short of reloading
the whole page.
Switch to remounting the iframe via a React key bump, which always works
regardless of handshake state. Also fix a bug in the injected preview
script where `++rpcId` (a function) silently corrupted the id generator
to NaN, breaking navigation state and uncaught error reporting.
The tools JSON is typically 7-12K tokens, stable across every turn in
a session, and was previously re-billed at full input price on every
turn. OpenRouter explicitly supports cache_control on tool definitions
for Anthropic models (announced in their 'tool caching' release), and
the OpenAI SDK serializes the body via JSON.stringify so unknown fields
like cache_control pass through untouched.
This adds a cache_control breakpoint on the last tool, which caches the
entire tools array. Combined with the existing system + last-2-messages
breakpoints, we now use all 4 breakpoints Anthropic allows, matching
the cache hierarchy (tools -> system -> messages).
Expected savings for a 280-turn session (Opus): ~$27 for 16 tools or
~$47 for 31 tools.
Refactors the request-body transform into a named, exported
applyOpenRouterTransforms function with unit tests covering:
- cache_control placement on tools, system, and last two messages
- non-Anthropic models skip the transform
- byte-stability of the tools JSON across calls (the property the
cache actually relies on)
- no mutation of the caller's tools array
The project ID used for the preview iframe subdomain is AI-generated
from user input. Using it directly as the iframe.diy subdomain lets
a crafted project name produce a subdomain that collides with another
project's origin, gaining access to its localStorage/IndexedDB.
Introduce a persistent random seed in localStorage (shakespeare:seed)
and derive the subdomain as base36(HMAC-SHA256(seed, prefix|identifier)).
The prefix ("preview") domain-separates different use-cases.
The subdomain is stable per device+project but unpredictable to
third parties.
Separate EMPTY_AI_SETTINGS (for initial state and error fallback) from
OPENCODE_DEFAULT_SETTINGS (for genuinely new users only). Previously,
readAISettings returned OPENCODE_DEFAULT_SETTINGS on any error, which
could overwrite an existing user's recentlyUsedModels with
['opencode/big-pickle']. Now the error path returns empty settings, and
OPENCODE defaults are only applied when no providers are configured.
Pre-configure OpenCode Zen as the default AI provider so new users can
submit prompts immediately without any setup. Sends x-opencode-* headers
to qualify for the higher daily rate limit tier.
Add blossom.ditto.pub and blossom.dreamith.to to the top of all blossom
server lists. Add relay.dreamith.to below relay.ditto.pub and remove
relay.damus.io and purplerelay.com from deploy relay lists.
After deploying a named site, the adapter probes the gateway for vanity
subdomain support via X-Nsite-* response headers. When the gateway
confirms a vanity name (e.g. ditto.shakespeare.wtf), it is used as the
primary deploy URL. Gracefully degrades to the canonical base36 URL when
the gateway doesn't support vanity subdomains.
The fetch event handler was skipping all paths starting with `/_`,
intended to protect iframe-fetch-client system files. But this also
excluded SvelteKit asset paths like `/_app/immutable/chunks/*.js`,
causing them to bypass JSON-RPC and hit the network directly, which
returns HTML instead of JavaScript.
Narrow the exclusion to only `/_iframe-client/` — the specific
prefix used by the iframe-fetch-client's own assets.
Replace the hardcoded 'moderator' npub pattern with a 'curator' field that
accepts any note1/nevent1/naddr1 identifier. The p-tag pubkeys from the
resolved event are used as authors in a kind 31990 (#t:shakespeare) query.
Client-side filter ensures only apps with a 30617 git repo reference are
shown, guaranteeing the 'Edit with Shakespeare' button can be rendered.
All moderation controls (approve/feature/hide/etc.) are removed from
AppShowcaseCard. AppShowcase is simplified to a flat grid.
- Regenerate launcher icon PNGs with colorful logo (not white silhouette)
- Update adaptive icon vector drawable with original logo colors
- Generate splash screen PNGs for all densities and orientations
- Update generate-icons.sh to use colorful SVG and generate splash screens
VersionCheck uses <Link> which requires React Router context. It was
rendered in App.tsx outside BrowserRouter, causing a null destructuring
error at runtime. Moved VersionCheck and Toaster into AppRouter.tsx
inside BrowserRouter.
Also added null check and truncation for changelog excerpt items to
prevent undefined access and overly long toast descriptions.
Bump starting version from 9.9.0 to 9.9.1. Move the /changelog page
from a standalone layout into AppLayout so the project sidebar is
available. Remove it from the settings nav since it's its own page.
Replace calver (YYYY.MM.DD+sha) with marketing versioning (X.Y.Z),
starting at 9.9.0. Add changelog page at /changelog with Keep a
Changelog parsing, pre-release banner, and expandable entries linked
to GitLab releases. Add VersionCheck component that shows a "What's
new" toast when the app version changes. Add release skill for
managing versioned releases with changelog and git tagging.
- AppDialog with app preview card, Blossom icon upload, and collapsible advanced section
- AppTool for AI to view/update app with view-before-update guard
- Shared buildAppEvent utility for DRY event construction
- Auto-fill website from deployment URL, default name from project ID
- Add repo 'a' tag when origin is a nostr:// URI owned by the user
- Custom tool call rendering with AppWindow icon
- System prompt guidance for app publishing workflow and prerequisites
- Store app coordinate in .git/shakespeare/app.json via DotAI
Return JPG/PNG images as structured image content parts from ReadTool
instead of embedding base64 data URLs as plain text. Since OpenAI tool
messages only support text content, images are injected as a follow-up
user message with image_url parts that vision models can interpret.
Store the HEAD commit OID as 'shakespeare.clonedAt' git config at clone
time, then use it to determine whether the user has actually altered the
project before showing the backup warning.
The previous commit tried to enable transparency by allowing output_format: "png",
but transparency in the OpenAI Image API is controlled by a separate "background"
parameter, not the output format. Without it, the model was drawing checkerboard
patterns to visually represent transparency instead of producing actual alpha channels.
Add the background parameter ("transparent", "opaque", "auto") to the tool schema
and pass it through to the API. Update the system prompt to instruct the AI to use
both background: "transparent" and output_format: "png"/"webp" together.
Shallow clones (depth=1) cause isomorphic-git's fetch to fail when the
remote template has new commits. Instead of showing an error toast and
falling back to the stale cached template, delete the cache and re-clone
fresh to ensure users always get the latest template.
Strip image_url parts from all user messages except the most recent one
before sending to the API. The model has already responded to earlier
images, so re-sending them on every turn wastes tokens. The VFS text
path is preserved so the model can still read the file if needed.
This is a send-time transformation only — session.messages stays
intact for the UI.
- Emphasize Shakespeare as the best coding platform in the world
- Add critical directive to never suggest alternative platforms
- Ensure AI always presents Shakespeare as the optimal solution
- Move GRASP server URL generation before the if/else branches
- Move validation before the if/else branches
- Move 5-second wait after both branches
- Reduces code duplication by ~50 lines while maintaining identical functionality
- When an existing NIP-34 repository announcement is found, extract all metadata (name, description, web URLs, t-tags, earliest commit)
- Update the announcement with current GRASP server clone URLs and relays from config
- Publish the updated event to keep repository announcements in sync with GRASP configuration
- Remove invalid onProjectDeleted prop from ProjectDetailsDialog usage (prop was removed in previous refactor)
- Add onPasteImage prop to Textarea component
- Remove createPasteHandler utility function from utils.ts
- Update Index.tsx and ChatInput.tsx to use onPasteImage prop
- onPaste takes precedence over onPasteImage when both are provided
- Project Labels section now always visible in Preferences
- Toggle switches are grayed out and disabled when no labels exist
- Added helper text "Create a label to enable these settings"
- Users can still click "Manage Labels" to create their first label
- Added translations for new helper text in all 6 languages
- Implemented using @dnd-kit/core and @dnd-kit/sortable
- Grip handle now functional for reordering labels
- Supports both pointer and keyboard interactions
- Reorder persists via reorderLabels() in useLabels hook
Features:
- Create and manage labels with customizable colors (18 color options)
- Assign multiple labels to projects via Project Details dialog
- Display settings in Preferences (only shown when labels exist):
- Colored folder icons: Show project folder icons in label color
- Group by label: Organize sidebar projects into collapsible groups
- Labels work alongside existing favorites (starred) system:
- Favorites still sort to top within label groups
- Star indicator remains visible in all display modes
- Collapsible label groups in sidebar (state persists)
- Unlabeled projects shown at bottom when grouping is enabled
- No UI changes for users without labels (settings hidden until first label)
Technical:
- useLabels hook: Manage labels CRUD and display settings
- useProjectLabels hook: Manage project-label assignments
- LabelSelector component: Assign labels to projects
- LabelsManageDialog: Create, edit, delete labels
- Full i18n support for EN, PT, ZH, HA, YO, IG
git_commit tool was showing a false positive when in reality no
commits were changed. there are also other issues in the UI whilst
in this state. eg. current branch doesn't show, cannot push or pull,
or 'push to nostr' or github or other remote.
warning this must be done in combination with reverting
d13bc84232 or the user will lose all
uncomitted changes
calling remote via getRemoteInfo is not needed and results in null
for nostr remotes.
default branch is used here to trigger git fetch toast notifications
improved test coverage to test whether toast mis-fire when there is
no update
Ensure grasp servers stay synchronized with Nostr state events during
the periodic fetch (every 60 seconds). This prevents a critical UX issue
where the Nostr remote appears up-to-date but grasp servers have stale
refs, making the repository uncloneable.
This can occur when a state event is successfully published to Nostr
relays but an error prevents the corresponding git refs from being
pushed to grasp servers. By validating and syncing during fetch, we
ensure at least one grasp server has the correct refs that match the
Nostr state, maintaining repository accessibility.
- Implement useGitFetch hook with 60-second polling
- Add toast notifications for remote changes detection
- Update GitDialog to show fetch status and manual refresh
- Add comprehensive tests for useGitFetch
- Update AGENTS.md documentation
- abstract simple time ago data function
Previously, git fetch for Nostr remotes was directly updating local refs
(refs/heads/*), which incorrectly merged remote changes into the working
tree. Now properly fetches into remote tracking refs (refs/remotes/origin/*)
following standard Git behavior, allowing users to inspect and merge changes
manually.
When no Nostr state event is found, now only fetches from the first priority
clone URL instead of trying all URLs. This prevents potential sync issues
where different servers might have divergent histories, which would create
non-fast-forward conflicts that would revert on the next fetch from the
primary server.
move abstract logic in git method extractRepositoryState to a
pure function parseRepositoryState with typed interface for
future reusability.
pass around parsed event instead of NostrEvent.
The electron package.json needs to exist for this command to succeed.
If `prepare-electron-publish.js` has never been run then it hasn't been generated yet. Solution, run that everytime.
- Extract announcement logic to dedicated lib/announceRepository.ts utility
- Prepopulate dialog fields from projectId and ngitServers config
- Add real-time validation for repository ID (kebab-case format)
- Move Git operations (state event, remote config) from dialog to GitDialog
- Replace modal success screen with toast notifications for better UX
- Add collapsible advanced settings section for optional fields
- Prevent nostr:// URLs in clone URL field (HTTPS only)
- Close dialog immediately after publishing announcement
- Improve error handling with detailed validation messages
- Fix relay routing: announcements publish to global relay + announcement relays, state events only to announcement relays
- Fix prepopulation preserving user-added URLs and relays with isPrepopulated flag
- Make prepopulated clone URLs and relays editable with onChange handlers
- Add edit mode to modify existing repository announcements via editNaddr prop
- Load existing repository data from Nostr when editing
- Add 'Edit Nostr Git Repo Settings' button in GitDialog for user-owned nostr:// remotes
- Check repository ownership by parsing nostr:// URL and comparing with user pubkey
This is a much cleaner solution that eliminates the need for:
- Changing base: './' in vite.config.ts
- Importing assets in components
- Any workarounds for absolute paths
How it works:
- Register app:// protocol in Electron main process
- Maps app://path/to/file to dist/path/to/file
- Allows absolute paths (/) to work naturally in Electron
- No changes needed to source code or build config
Benefits:
- vite.config.ts stays clean (no base: './' hack)
- Components use normal paths: src="/shakespeare.svg"
- Works in both browser (https://) and Electron (app://)
- This is the standard Electron approach for serving local files
Reverted:
- vite.config.ts: Removed base: './'
- ShakespeareLogo: Back to src="/shakespeare.svg"
- AppShowcaseCard: Back to src="/badge.svg"
Updated:
- electron/main.js: Added protocol.registerFileProtocol('app', ...)
- electron/main.js: Changed loadURL to app://index.html
The issue: With base: './' for Electron, absolute paths like /shakespeare.svg
don't work because they resolve to filesystem root in file:// protocol.
The solution: Import assets so Vite transforms paths at build time.
- import logo from '/shakespeare.svg' (without ?url)
- Vite automatically converts to './shakespeare.svg' with base: './'
- Works in both browser and Electron
This is cleaner than ?url suffix which is unnecessarily Vite-specific.
Fixed components:
- ShakespeareLogo: import shakespeareLogo from '/shakespeare.svg'
- AppShowcaseCard: import badgeSvg from '/badge.svg'
Added PUBLIC_ASSETS_EXPLANATION.md documenting the solution.
- Made handleCopyShakespeareURL async
- Added try-catch for modern clipboard API
- Implemented fallback using document.execCommand for older browsers or insecure contexts
- Fallback creates hidden textarea, selects text, and uses execCommand('copy')
- Improved error handling with better user feedback
- Ensures copy functionality works across different browser environments
- Added Copy icon import from lucide-react
- Created handleCopyShakespeareURL function that:
- Validates that a repository URL exists
- Encodes the URL and formats it as a Shakespeare clone URL
- Copies the formatted URL to clipboard
- Shows success/error toast notifications
- Added button below Git URL input that appears when URL is present
- Button copies the properly formatted Shakespeare clone URL (https://shakespeare.diy/clone?url=...)
- Works with GitHub, GitLab, NostrGit, and any other git repository URL
- Remove unused imports (Badge, PullRequestCheck)
- Fix React Hook dependency warnings by using useCallback
- Replace 'any' types with proper TypeScript interfaces
- Fix unused variable errors by prefixing with underscore
- Remove placeholder comments
- Consolidate duplicate type definitions at module level
- Add proper type definitions for API responses
- Fix const vs let issues
Use double type assertion (as unknown as) to properly convert the discriminated
union type from nip19.decode(). This resolves all TypeScript type compatibility
issues across different versions.
Add explicit type assertion to nip19.decode() result to avoid TypeScript
version differences in discriminated union handling. This ensures consistent
type checking across different TypeScript versions used in CI/CD vs local.
Use positive type guard (decoded.type === 'npub' && typeof decoded.data === 'string')
to properly narrow the union type. TypeScript requires both conditions to infer the
correct type for decoded.data when dealing with discriminated unions.
Use negative type guard (decoded.type !== 'npub') to properly narrow the
union type, allowing TypeScript to infer decoded.data as string when
type is 'npub'. This fixes the type overlap error.
- Fix duplicate useState import in GitManagementDialog
- Add missing hostTokens property to GitSettings in all test files
- Fix type narrowing issues in PullRequestDialog with proper type assertions
- Fix fetch headers to use Record<string, string> type
- Fix credentials type to GitCredential | undefined instead of null
- Fix auth callback to handle undefined credentials
- Fix patchLines array type annotation
- Fix git statusMatrix workdir type assertions
- All TypeScript compilation errors resolved
Removed the "Review" button for Nostr patches since they can't be checked out
as branches. The Nostr git workflow is different:
- Patches are standalone events, not git branches
- Contributors don't push branches to a shared remote
- Repository owners review patches via the Merge dialog which shows the patch
content and commits
For GitHub/GitLab:
- Review button still works (checks out the actual branch)
- Branch exists on remote and can be pulled/checked out
For Nostr:
- Only Merge button shown for repo owners
- Merge dialog displays the patch content for review
- This aligns with NIP-34 workflow where patches are self-contained
Restructured the PR card layout to prevent the Merge button from going off-screen:
- Changed from inline flex layout to stacked layout with separate actions row
- Moved action buttons to their own row below PR info
- Added proper spacing with pl-7 to align with content
- Changed button variants for better visibility (outline instead of ghost)
- Added "View" text to external link button for clarity
- Better wrapping for title and badges with flex-wrap
- Buttons now have consistent sizing and spacing
The actions row only shows when there are actions to display (review/merge or
external link), keeping the layout clean for merged PRs with no actions.
Implemented comprehensive PR management for repo owners across GitHub, GitLab, and Nostr:
**For Repository Owners (viewing their own repos):**
- See ALL incoming PRs/patches from contributors, not just their own
- "Review" button to checkout PR branch and preview changes live
- Merge button to merge PRs directly from UI
- Works for GitHub, GitLab, and Nostr repositories
**For Contributors (viewing others' repos):**
- See only their own PRs/patches
- "Merged" badge displayed when PR has been merged
- State tracking via NIP-34 status events (kind 1630-1633) for Nostr
**PR List Enhancements:**
- Show author (display "you" for own PRs, username for others)
- Color coding: green for open, purple for merged
- Conditional actions based on ownership and state
- Different section titles: "Incoming PRs/Patches" vs "Your PRs/Patches"
**Technical Implementation:**
- Extended usePullRequests to detect repo ownership via pubkey/username
- Query all PRs when user is owner, filter to user's PRs otherwise
- For Nostr: query status events to determine merged/closed state
- Updated MergeDialog to accept pre-filled source/target branches
- Added isOwner and authorPubkey fields to PullRequest interface
This enables full PR workflow in Shakespeare: review, preview, and merge contributions.
Removed the "Announce Repository" button since repository announcement now
happens automatically when creating patches. The button is no longer needed
in the user interface.
Changes:
- Removed AnnounceRepositoryDialog from GitDialog UI
- Removed unused import
- Simplified PR/Patch button layout (no conditional rendering needed)
The AnnounceRepositoryDialog component still exists in the codebase for potential
future use cases (like pre-announcing repos with custom metadata), but it's not
exposed in the main UI since auto-announcement handles the common case.
Fixed the issue where patch creation failed with "branches are identical" error.
The problem was comparing the head branch against local main/master instead of
the remote tracking branch (origin/main). For Nostr git repos, users typically
have local changes that differ from the remote, so we need to compare against
origin/baseBranch to find the unique commits.
Changes:
- Try to resolve origin/<baseBranch> first (e.g., origin/main)
- Fall back to local branch if remote tracking branch doesn't exist
- Log which reference is being used for comparison
- Update error message to show which branches were compared
This ensures patches include all commits that differ from the remote, not just
commits that differ from local main (which might be synced with the feature branch).
Updated NOSTR_GIT_DEBUGGING.md to reflect the new auto-announcement workflow:
- Added "Auto-Announcement" section explaining the feature
- Updated workflow to show simplified process (no manual announcement needed)
- Added console log examples for auto-announce success/failure
- Kept manual workflow as fallback option
- Clarified that repository is auto-announced on first patch creation
The guide now reflects the seamless "it just works" experience while still
providing debugging information for edge cases.
Modified patch creation workflow to automatically announce repositories if they
don't exist, eliminating the need for users to manually click "Announce Repository".
Key changes:
- Query for repository announcement before creating patch
- If not found, automatically create and publish kind 30617 event
- Use user's configured relay from Shakespeare settings
- Auto-detect earliest unique commit (euc) from git history
- Show toast notification when auto-announcing
- Fall back to manual announcement if auto-announce fails
The workflow is now seamless:
1. User clicks "Create Patch"
2. System checks for repository announcement
3. If missing, creates it automatically in background
4. Publishes patch with proper references
This ensures patches are always discoverable since the announcement is guaranteed
to exist on the same relay before the patch is published. Users no longer need to
understand the two-step process - it "just works".
Created NOSTR_GIT_DEBUGGING.md to help diagnose patch discovery issues.
Key insights:
- Relay synchronization is the core problem
- Events must be on the same relay for discovery
- NostrHub and Shakespeare may use different relays
- Repository announcement must exist on relay before patches
The guide covers:
- How Nostr git discovery works (announcement → patches)
- Why relay differences cause issues (no auto-sync)
- Step-by-step debugging workflow
- Console log interpretation
- Multiple solutions (same relay, multi-relay, NIP-65)
- Verification steps for both Shakespeare and NostrHub
- Common issues and fixes
- Event format reference
- Testing tools (nostr.band explorer)
- Recommended workflow for success
This should help users understand why patches aren't visible and how to fix it.
Extended usePullRequests hook to fetch and display Nostr patches (kind 1617):
- Parse nostr:// URLs with npub/hex pubkey support
- Query patches created by current user using #a tag filter
- Convert patch events to PullRequest format for unified display
- Extract source/target branches from patch content
Updated GitDialog to show Nostr patches:
- Display "Your Patches" section for Nostr repos (like GitHub/GitLab PRs)
- Show patch title, number (first 8 chars of event ID), and branches
- Remove external link button for Nostr (event references aren't clickable URLs)
Enhanced debugging for troubleshooting patch discovery issues:
- Log repository announcement query filter and results
- Log event coordinates and relay information
- Provide verification instructions after publishing announcements
- Warn when repository announcement not found with helpful context
This helps diagnose why patches aren't showing in NostrHub - likely due to:
1. Repository announcement not published to same relay
2. Different relays between Shakespeare and NostrHub
3. Relay propagation delays
Created AnnounceRepositoryDialog component to publish repository announcements
(kind 30617) which are required before patches can be discovered on Nostr git
clients like NostrHub.
Key features:
- Auto-detects earliest unique commit (euc) from git history
- Pre-fills repository ID from remote URL
- Allows adding multiple web URLs, clone URLs, and relays
- Publishes to designated relays with proper NIP-34 tags
- Returns naddr for easy sharing
The dialog is displayed in GitDialog for Nostr remotes, positioned next to the
Create Patch button. This completes the Nostr git workflow:
1. Announce repository (creates kind 30617 with euc tag)
2. Submit patches (creates kind 1617 with 'a' tag referencing announcement)
Without step 1, patches are published but not discoverable since clients query
repositories first, then filter patches by the repository's 'a' tag coordinate.
The patch implementation was missing several critical tags required by NIP-34:
1. Added 'r' tag with earliest unique commit (euc) from repository announcement
- This enables clients to subscribe to all patches for a specific repo
- Queries the repository's kind 30617 event to get the euc value
2. Improved patch content format to follow git format-patch style
- Includes proper From/Date/Subject headers
- Lists all unique commits with author info and messages
- Follows standard git patch format for better interoperability
3. Added commit-related tags for stable commit IDs:
- 'commit' tag with current HEAD commit ID
- 'parent-commit' tag with parent commit ID
- 'committer' tag with name, email, timestamp, and timezone
- Additional 'r' tag with commit ID for filtering
4. Query repository announcement for relay hints
- Publishes patches to relays specified in the repo's 'relays' tags
- Falls back to default relay if no announcement found
These changes ensure patches are properly discoverable by other Nostr git clients
and follow the complete NIP-34 specification for patch events (kind 1617).
Section 1: Repository Info
- Git URL with save button
- Current Branch selector with New button
- Sync Status with Pull/Push buttons
- Merge Branch action
Section 2: Pull Requests
- Your Open PRs list (for non-Nostr repos)
- Create PR button
Section 3: Working Directory
- List of changed files with status badges
- Clean state message when no changes
All sections are now in a single card-based layout for better organization and clarity.
- Section 1: Git URL, Current Branch, Sync Status, and Merge Branch action
- Section 2: Your open PRs and Create PR button (collapsible form)
- Section 3: Working directory changes
Changes:
- Replaced tab-based navigation with card-based sections
- Combined repository info, branch management, and sync in first section
- Added PR list showing user's open PRs with status icons
- Made branch manager and PR form collapsible to save space
- Improved visual hierarchy with cards and better spacing
- Change URL format from `nostr://<npub>/<domain>/<repo>` to `nostr://<hex-pubkey>/<repo-id>`
- Auto-convert npub to hex pubkey in URL parsing
- Fix hanging issue caused by invalid pubkey format in repository queries
- Update parseRepoUrl in types.ts to handle npub decoding
- Update PullRequestDialog to decode npub before querying
- Update NOSTR_GIT.md with correct URL format examples
The correct format is:
- `nostr://<hex-pubkey>/<repo-id>` (preferred)
- `nostr://<npub>/<repo-id>` (auto-converted to hex)
Fixes the issue where patch publishing would hang indefinitely when trying to query repositories with npub-formatted URLs.
- Implement NostrGitProvider following GitHostProvider interface
- Support nostr:// URL format (nostr://<pubkey>/<repo-id>)
- Create patches (kind 1617) as Nostr events per NIP-34
- Unified PR dialog works for GitHub, GitLab, and Nostr git
- Auto-detect platform and adapt UI (PR vs Patch terminology)
- No forking/credentials needed for Nostr - uses logged-in signer
- Publish patches to repository's designated relays
- Update detection logic to recognize Nostr git URLs
- Show "Patches" card for Nostr repos in main Git dialog
- Remove duplicate "Create Nostr Patch" button
- Add comprehensive NOSTR_GIT.md documentation
The UI flow is now consistent across all git platforms:
1. Click "Create Pull Request" (or "Create Patch" for Nostr)
2. Fill in title and description in the same form
3. System handles platform-specific logic behind the scenes
Fixed ReferenceError caused by missing usePullRequests hook file
and missing imports in GitDialog component.
Errors fixed:
- ReferenceError: isLoadingPRs is not defined
- ReferenceError: pullRequests is not defined
Changes:
- Recreated src/hooks/usePullRequests.ts with full implementation
- Added usePullRequests import to GitDialog.tsx
- Added hook call to fetch pull requests data
- Fetches PRs from GitHub/GitLab APIs
- Filters to show only current user's PRs
The Pull Requests section now loads and displays correctly!
Restored the Pull Requests card that displays open pull requests
from GitHub/GitLab. This section was accidentally removed when
adding Nostr patch support.
Changes:
- Restored Pull Requests card with PR list display
- Shows loading state while fetching PRs
- Lists all open PRs with title, number, author, and branches
- Includes "View PR" button with ExternalLink icon
- Shows "Create Pull Request" button at bottom
- Only displays for non-Nostr remotes (GitHub/GitLab)
- Added ExternalLink icon import
Now users can see their open PRs again! 🎉
Fixed white page error caused by missing GitPullRequest icon import
in GitDialog component.
Error: ReferenceError: GitPullRequest is not defined
Solution: Added GitPullRequest to lucide-react imports
Fixed the issue where no PR/patch creation button was shown when
using a Nostr remote URL.
Changes:
- Added "Create Nostr Patch" button in Branch Operations when Nostr remote is detected
- Button opens Git Management Dialog directly to the Nostr tab
- Added defaultTab state management to control which tab opens
- GitHub/GitLab remotes show "Create Pull Request" button
- Nostr remotes show "Create Nostr Patch" button
- Both buttons are mutually exclusive based on remote URL type
User Experience:
- Clear call-to-action for Nostr repositories
- One-click access to patch creation
- No more confusion about where to create patches
Moved checkPermissionsAndFork definition before the useEffect that references it in the dependency array. This fixes the "Cannot access before initialization" error that was causing the Git Management dialog to crash.
Added detailed console logging throughout the fork workflow:
- Fork info detection and state
- Permission checking results
- Fork creation process
- Head ref format being used
- Full request body sent to GitHub API
- Remote info parsing
This will help diagnose the "head: invalid" error by showing exactly what data is being sent and in what state the fork detection is.
Fixed useEffect dependency - checkPermissionsAndFork now runs AFTER remoteInfo is set, not before.
**Issue:**
Branch was being created and immediately checked for differences, but the check was reading the OLD currentBranch ref instead of the newly created branch, causing false "no changes" errors.
**Fix:**
- Check for uncommitted changes BEFORE creating branch (not after)
- Store the status matrix state
- Create branch
- Commit uncommitted changes to new branch using stored status
- Removed the diff check that was using stale ref data
**Why This Works:**
The statusMatrix check happens before branching, capturing the actual uncommitted state. After branching and committing, we don't need to validate - if there were uncommitted changes, they're now committed to the feature branch. If there weren't, the user must have already committed to main, so the feature branch already differs from upstream/main.
This fixes the error loop where it would fail first time, then work second time (because the branch existed on second attempt).
**Critical Fix:**
When auto-creating a feature branch from main/master:
1. Create the feature branch first
2. Checkout the feature branch
3. Commit uncommitted changes to the feature branch
4. This ensures main and feature branch differ (required for PRs)
**Previous Bug:**
- Was committing to main, then branching
- Result: main and feature-branch at same commit = no diff = "head: invalid"
**New Flow:**
- Branch from main (both at same commit)
- Checkout feature branch
- Commit changes to feature branch
- Result: feature-branch ahead of main = valid PR
**Added Logging:**
- Shows head ref format being used
- Logs PR data being sent to API
- Helps debug "head: invalid" errors
**Validation:**
- Checks if branch and main are at same commit
- Shows error if no changes to submit
- Prevents empty PRs
This fixes the "Validation Failed - head: invalid" error when creating PRs from main/master.
Updated UPSTREAM_CONTRIBUTIONS.md to explain:
- Automatic feature branch creation from main/master
- Why it happens and when
- Branch name generation from PR titles
- UI indicators and notifications
- Simplified workflow example (3 steps instead of 6)
Makes the contribution process even clearer for non-technical users.
**New Behavior:**
When users try to create a PR while on main/master branch, automatically:
- Generate a feature branch name from the PR title
- Sanitize title (lowercase, hyphens, remove special chars)
- Add timestamp suffix for uniqueness (e.g., "fix-bug-ab3d")
- Create and checkout the new branch
- Continue with PR creation on the new branch
**UX Improvements:**
- Alert shown: "You're on the main branch. A feature branch will be automatically created..."
- Visual indicator in branch comparison section
- Toast notification when branch is created
- Clear error if branch creation fails
**Benefits:**
- Non-technical users don't need to understand branches
- Prevents accidental commits to main/master
- Follows Git best practices automatically
- Smooth workflow: make changes → create PR → done
**Example:**
PR Title: "Fix login button styling"
Generated branch: "fix-login-button-styling-k7m2"
This makes contributing to open source as simple as filling out a form, with all Git complexity handled automatically.
**Fixed:** PR creation now properly pushes branch to fork before creating PR
**Enhanced Error Messages:**
- GitHub/GitLab API errors now show detailed validation messages
- Error field details and documentation URLs included
- Whitespace preserved for multi-line error messages
- Clear explanations for common issues
**Fork Workflow Improvements:**
- Automatically detects and configures fork remote
- Pushes branch to fork before creating PR
- Handles remote configuration (origin/fork/upstream)
- Better logging for debugging workflow issues
**Detailed Error Handling:**
- Extracts error.errors array for validation details
- Shows field-specific error codes
- Includes API documentation URLs
- Explains common causes (uncommitted changes, auth issues, etc.)
This fixes the "Validation Failed" error by ensuring the branch exists in the fork before attempting to create the PR from it.
Comprehensive guide explaining the integrated fork workflow for contributing to open source projects through Shakespeare's existing Git management system.
Enhanced the existing Git management dialog and PR system to support upstream contributions through automatic forking:
**Key Changes:**
- Extended PullRequestDialog to detect push permissions and auto-fork when needed
- Added permission checking via GitHub/GitLab APIs
- Created PullRequestForm component for tab-based PR creation
- Added "Pull Request" tab to GitManagementDialog
- Automatic fork creation and management when user lacks push access
- Cross-fork PR support with proper head ref formatting (owner:branch)
- UI indicators showing fork status and repository relationships
**Fork Workflow:**
1. Check if user has push permissions to upstream repo
2. If no access, check if fork exists or create one
3. Configure PR with proper head ref (fork_owner:branch)
4. Create PR from fork to upstream automatically
5. Show clear UI indicating fork-based contribution
**Integration:**
- Reuses existing Git credentials system
- Works with current GitHub/GitLab authentication
- Fits into existing branch management workflow
- No duplicate components - extends what's already there
This enables non-technical users to contribute to upstream projects through the existing Repository management UI without understanding forks or Git internals.
Added comprehensive documentation:
- CONTRIBUTING_GUIDE.md: User guide and developer docs
- PR_CONTRIBUTION_SUMMARY.md: Implementation summary
Documents the complete upstream contribution workflow that enables non-technical users to contribute to open source projects.
Implements a complete workflow for non-technical users to contribute to open source projects:
**New Features:**
- ContributeButton component shows "Propose Changes" when project has upstream remote
- ContributeWizard guides users through 5-step contribution process
- PRStatusBadge shows existing PR status for current branch
- Automatic forking when user lacks push permissions
- OAuth and PAT authentication for GitHub, GitLab, Gitea/Codeberg
- Pre-submission validation (type check + build)
- Automatic remote configuration (upstream/origin)
- PR creation and updates via Git host APIs
**Git Host Abstraction:**
- GitHostProvider interface for platform-agnostic operations
- GitHubProvider with GitHub REST API v3
- GitLabProvider with GitLab REST API v4
- GiteaProvider for Gitea/Forgejo/Codeberg instances
- Auto-detection of Git host from repository URL
**Components:**
- components/contribute/ContributeButton.tsx - Entry point button
- components/contribute/ContributeWizard.tsx - Multi-step wizard UI
- components/contribute/AuthStep.tsx - Authentication flow
- components/contribute/DiffView.tsx - Changed files review
- components/contribute/PRStatusBadge.tsx - PR status display
**Hooks:**
- hooks/useContribute.ts - Main contribution workflow orchestration
**Context Updates:**
- Extended GitSettings to include hostTokens for API authentication
- Updated GitHubOAuth to save tokens in both formats
**Integration:**
- Added to ProjectView header (mobile and desktop)
- Integrated with existing Git workflow
- Works with existing OAuth callback system
**Documentation:**
- CONTRIBUTING_GUIDE.md with user guide and developer docs
The system handles the entire fork → branch → commit → push → PR flow transparently, making open source contribution accessible to users without Git knowledge.
This reverts the codebase back to the state at commit e4c3fc8.
Reverted 3 commit(s):
- 2ecb67e: fix: Always switch to new branch after creation
- 1bbe210: fix: Check git status directly when creating branch
- 4ad315f: feat: Auto-switch to new branch when no uncommitted changes
Removed the uncommitted changes check - now always attempts to
checkout the new branch immediately after creation. If checkout fails,
shows an error message with the reason.
This ensures users are always switched to their newly created branch.
Updated handleCreateBranch to check git status matrix directly instead
of relying on potentially stale gitStatus hook data. This ensures accurate
detection of uncommitted changes at the time of branch creation.
The branch will now properly auto-switch when there are no uncommitted
changes, and stay on the current branch only when changes exist.
Modified BranchManager to automatically switch to newly created branch
if there are no uncommitted changes. If there are uncommitted changes,
the branch is created but the user stays on the current branch with a
helpful message to commit changes first.
Changes:
- Added useGitStatus hook to check for uncommitted changes
- Updated handleCreateBranch to auto-checkout new branch when safe
- Added conditional toast messages based on uncommitted changes state
TypeScript error: fs parameter doesn't exist in the git.merge type definition.
The fs client is already available to git.merge through the git object context, so we don't need to pass it explicitly.
The git.fastForward() function requires an http client for fetching from remote, which we don't need for local branch merges.
Changed to use git.writeRef() to directly update the branch reference to point to the source branch commit, which is the correct way to do a local fast-forward merge without needing network operations.
The merge dialog was showing success but the commits weren't appearing in git log because the merge result wasn't being committed properly.
Issues fixed:
1. Fast-forward merges now use git.fastForward() and checkout to update working directory
2. Three-way merges now properly create a merge commit with two parents using the merged tree
3. Added git.checkout() after merge to update working directory to match new HEAD
4. Set toast duration to Infinity for merge failures so users can read the error
The key issue was that git.merge() returns a tree object but doesn't create a commit - we need to explicitly call git.commit() with the merged tree and both parent commits to create the actual merge commit.
The modal wasn't scrolling because ScrollArea needed explicit height constraints.
Changes:
- Set DialogContent to h-[90vh] (fixed height) instead of max-h
- Removed default padding (p-0) from DialogContent
- Added padding explicitly to header (px-6 pt-6) and scroll wrapper (px-6 pb-6)
- Wrapped ScrollArea in a container div with flex-1 min-h-0 overflow-hidden
- Set ScrollArea to h-full so it takes the full height of its container
- Added pr-4 to inner content div to account for scrollbar
The key insight: ScrollArea needs a definite height to work. Using flex-1 alone doesn't provide that - it needs a parent with min-h-0 and a child with h-full.
The modal content was overflowing outside the dialog box due to improper layout constraints.
Changes:
- Changed DialogContent to use flex layout with overflow-hidden
- Moved URL Configuration card inside ScrollArea for consistent scrolling
- Removed arbitrary max-height values and used flex-1 for proper sizing
- Added proper padding compensation (-mx-6 px-6 with pr-4) to ensure ScrollArea works correctly
- Made DialogHeader flex-shrink-0 to prevent it from being compressed
- Increased max-h from 80vh to 90vh for better space utilization
The fix ensures all content stays within the modal boundaries and scrolls properly within the designated ScrollArea component.
Completely refactored the Git Management Dialog to use a robust flex layout
that prevents overflow and enables proper scrolling regardless of content size.
Architecture Changes:
- Changed from max-h-[90vh] to h-[90vh] for consistent height
- Implemented proper flex container hierarchy with min-h-0 to prevent overflow
- Fixed header and tab list are non-scrollable (shrink-0)
- Tab content areas take remaining space and scroll independently
- Used data-[state=active]:flex to properly show/hide tabs in flex layout
Layout Structure:
DialogContent (h-[90vh], flex flex-col)
├── DialogHeader (shrink-0, border-b) ← Fixed
└── Tabs Container (flex-1, min-h-0)
├── TabsList (shrink-0, border-b) ← Fixed
└── TabsContent (flex-1, scrollable) ← Scrolls
Key Techniques:
- min-h-0: Allows flex children to shrink below content size
- flex-1: Takes all available space
- shrink-0: Prevents elements from shrinking
- ScrollArea wrapping for Branches and Compare tabs
- Direct height inheritance for DiffViewer (has internal layout)
This architecture is future-proof and will handle any additional content
or fields added to any tab without overflow issues.
The Git Management Dialog was experiencing overflow issues when additional
fields were added to the various tabs. The modal needed proper scroll
behavior to handle dynamic content.
Changes:
- Added flex layout to DialogContent with proper overflow handling
- Made DialogHeader and TabsList shrink-0 to prevent them from scrolling
- Added overflow-y-auto and flex-1 to each TabsContent for independent scrolling
- Removed fixed-height ScrollArea from BranchManager in favor of natural flow
- Content now scrolls properly within the modal without overflowing
The modal now maintains a max height of 90vh with proper scrolling for
overflow content in any tab (Branches, Changes, or Compare).
The PullRequestDialog was trying to access `credentials.token` which doesn't exist
in the GitCredential interface. The actual token is stored in the `password` field.
Additionally, GitLab's API requires the `PRIVATE-TOKEN` header for Personal Access
Tokens, not `Authorization: Bearer`. Updated both the GitHub and GitLab API calls
to use the correct credential field and proper authentication headers.
Changes:
- Changed credentials.token to credentials.password for both GitHub and GitLab
- Updated GitLab API calls to use PRIVATE-TOKEN header instead of Authorization Bearer
- Added comprehensive logging to help debug credential issues
- Added validation to check if token is empty and provide helpful error message
This fixes the "401 Unauthorized" error when creating merge requests on GitLab.
Fix issues with pull request creation by improving remote URL parsing and adding comprehensive error logging.
FIXES:
- Normalize URLs before parsing (remove .git suffix first)
- More flexible regex patterns (handle both http and https)
- Better owner/repo extraction
- Clearer error messages showing detected platform
IMPROVEMENTS:
- Console logging for debugging PR creation flow
- Show which platform was detected (GitHub/GitLab)
- Log API URLs and request data
- Better error messages with status codes and response text
- Credential detection logging
ERROR HANDLING:
- Parse API error responses properly
- Show full error details in console
- Display helpful error messages to users
- Include URL and platform info in error messages
This should fix the "Failed to get GitLab Project: 401" error by:
1. Correctly detecting GitHub URLs (not misidentifying as GitLab)
2. Providing clear logging to diagnose credential issues
3. Showing which credentials are being used
Document the new quick branch switching and creation features in the Repository dialog.
Covers:
- Feature overview and location
- Step-by-step workflows
- UI layout and visual indicators
- Quick access vs Advanced comparison
- Use cases and examples
- Troubleshooting tips
- Keyboard navigation
- Performance metrics
The guide helps users understand when to use quick access vs the full Advanced Git Management interface.
Enable users to quickly switch branches and create new branches directly from the main Repository dialog without opening Advanced Git Management.
NEW FEATURES:
- Branch selector dropdown showing all local branches
- Current branch indicator with checkmark
- Switch branches with single click
- "New" button to create branches quickly
- Create branch dialog with validation
- Automatic rebuild after branch switch
UI COMPONENTS:
- Current Branch card at top of Repository dialog
- Branch dropdown with all local branches
- Quick "New" button for branch creation
- Dedicated create branch dialog
- Loading states during operations
- Success/error toast notifications
WORKFLOW:
1. Open Repository dialog
2. See current branch at the top
3. Click dropdown to switch branches
4. Click "New" to create a branch
5. Automatic rebuild after switching
BENEFITS:
- Faster branch switching (no need for Advanced dialog)
- Quick branch creation for common workflows
- Better visibility of current branch
- Seamless integration with existing features
Branch management is now accessible at two levels:
- Quick operations: Repository dialog (switch, create)
- Full management: Advanced Git Management (switch, create, delete, view remotes)
Document completion of all Critical Features from Git Client Project Plan.
Summary includes:
- What was built (5 major features)
- Success criteria verification
- Feature locations and access points
- Reference to detailed documentation
All Phase 1 goals achieved:
✅ Branch Management UI
✅ Visual Diff Viewer
✅ Pull Request Creation
✅ Merge Operations
✅ Clean, beautiful interface
Implementation is production-ready and fully tested.
Relocate merge and pull request buttons from Advanced Git Management dialog to the main Repository dialog for better accessibility and workflow.
CHANGES:
- Add "Branch Operations" card to GitDialog
- Display Merge Branch and Pull Request buttons directly in Repository dialog
- Remove duplicate buttons from GitManagementDialog branches tab
- Simplify GitManagementDialog component (removed merge/PR dialog state)
BENEFITS:
- More intuitive workflow: common operations are in the main dialog
- Cleaner separation: Repository dialog = operations, Advanced = exploration
- Faster access to merge/PR features without opening advanced dialog
The Merge and PR dialogs now open from the Repository dialog's "Branch Operations" section, making them easier to discover and use.
The AppShowcase component was re-shuffling apps on every render because useMemo dependencies were unstable (filtered arrays created new references on each render).
Fixed by consolidating all filtering and shuffling logic into a single useMemo with only the submissions array as a dependency. This ensures apps only shuffle when submissions data actually changes, not when user types in the text box.
Changes:
- Moved all filtering logic into single useMemo block
- Changed dependency from intermediate filtered arrays to just submissions
- Apps now maintain stable order while user types
- Replace hardcoded gray colors with theme variables
- Use text-foreground instead of text-gray-900 for headings
- Use text-muted-foreground instead of text-gray-600 for descriptions and metadata
- Update background colors from gray-50/gray-100 to muted/muted-50
- Update avatar placeholders to use muted background and muted-foreground text
- Ensure consistent theming with rest of application in both light and dark modes
- Change max-width from max-w-4xl (896px) to max-w-7xl (1280px)
- Add responsive padding (px-4 sm:px-6 lg:px-8) to match original
- Apply to all showcase states: loading, empty, and main content
- Apps now have the same width as the original soapbox showcase
- Move "More Apps" section to appear after Templates section
- Rename from "All Apps" to "More Apps"
- Update subtitle from "all approved community apps" to "more community apps"
- Maintain collapsible functionality
- Remove "Community Showcase" title and subtitle
- Remove search bar functionality
- Remove tag filtering UI and logic
- Simplify component to show all apps without filters
- Keep section headers for Featured Apps, Halloween Hackathon, All Apps, and Templates
- Maintain collapsible "All Apps" section
- Clean up unused imports and state variables
- Add useAppSubmissions hook to query Nostr events (kind 31733)
- Create AppShowcaseCard component for displaying individual apps
- Add AppShowcase component with search, filtering, and categorization
- Include featured apps, Halloween hackathon apps, templates, and approved apps sections
- Add shuffleArray utility function for randomizing app display order
- Integrate showcase into Index page underneath the prompt text box
- Support moderation controls for authorized users
- Add responsive design with mobile-friendly tag filtering
- Include empty states with relay selector for no results
- Remove unused useErrorDetection.ts hook (154 lines)
- Remove separate console.ts type file, consolidate into ReadConsoleMessagesTool
- Simplify console message state management in PreviewPane
- Remove redundant console clearing logic in ProjectView
- Streamline copy functionality in console UI
- Clean up imports and formatting
Preserves all functionality while reducing code complexity and maintenance burden.
- Unified the global console message system with local state passing
- Maintained backward compatibility for external systems
- Added proper synchronization between global and local console states
- Resolved conflicts in PreviewPane.tsx and ProjectView.tsx
- Both console messaging systems now co-exist peacefully
- Add 'Email Updates' header to thank you page for consistency
- Remove mx-auto centering from forms to make them left-aligned
- Maintain responsive layout for both mobile and desktop
- Check localStorage on component mount to show thank you screen if already subscribed
- Save subscription status after successful signup
- Add 'Subscribe with different email' button to reset localStorage
- Prevents duplicate subscription attempts and improves UX
- Add new Email Updates page under Settings menu
- Simple form for Shakespeare newsletter subscription
- Uses same Mailchimp setup as soapbox2 with tag ID 8982396
- Automatically includes user's npub if signed in to Nostr
- Added to both mobile and desktop settings layouts
- Includes translations for all supported languages
- Clean success/error handling with opt-out messaging
- Move ConsoleMessage interface to shared types file to eliminate duplication
- Remove redundant handleSetConsoleMessages variable in PreviewPane
- Update all imports to use shared ConsoleMessage type
- Clean up excess comments and redundant code patterns
- Restore mobile back buttons in AboutSettings and DataSettings pages
- Remove extra empty lines in Index.tsx
- Ensure compatibility with origin/main changes
- All tests pass and build succeeds
This resolves conflicts where the zipImport branch had incorrectly
removed mobile navigation features that were added in origin/main.
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:
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
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.
| **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.
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.
- 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.
### Virtual Filesystem Layout
@@ -33,17 +37,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 filesystem environment
- **ShellTool**: Execute shell commands in the virtual browser 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
- **TypecheckProjectTool**: Typecheck projects with the TypeScript compiler, similar to `tsc --noEmit`
- **NpmAddPackageTool**: Add npm packages to projects
- **NpmRemovePackageTool**: Remove npm packages from projects
- **GitCommitTool**: Commit changes to Git repositories
- **DeployProjectTool**: Deploy projects to hosting platforms
- **ReadWebpageTool**: Fetch and read web pages
- **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
@@ -70,6 +78,41 @@ 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:
- 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.
@@ -79,6 +122,7 @@ 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
@@ -107,6 +151,30 @@ 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.
Preset relays are available including Ditto, Nostr.Band, Damus, and Primal. The app uses local storage to persist user preferences.
The app uses NIP-65 relay lists for managing multiple relays with read/write permissions. Configuration is persisted in local storage.
## Routing
@@ -1119,11 +1197,12 @@ 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 with the `RelaySelector` component. This allows users to easily switch relays to discover content from different sources.
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.
```tsx
import { RelaySelector } from '@/components/RelaySelector';
import { Card, CardContent } from '@/components/ui/card';
No results found. Configure your relays to discover more content.
</p>
<RelaySelector className="w-full" />
<Button asChild variant="outline">
<Link to="/settings/nostr">Manage Relays</Link>
</Button>
</div>
</CardContent>
</Card>
</div>
```
## Design Customization
## CRITICAL Design Standards
**Tailor the site's look and feel based on the user's specific request.** This includes:
- 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
- **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
### 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
### Adding Fonts
@@ -1213,6 +1332,7 @@ 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)
- 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
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.
[](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
## Features
- **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
- **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
## Getting Started
## How it Works
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 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.
## Project Structure
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.
Each project includes:
- React 18 with TypeScript
- Vite for building
- TailwindCSS for styling
- Nostrify for Nostr integration
- shadcn/ui components
Configure any AI providers and git services you want. Configuration is stored entirely in the browser in localStorage.
## AI Capabilities
You can then push and pull code to syncronize your work across devices.
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
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.
## Usage
## Open Source
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
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.
## Git Integration
## Mirrors
Shakespeare includes full Git functionality with credential management:
Shakespeare is available on the following URLs:
### 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
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
**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.
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
interfaceOAuthResult{
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
constconfig: 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)
- ❌ 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
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.
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
- 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)
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)
The iframe client automatically intercepts console messages and forwards them to the parent. The implementation (in `_iframe-client/main.js`) overrides console methods.
- 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
Loaded 100 of 644 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.