Skip to content

Dev#12

Merged
Awaiswilll merged 32 commits into
mainfrom
dev
Jul 6, 2026
Merged

Dev#12
Awaiswilll merged 32 commits into
mainfrom
dev

Conversation

@Awaiswilll

Copy link
Copy Markdown
Owner

Description

Related Issue

Fixes #

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (no functional changes)
  • Performance improvement
  • Security fix

Testing

  • I have run npm test and all tests pass
  • I have run npm run build and the build succeeds
  • I have tested my changes manually
  • I have added tests for new functionality (if applicable)

Screenshots / Videos

Checklist

  • My code follows the project's style guidelines (see CLAUDE.md)
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have not modified any files listed in "Files the Agent Must Never Modify" (see CLAUDE.md)

Security Considerations

  • My changes do not expose API keys or secrets
  • My changes validate all user inputs
  • My changes follow the principle of least privilege

Additional Notes

Awaiswilll added 24 commits July 3, 2026 14:02
…toolbar

- New P2P Dashboard view (P2PDashboard.tsx) with:
  - Real-time peer status and network stats
  - Peer discovery and registration UI
  - Network information panel
  - API endpoint reference table
  - Auto-refresh every 10s

- Global notification system (Notifications.tsx):
  - Toast notifications with info/success/warning/error types
  - Context-based API for any component to trigger notifications
  - Auto-dismiss with configurable duration
  - Slide-in/out animations

- Quick Actions toolbar:
  - New Project, P2P Connect, Network Status, Refresh
  - Live server status indicator (online/offline)

- Navigation updates:
  - P2P Network added to sidebar with Radio icon
  - AI Agent badge removed (graduated from NEW)
  - P2P view type added to types.ts

- P2P Evaluation document (P2P-EVALUATION.md)
  - Full API test results
  - Cross-instance connectivity analysis
  - Recommendations for v0.2.0
- Add opencode status bar to AI Agent showing version (v1.17.9)
- Add opencode terminal panel for running CLI commands from UI
- Add "Host on dweb" button to deploy generated code as hosted service
- Add /api/publish endpoint for registering built projects
- Add /api/projects endpoint for listing published projects
- Add /api/opencode/status and /api/opencode/run endpoints
- Fix TypeScript unused import/var errors across 6 files
- Fix project directory serving with index.html fallback
- Include welcome page and file share HTML (from prior session)
…epo context

- Remove all chat session management, templates, AI provider switching
- Refocus AI Agent as a streamlined opencode development interface
- Add repo context header (branch, commit, file count via /api/repo/status)
- Add 6 quick action buttons: Run Build, Run Tests, Repo Status, Dev Setup, Build & Host, Clean Build
- Add large prompt textarea with Enter-to-run, character count, Run/Clear/Host buttons
- Add scrollable output terminal with auto-scroll and byte counter
- Add published projects panel with persisted project list
- Fix server-side opencode run: proper shell quoting with JSON.stringify
- Fix opencode subcommand: use `opencode run` instead of bare `opencode`
- Fix opencode model: use free DeepSeek model (opencode/deepseek-v4-flash-free)
- Add prompt shorthand expansion (build/test/status/dev/help)
- Increase timeout to 300s for opencode operations
- JS bundle reduced from 450KB to 410KB
- Dynamic port assignment: each port auto-increments if busy, falls back to OS-assign
- UDP multicast discovery (239.255.0.100:49739) for local network peers
- File-based discovery (/tmp/dweb-instances/) for reliable same-machine multi-instance
- P2P file receive/send endpoints: POST /api/p2p/receive, GET /api/p2p/received
- Local peer discovery endpoint: GET /api/p2p/discover-local
- P2PTransfer.tsx: new React view for sending/receiving files between instances
- Wire P2PTransfer into App.tsx routing + Sidebar navigation
- Fix static port 49736 ghost process: auto-fallback to next available port

This enables running multiple dweb instances on same machine with auto-discovery
and direct P2P file transfer between them.
…n browser, refresh consolidation

- Consolidated 2 refresh buttons into 1 comprehensive button
- Added Tor network toggle (kalitorify support) with status indicator
- Added /api/tor/status and /api/tor/toggle server endpoints
- Added /api/instance/spawn and /api/instance/list for spawning new dweb peers
- Added "New Instance" button in Dashboard header
- Added copy-to-clipboard button on opencode output area
- Fixed services to use built-in dweb browser via handleOpenInBrowser
- Added fileshare source view endpoint (/fileshare/api/source)
- Removed File Transfer sidebar tab (replaced by File Browser service)
- Removed File Transfer from quick actions toolbar
…ration tests

- Split dweb.cjs (1298 lines) into 12 focused modules under server/
  (config, helpers, state, router, api-*, relay-tcp, discovery, index)
