Commit Graph

29 Commits

Author SHA1 Message Date
Rokojori 7c754e4256 feat: auth session refresh overhaul — all 7 phases
Fixes two root-cause bugs: browser tabs racing the same single-use refresh
token, and Electron never refreshing after its one-shot startup call.

Browser:
- TokenUpdater: periodic 5-min + activity-triggered pings to /api/auth/me,
  EventSlot-driven valid/refreshing/expired/network-error state.
  Web Locks leader election (one tab runs the updater; others follow via
  BroadcastChannel). Falls back to leader-always without Locks API support.
- GuardedCall: three-tier wrapper (user/editor/silent) with pre-flight state
  check and tier-specific retry. Replaces ad-hoc fetch calls in Editor and
  editor-shell layout save/load.
- auth-connector: jwtMiddleware proactively rotates access-token cookie
  within 15 min of real expiry (server clock, no client-side exp needed).

Electron:
- Periodic token updater in main process: reads JWT exp directly, uses
  server-corrected clock (Date response header offset) for comparisons,
  refreshes within 15 min of expiry. Replaces one-shot startup refresh.
- Session heartbeat: running instance writes accessToken + timestamp every
  10 s. New instance mints its own session via POST /api/auth/new-session
  if heartbeat is ≤30 s old — skips login screen transparently.
- Retired plaintext last-password.txt auto-login.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-02 22:39:56 +02:00
Rokojori 6766f6d467 history: Saturday, 2 August 2026 — Claude API + Claude Code providers for rojo-chat-panel
- Claude API provider (@anthropic-ai/sdk): streaming, separate session history,
  tool use support, rojo-settings-panel claude endpoint type
- Claude Code subprocess provider: --print --output-format stream-json --verbose,
  --session-id/--resume multi-turn, shell:false Windows fix,
  rojo-settings-panel claude-code endpoint type (no API key)
- Rojo local-mode fixes: detection, creation, system-prompt delivery
- Three subprocess bugs fixed: missing --verbose, stdin blocking, cmd.exe mangling

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-02 12:32:11 +02:00
Rokojori 87a42fd5a5 feat: per-project per-device layout persistence (.roject/layout-<deviceId>.json)
Full tab tree (panels → sections → tab-containers → tabs + open files) saved and
restored per project per device. FileEditorPanel extended with getCurrentFile().
.roject/ hidden from file tree listings. Boards, outline, and history updated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-31 20:43:08 +02:00
Rokojori 0b47e4cb97 feat: page editor unified toolbar, floating block menu, insertion triggers, drag-to-reorder, InputDialog
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-31 15:43:04 +02:00
Rokojori 6fb2133b2c feat: file tree UX, page editor toolbar, EditorConsole, console-panel
File tree: open-state preserved on refresh, "Mark As Root Directory" moved
to context menu, "Open >" submenu for alternate editors, context menu label
truncated to filename (20 chars max). Page editor: mode buttons moved into
toolbar (sidebar removed). EditorConsole singleton + console-panel tab for
centralised message log with es-info header fade. openDocumentIn fix: derives
editorTag from panelElement.tagName, not registry. History folder renames
corrected (25-Friday→24-Friday, 30-Wednesday→30-Thursday, 31-Friday added).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-31 13:17:40 +02:00
Rokojori 99a8f591e9 history: local filesystem access, remote proxy, file-tree custom elements, project-list tabs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-30 22:02:14 +02:00
Rokojori 2e5f3235be Tools Update 2026-07-30 08:44:46 +02:00
Rokojori dba0fdca1e history: tab container updates, EditorPanel interfaces, editor-shell bug fixes, workspace docs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-25 22:50:14 +02:00
Rokojori 3e25a419ca history: add session entry for 25 July 2026
Page editor panel: structured .page format, block registry, rich-text
toolbar, default-roject theme, wrapSelection helper.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-25 20:52:01 +02:00
Rokojori 4a72363aaf session 2026-07-18: Electron local dev fixes, nav z-index, board/outline/history update
Electron fixes:
- extractToken (auth-connector): Bearer header checked before cookie — prevents stale
  Electron session cookie from winning over injected token
