Commit Graph

17 Commits

Author SHA1 Message Date
Schwitzz 8b208affc4 fix(server): serve updated static assets dynamically and restart stale server on .deb upgrade
CI / build (push) Waiting to run
2026-11-02 14:08:46 -06:00
Schwitzz b01073eac0 fix: resolve Gitea issues #1–#5 (mobile layout, suggestion refresh, import/export icons, context rail default/icon, manual save)
CI / build (push) Waiting to run
Closes #1
Closes #2
Closes #3
Closes #4
Closes #5
2026-11-02 14:00:48 -06:00
Schwitzz aee9c428fc feat(sync): sync Web and Desktop projects with Host Server SQLite and Main Project Directory 2026-10-30 16:35:11 -05:00
Schwitzz 668470da2b fix(auth): unify Desktop and Web SQLite DB path and fix browser autofill crash on Input/AuthGate 2026-10-30 16:18:17 -05:00
Schwitzz 09e9280da6 feat(security): require first-install Admin setup and authenticated login with Argon2id + HttpOnly SHA-256 sessions 2026-10-30 16:06:57 -05:00
Schwitzz 723fafdef8 feat: add Bind Host IP and Allowed Hosts / Reverse Proxy Domain settings 2026-10-30 14:59:09 -05:00
Schwitzz 29dbc27c41 feat: add Web App Port management alongside API Server Port and fix square 512x512 app launcher icon 2026-10-30 14:23:12 -05:00
Schwitzz 1d209fedd2 feat: add tabbed Settings, 10 themes with custom accent/text color pickers, main project directory selector, and export filename/directory controls 2026-10-30 14:06:46 -05:00
Schwitzz fa22a755ee feat: add server settings (toggle on/off, port selection, start on system start) to Settings UI and backend 2026-10-30 13:56:23 -05:00
Schwitzz 6bc681df5f feat: advance and highlight next AI suggestion on accept/deny/copy-to-note, remove copied suggestion from inline list, and add native Linux .deb packaging 2026-10-30 13:01:40 -05:00
Schwitzz 4add429469 feat: resolve all 22 items in Features and Bugs.txt and complete UI polish 2026-10-30 10:57:13 -05:00
Schwitzz a1b5587fcb server: reconcile ai_sessions persistence to Chunk 9 AISession shape
Reshape the ai_sessions table (migration 003) and mapping/routes to the
full AISession contract: title, kind, notes, created_at, last_message_at;
drop legacy role/model/settings. toAISession now maps the new columns and
routes create/patch/messages handlers use the new shape.
2026-10-29 15:03:32 -05:00
Schwitzz fc8eaa86c3 server: fix project_shares audit logging and add share transfer
- Fix PATCH /api/projects/:id/shares/:userId: query SELECT 1 instead of
  SELECT id (project_shares has a composite PK, no id column)
- Add audit logging to existing share grant/revoke routes
- Add POST /api/projects/:id/transfer for ownership handoff
- Remove inline admin user/audit routes from routes.ts (now in admin.ts)
- Remove unused requireAdmin import and userPatch schema from routes.ts
2026-10-29 10:44:58 -05:00
Schwitzz 45f5c505c9 feat(plot): Chunk #5 story whiteboard, timeline & plot beats
Story whiteboard built on React Flow v11: free-form canvas of typed
nodes (character, world, chapter, note, image, group) with draggable
leads-to/contrasts/causes edges, cross-link selectors (chapter/entity),
linked-node badges, and an "Add beats to board" import from the plot.

Plot beats feature set:
- Status/locking (draft/revised/locked) with a progress bar
- Beat templates (three-act, save-the-cat, seven-point, custom)
- Timeline route with search/chapter/character filters
- Entity cross-links (entityIds) on beats and board nodes
- getBoard added to the StorageAdapter contract (local + server) and
  REST endpoints; loadBoard now restores persisted board state

Storage & server:
- PlotBeat type (status, entityIds) across core types, Dexie schema,
  and server mapping/routes/migration (002_plot_beats.sql)
- SQLite-safe column names (beat_order, entity_ids)
- Server seed data for plot beats

UI: accent Button variant, Badge variants, plot/timeline/whiteboard
stylesheets. Tests: templates module, plot-beat store round-trip,
board getBoard. typecheck, lint, test, and build all green.
2026-10-26 19:00:07 -05:00
Schwitzz 4efa71515e feat(entity): Chunk #4 data layer + entity UI (characters & world-building)
Data layer:
- Fuzzy scorer (packages/core/src/fuzzy.ts) with index recovery + unit tests
- Backlink computation (packages/core/src/backlinks.ts) incl. entity-level backlinks
- Consistency checker (packages/core/src/consistency.ts) incl. reciprocity/scope + unit tests
- StorageAdapter contract extended with listEntities/searchEntities/saveEntity/deleteEntity;
  implemented in Local (Dexie) and Server adapters; contract tests cover entity CRUD + ?q= search
- WorldItem.fields now supports list values (keyPeople, rivals); expanded RelationshipKind
- @mention autocomplete extension + picker in the editor package

Entity UI (apps/web/src/features/entities/):
- Generic field renderer (EntityFields) driven by ENTITY_FIELDS/FieldDef
- Tabbed directory with fuzzy search + entity cards (EntitiesView)
- Create/edit/delete drawer (EntityEditor) reusing shared fields
- Relationship editor + force-directed SVG relationship map
- Entity engine stylesheet; wired into nav

Store: project-store entity methods (load/create/update/delete) over the StorageAdapter contract.

CI-green: typecheck, lint, 65 tests, and web build all pass.
2026-10-25 22:42:55 -05:00
Schwitzz 9a965745ee server: actually invoke start() so dev/start scripts boot the server
The entry point defined and exported start() but never called it, so
running 'node --import tsx src/index.ts' imported the module and exited
0 without ever calling app.listen. Add a top-level start().catch() so the
server binds and logs its listen addresses.
2026-10-25 09:44:09 -05:00
Schwitzz 1c9b531996 Implement CHUNK #2: server layer, core schemas/adapters, contract tests, seed
Complete the server-backed storage layer for PubScript so the app can run
against a real Fastify + SQLite backend instead of only local IndexedDB.

Server (@pubscript/server):
- db.ts: better-sqlite3 schema + migrations (users, shares, projects, books,
  chapters, entities, boards, ai_sessions, audit); WAL mode; idempotent
  admin bootstrap via PUBSCRIPT_ADMIN_EMAIL/PASSWORD.
- auth.ts: argon2 hashing, JWT-ish session tokens, guards, auth routes.
- routes.ts: REST CRUD for projects/books/chapters/entities/boards/ai_sessions
  with multi-tenant isolation and optimistic concurrency (baseRev).
- ws.ts: Fastify websocket hub for autosave + presence events.
- mapping.ts: row <-> core type conversion.

Core (@pubscript/core):
- Zod domain schemas (projects, books, chapters, entities, boards, ai_sessions)
  exported from index.
- storage-local.ts (IndexedDB/Dexie) and storage-server.ts (REST) adapters
  implementing the StorageAdapter contract.

Tests & tooling:
- storage.contract.test.ts: parameterized over both adapters; wired as
  `pnpm contract` and added to CI.
- seed.ts (`pnpm --filter server seed`): creates demo project "The Glass Harbor"
  — 3 chapters of prose, 4 linked characters, 1 world location, 6-node board.
- Dockerfile + compose wiring for the server runtime.

Acceptance: seed project opens with 3 chapters, 4 linked characters, 1 board.
2026-10-24 18:31:20 -05:00