- All modules under 300 lines per project guidelines (max 212 lines)
- dweb.cjs is now a thin entry point requiring server/index.cjs
- Dynamic port resolution via getter/setter in config module
- Added server/__tests__/server-api.test.ts with 9 integration tests
  covering /ping, /status, /dweb-status, /register, /discover,
  /signal, /collab/services, /fileshare/api/list, CORS, SPA fallback
- Marked all 6 integrations as stubs in Integrations.tsx with
  '🔶 Stub' badge and disabled Test Connection button
- All 22 tests pass, build succeeds (433 KB bundle)
- New server/api-ollama.cjs module with endpoints:
  - GET /api/ollama/status — detect installed, running, available models
  - POST /api/ollama/install — download & install Ollama per platform
  - POST /api/ollama/start — launch Ollama daemon if installed
  - POST /api/ollama/pull — pull a model (default qwen2.5-coder:7b)
- Updated server/api-opencode.cjs: supports useOllama flag to set
  OPENAI_BASE_URL=http://127.0.0.1:11434/v1 and OPENAI_API_KEY=ollama
  when running opencode commands through local LLM
- Registered Ollama routes in server/router.cjs
- Updated AIAgent.tsx with Ollama toggle panel in header:
  - Status indicator (not installed / stopped / running)
  - Install, Start, Pull Model buttons
  - Model selector dropdown
  - "Use for prompts" checkbox to route opencode through Ollama
- Added .blink animation class to global.css
- Changed Dashboard.tsx 'New Instance' button to call window.open(data.url)
  after successfully spawning a new dweb instance
- Added error handling for non-ok responses
- Previously only showed a toast notification without opening the tab
- Create server/api-services.cjs with runningServices Map and persistence
- Add GET /api/services, POST /api/service/start, POST /api/service/stop, GET /api/domain/services
- Demo content generators: HTML pages, SVG images, WAV audio, log files
- Register service routes in router.cjs
- Restore managed services on startup in index.cjs
- Add AbortController-based stop button to AI Agent prompt UI
- Fix Ollama status polling to only run when Ollama panel is open
- Update DWEB_CONTEXT with service management capabilities
… URL

- Add removeHostedService() to state.cjs for P2P de-registration
- Integrate api-services.cjs with addHostedService/removeHostedService
  - P2P-register on /api/service/start, unregister on /api/service/stop
  - Re-register on restoreServices from disk
- Dashboard auto-starts My Static Website as managed service on mount
- Service URLs are dynamic and inline-editable (click URL to edit)
- Add P2P badge to service pills showing global discoverability
- Extend Service type with optional url, dir fields
- Add pill-badge CSS classes for built-in and P2P indicators
- Serve real welcome.html as demo index for Static Site services
- Fix broken dweb:// protocol links in BrowserView default bookmarks
  (replaced with /welcome and /docs HTTP URLs)
- Update Docs.tsx inline documentation content to match current
  project architecture and features
- Update README.md with refactored server/ module structure,
  new installation instructions, updated tech stack, and current
  project layout
- Replace old screenshots with new Windows Desktop screenshots
  showing P2P multi-instance, updated UI, and new features
- Add new screenshots: 2-instances.png, p2p.png, p2p-id.png,
  static-page.png
Enhanced Dashboard with ConnectModal hover tooltips, paginated peer lists (15/page), network status tooltips. Cross-peer .dweb domain resolution with parallel peer query and 60s cache. BrowserView dweb:// HTTP fallback. AI agent SSE streaming with session persistence. Enhanced Ollama auto-detection (WSL/Docker/native). Auto .dweb domain assignment on publish. Peer auto-registration and disk persistence.
…s breakdown

Network section now shows total dweb instances (self + discovered + unique connected remotes, deduplicated) with a pulsing green beacon when network is available, gray dot when offline. Status bar changed from Peers:N to Instances:N with (Nv · Na) visible/anonymous breakdown. Rich tooltips with multi-line breakdown. Removed dead peerCount state.
…tion

Removed standalone P2PDashboard page and its sidebar entry (P2P Network). The P2P dashboard content now lives inside Dashboard.tsx's Network section as a click-to-expand 'Advanced Network Details' panel showing: status cards (peers online, uptime, services, relay status), network info grid (peer ID, ports, IPs, mode, platform), Register Peer + Refresh buttons, and P2P API endpoints reference table. Data auto-refreshes every 15s when expanded. P2P Connect quick action now navigates to Dashboard. Removed p2p-dashboard from View type union.
Fixed peer discovery: replaced broken getRelayPeers() (calls nonexistent /relay/peers) with direct fetch to /discover. Replaced broken getRelayStatus() (calls nonexistent /relay/status) with direct fetch to /dweb-status mapping to RelayStatus shape. Both endpoints are registered in the current server. Filters self out of discovered peers using peerId from /dweb-status. Fixes the issue where 2 instances only showed 1 peer.