- JWT_CLOCK_TOLERANCE env var: passed to jwt.verify as clockTolerance; set to 7200
  in .env to absorb ~65 min clock skew between Windows dev machine and prod auth server
- Startup token refresh: main.ts calls POST /api/auth/refresh before opening main window;
  shows login on failure instead of opening with expired tokens
- Quit-on-login fix: createMainWindow() is async; login-success now awaits it before
  closing the login window (zero windows → app.quit() race was killing the process)
- Credential persistence: email + password stored in userData; remember-me checkbox
  controls save behaviour; clear button removes saved files; fields pre-fill on load
- Electron session cookies cleared in createMainWindow() to avoid stale token reuse

CSS: z-index: 10 on .pld-nav (project-list-default) — fixed mobile nav buried under rows

Boards: cleared Done lane, added Electron fixes and nav z-index entries; backlog MVP
entry for local testing solution; bugs.html: 401-handling bug moved to Done.
Outline: auth card updated with extractToken order note and JWT_CLOCK_TOLERANCE docs.
History: Friday 18 July entry expanded with session 2 cards.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-18 08:37:47 +02:00
Rokojori a8bfc95d1c Connector Rewrite 2026-07-17 13:37:48 +02:00
Rokojori 1e8ec50f6e Update Server Auth FIx 2026-07-16 18:44:10 +02:00
Rokojori 403499341f tunnel: Electron agent, production deployment, streaming, Roject integration, chunk animation
— Electron Tunnel Agent app (tray, login, tunnel list, start/stop/delete/create)
— tunnel.rokojori.com deployed (nginx WS upgrade, systemd, certbot, port 3003)
— Streaming relay protocol: res_start/res_data/res_end replaces single-shot response
— Roject: browse-tunnels button in rojo-settings-panel, /tunnels/browse proxy route
— Roject: LLM chat via tunnel (TUNNEL_SERVER_URL, /v1 path, dual-source JWT)
— rojo-chat-panel: typeText() splits large relay chunks for smooth streaming appearance
— Boards, outline, and history updated

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-16 15:46:51 +02:00
Rokojori 93f8c7bb33 tunneling: brainstorm, Phase 1 relay server built + tested, boards + history updated
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-16 07:27:48 +02:00
Rokojori 7c6fca54f9 history+boards+outline: styles.rokojori.com built, font migration, add-subdomain guide
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-15 20:39:06 +02:00
Rokojori acba5c819b redesign: project home, default theme, user settings, groups removed from UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 22:27:03 +02:00
Rokojori 5bcabe2c67 boards: task/bug/backlog boards, outline shortened, workspace index improved
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 14:34:47 +02:00
Rokojori 7b9f7a1fb9 electron: desktop app shell — login, JWT auth, header injection, token persistence
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 13:31:11 +02:00
Rokojori 54267624bf history+outline+guides: CI/CD pipeline done, agent memory guide, CI improvements noted
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-13 21:56:25 +02:00
Rokojori ea58d0d102 history+outline: Roject JWT integration with rokojori-auth 2026-07-13 15:37:19 +02:00
Rokojori 605afa3e66 history: rokojori-auth built and deployed, Roject integration planned
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-13 13:54:11 +02:00
Rokojori e11a434725 email: add EmailService SMTP layer (Nodemailer, swappable EmailSender interface)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-12 18:50:04 +02:00
Rokojori debaeb2b6f history+outline: production deployment, nginx+systemd, build fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-12 16:14:58 +02:00
Rokojori 0b91bdcc90 refactor: restructure project into source/ and build/; add source/pages/ + copy-pages build step
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-12 14:01:01 +02:00
Rokojori f871804e5b history: nginx reverse proxy on Server A, directory restructure plan
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-12 13:05:53 +02:00
Rokojori 7ffa2f7588 history: CodePanel — CodeMirror editor, FileEditorRegistry, file routing by suffix 2026-07-11 13:16:16 +02:00
Rokojori 55acdd3f12 history: RojoChatPanel — streaming AI chat, LangChain backend, tab integration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-10 20:18:15 +02:00
Rokojori 7b0c01560c history: rojo chibi bone animator prototype
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-06 22:05:27 +02:00
Rokojori 1dc40fa22c initial commit: source, workspace docs, locale system, gitignore 2026-07-06 19:28:59 +02:00