Added expandable services: peer services in Discovered Peers list are now clickable — clicking the service area toggles a chevron and shows each service on its own row with server icon, service name, and peer location details. Uses expandedServices Set state to track which peers have expanded service details.
- Moved Tor toggle from standalone section below status bar into the
  main network header row, next to Local/Visible/Anonymous mode buttons
- Compact pill button: purple when active, gray when inactive, Shield icon
- Dot indicator shows running/inactive status at a glance
- Tor tooltip explains state and action on hover
- Removed old standalone Tor section (duplicate functionality)
- Tor toggle remains functional via existing POST /api/tor/toggle endpoint
- Server: add torEnabled/torProxy state to state.cjs with getters/setters
- Server: rewrite /api/tor/toggle with async exec (non-blocking) instead of
  execSync; syncs torEnabled state on toggle
- Server: add /api/tor/test endpoint — tests SOCKS5 proxy reachability via
  net.createConnection to 127.0.0.1:9050
- Server: /api/tor/status now returns torEnabled and torProxy fields
- Frontend: Tor toggle auto-switches onlineMode to p2p-anonymous when
  enabled (Tor provides anonymity, Visible would defeat the purpose)
- Frontend: status bar shows "Tor: Routing" (purple) with proxy tooltip
  when Tor is active
- Frontend: mode switcher shows "via Tor" badge on Anonymous button
  when Tor routing is active
- Frontend: Anonymous mode tooltip shows "via Tor" variant when active
…I table to Docs

- Rename collapsible section from 'Advanced Network Details' to
  'P2P Connections' with peer count subtitle
- Remove 4 redundant status cards (Peers Online, Uptime, Services, Relay)
  from inside the collapsible section
- Move Uptime to the upper Network status bar (shows formatUptime
  with Activity icon)
- Remove full API endpoints table and advancedEndpoints constant
  from Dashboard; add P2P + Tor endpoints to Docs.tsx API Endpoints
- Remove unused advancedPeers state and P2PPeer import
- README: add Tor routing documentation in P2P Networking section
…ept flow

- Moved Discovered Peers + Connected Remotes inside P2P Connections collapsible
- Added Incoming Connection Requests section with Accept/Reject buttons
- Added Send Request button to each discoverable peer
- Added handleAcceptConnection / handleRejectConnection handlers
- Removed standalone Discovered Peers and Connected Remotes sections
- Shows empty states inline within P2P Connections panel
- Add Vite proxy rules for /api/*, /discover, /relay, /signal, /dweb-status
  to forward frontend calls to backend on port 49737
- Auto-start 'My Static Website' and 'File Share' services on server startup
  and client-side useEffect as fallback
- Switch P2P Connections to side-by-side 50/50 columns for Discovered Peers
  and Connected Remotes
- Make Network section collapsible with chevron toggle matching existing UX
- Consolidate 'New Instance' and 'Refresh' buttons into P2P Connections header
- Bump font sizes across P2P, Network, and Services sections for readability
- Remove 'Services & Runtimes' redundant caption from view header
- Fix orphaned P2P Connections JSX (wrapped as const p2pSection)
- New ServicePreviewModal: click a running service to see its real page
  in an iframe preview, view/edit source, and save changes
- Preview tab: inline iframe showing the actual service page content
- Source tab: read-only HTML source display
- Customize tab: editable textarea with Save button that writes to the
  service's directory (backend: POST /api/service/customize)
- Host on .dweb: one-click domain registration via /api/domain/register
  + bind to the service via /api/domain/bind
- Vite proxy: added /service-proxy/{port} to route service traffic
  through the dev server so iframes work same-origin
- Added /welcome and /fileshare to Vite proxy for backend routes
- Fix Dockerfile: npm ci now installs devDeps so 'tsc && vite build' succeeds
- Fix Dockerfile: musl-linkage check uses 'ldd' instead of 'readelf'
- Fix Dockerfile: replace broken opencode install with pm2
- Fix build-wsl-distro.sh: ensure /etc/init.d/ exists before writing service script
- Fix build-wsl-distro.sh: add tarball verification (11 critical files checked)
- Fix build-wsl-distro.sh: replace opencode with pm2
- Update all scripts: GitHub URLs dweb/dweb -> Awaiswilll/dweb
- Add RELEASE-v0.2.0.md and CHANGELOG.md
- Rebuild tarball: 38MB with full frontend, pm2, and all init scripts
@Awaiswilll

Copy link
Copy Markdown
Owner Author

updated

@Awaiswilll Awaiswilll closed this Jul 6, 2026
@Awaiswilll Awaiswilll reopened this Jul 6, 2026
@Awaiswilll Awaiswilll merged commit cc70524 into main Jul 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant