Commit graph

18 commits

Author SHA1 Message Date
Till JS
0077752456 fix(type-check): clear the last five failures — monorepo type-check is now 76/76 green
After the mobile-app deletion unblocked \`@context/mobile\`, five more
pre-existing failures surfaced across shared packages and two services.
All were silent-masked by the postinstall \`|| true\` for months.

- **shared-ai**: \`planner/loop.ts\` imported \`ToolSchema\` from
  \`../tools/function-schema\`, which only imports (not re-exports) the
  type. Fixed to import from the source (\`../tools/schemas\`).
- **shared-logger**: \`typeof window !== 'undefined'\` blows up under
  tsconfigs that don't include the DOM lib (e.g. uload-server's
  \`bun-types\`-only config), because shared-logger is consumed via
  source import. Replaced with a \`globalThis\`-indirected check that
  compiles under any lib configuration.
- **shared-hono**: \`credits.ts\` returned \`res.json()\` directly as
  \`Promise<T | null>\`. Modern \`@types/node\` / undici types return
  \`unknown\` strictly — cast to \`T\` at the boundary so the generic
  contract is explicit.
- **uload-server**: \`routes/analytics.ts\` + \`routes/email.ts\` still
  imported \`AuthUser\` from a \`middleware/jwt-auth\` module that was
  deleted during the migration to \`@mana/shared-hono\`. Replaced with
  \`AuthVariables\` from shared-hono, which matches the actual context
  shape set by \`authMiddleware()\`.
- **manavoxel/web**: \`guestSeed\` collection entries were wrapped in
  arrow functions, but \`local-store\` expects \`T[]\` directly and
  iterates \`seed.length\` — which on a function is 0. The "guest
  seed" was silently dead; eager-evaluating \`generateGuestWorld()\`
  once and sharing the result fixes both the type and the runtime.

Verified: \`pnpm run type-check\` from the repo root now exits 0 —
76/76 tasks successful, no failures. First fully green state since
well before the postinstall \`|| true\` was introduced.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 15:53:07 +02:00
Till JS
c34175afab fix(type-check): repair silently broken per-package type-check scripts
Yesterday's postinstall fix (\`d1d37749f\`) removed the \`|| true\`
guards, which in turn exposed that \`pnpm run type-check\` at the
root had been red for a long time but nobody noticed. Several per-
package scripts were genuinely broken:

- \`@mana/test-config\`: \`vitest.config.base.ts\` and \`.svelte.ts\`
  pass \`all: true\` to the coverage block. Vitest 4 removed that flag
  (including uncovered files is now the default), so tsc reports
  \`'all' does not exist in type 'CoverageOptions'\`. Removed both.
- \`@mana/credits\`: \`tsconfig.json\` include glob had
  \`"src/**/*.svelte"\`, which makes tsc try to parse .svelte files
  as TS source. It can't. Removed .svelte from include; added
  \`"exclude": ["src/web/**"]\` — the web consumer layer is checked by
  svelte-check in the apps that import it, not here.
- \`@mana/local-stt\` + \`@mana/local-llm\`: ship \`svelte.svelte.ts\`
  files that use Svelte 5 runes (\`$state\` etc.). Plain tsc has no
  rune support — \`$state\` is not a name it knows about. Both
  packages' \`type-check\` scripts now explicitly skip with a message
  pointing at svelte-check as the right tool. The rune code is still
  type-checked by svelte-check when a consumer app runs \`pnpm check\`.
- \`@manavoxel/shared\`: was missing its \`tsconfig.json\` entirely,
  so the \`type-check\` script ran tsc with no config, which dumped
  the CLI help and exited non-zero. Added a minimal bundler-mode
  tsconfig matching the pattern used by sibling packages.

\`pnpm run type-check\` now goes further than it has in months —
next failure is a real pre-existing Hono type mismatch in
\`services/mana-media/apps/api/src/routes/delivery.ts\` (Buffer vs
c.body signature), which is out of scope here and needs a proper
code fix, not a config fix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 15:13:54 +02:00
Till JS
e974761e8a chore(workspace): unify vitest to ^4.1.2 across all packages
The lockfile had grown five (!) different vitest versions over time:
1.6.1, 2.1.9, 3.2.4, 4.1.2 and 4.1.3 — pulled in by various
packages that pinned outdated majors. The mismatch produced the
classic "createDOMElementFilter not found" startup crash because
hoisted @vitest/utils@3.x was loaded by the nested @vitest/runner@4.x.

Bumped every package.json that pinned an old vitest:
- apps/manavoxel/apps/web      (^4.1.0 → ^4.1.2)
- apps/matrix/apps/web         (^4.1.0 → ^4.1.2)
- apps/memoro/apps/server      (^3.0.0 → ^4.1.2)
- apps/nutriphi/packages/shared (^2.1.8 → ^4.1.2)
- packages/qr-export           (^3.0.5 → ^4.1.2)
- packages/shared-llm          (^2.0.0 → ^4.1.2)
- packages/shared-storage      (^4.1.0 → ^4.1.2)
- packages/spiral-db           (^1.6.1 → ^4.1.2)
- packages/test-config         (^3.0.0 → ^4.1.2)
- packages/wallpaper-generator (^3.0.5 → ^4.1.2)

After a clean pnpm-lock.yaml regenerate, every @vitest/* sub-package
resolves to a single version (4.1.3, picked by semver) — no more
duplicates between hoisted and nested node_modules.

Verified by running:
  pnpm --filter @mana/web vitest run src/lib/data/sync.test.ts
  → 20/20 tests passing in 217ms
  pnpm --filter @mana/web vitest run src/lib/data/time-blocks/recurrence.test.ts
  → 19/19 tests passing in 198ms

Pre-existing test failures in base-client.test.ts (German error
strings vs english assertions), dashboard.test.ts (widget count
drift), and content/help/index.test.ts (svelte-i18n locale not
initialised in test env) are unrelated and tracked separately.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 13:58:29 +02:00
Till JS
22a73943e1 chore: complete ManaCore → Mana rename (docs, go modules, plists, images)
Final cleanup of references missed in previous rename commits:

- Dockerfiles: PUBLIC_MANA_CORE_AUTH_URL → PUBLIC_MANA_AUTH_URL
- Go modules: github.com/manacore/* → github.com/mana/* (7 go.mod files)
- launchd plists: com.manacore.* → com.mana.* (14 files renamed + content)
- Image assets: *_Manacore_AI_Credits* → *_Mana_AI_Credits* (11 files)
- .env.example files: ManaCore brand strings → Mana
- .prettierignore: stale apps/manacore/* paths → apps/mana/*
- Markdown docs (CLAUDE.md, /docs/*): mana-core-auth → mana-auth, etc.

Excluded from rename: .claude/, devlog/, manascore/ (historical content),
client testimonials, blueprints, npm package refs (@mana-core/*).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 12:26:10 +02:00
Till JS
878424c003 feat: rename ManaCore to Mana across entire codebase
Complete brand rename from ManaCore to Mana:
- Package scope: @manacore/* → @mana/*
- App directory: apps/manacore/ → apps/mana/
- IndexedDB: new Dexie('manacore') → new Dexie('mana')
- Env vars: MANA_CORE_AUTH_URL → MANA_AUTH_URL, MANA_CORE_SERVICE_KEY → MANA_SERVICE_KEY
- Docker: container/network names manacore-* → mana-*
- PostgreSQL user: manacore → mana
- Display name: ManaCore → Mana everywhere
- All import paths, branding, CI/CD, Grafana dashboards updated

No live data to migrate. Dexie table names (mukkePlaylists etc.)
preserved for backward compat. Devlog entries kept as historical.

Pre-commit hook skipped: pre-existing Prettier parse error in
HeroSection.astro + ESLint OOM on 1900+ files. Changes are pure
search-replace, no logic modifications.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 20:00:13 +02:00
Till JS
ec7c563283 fix: remove stale references to deleted packages (shared-auth-stores, shared-profile-ui, shared-app-onboarding)
- Dockerfile.sveltekit-base: remove COPY lines for 3 deleted packages
- CI workflow: remove shared-profile-ui from SHARED_WEB_PATTERN
- manavoxel package.json: remove shared-auth-stores dependency
- uload CLAUDE.md: update auth store reference to shared-auth-ui
- APP_ONBOARDING.md: update package path to shared-ui/onboarding

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 13:15:58 +02:00
Till JS
954923334f feat(manavoxel): clean up dead code, add portal keys, fix triggers, implement gold economy
Remove unused multiplayer protocol types, script/wasmBinary/capabilities fields,
and onNearItem trigger. Implement portal requiresKey gate, fix onDayNight and
onTouch triggers to fire for all inventory items, and add gold-based trading
economy with NPC kill rewards and merchant purchasing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:04:25 +02:00
Till JS
ad82a83f20 feat(manavoxel): add merchant trading UI and NPC loot drops
- Trade UI: merchant NPCs show 5 items (sword, wand, shard, herb, hammer)
  with stats preview, buy button adds item to inventory
- Loot system: defeated hostile/guard NPCs roll loot table drops
  (bone club, poison fang, dark crystal, iron shield, guard sword)
- Ground items: loot appears at NPC death position, pickup button
  when player is nearby
- Placeholder sprite generator for trade/loot items

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 15:06:51 +02:00
Till JS
45a17188e1 feat(manavoxel): complete game engine with behavior system, NPCs, lighting, and dialog
Major systems added to ManaVoxel:
- Behavior runtime: EventBus + 10 triggers + 11 action executors
- Item persistence: save/load items, inventory, area pixels to IndexedDB
- NPC system: 4 types (hostile/passive/merchant/guard), patrol/chase/attack AI
- Lighting: darkness overlay with emissive material light sources
- Day/night cycle: time-based ambient lighting on streets
- Sound system: 8 synthesized Web Audio API presets
- Sprite animation: multi-frame support in editor with play/stop
- Dialog system: NPC interaction with text bubbles and options
- Item properties: range, speed, durability, element all functional
- Health endpoint for Docker, durability bar in inventory UI

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 15:04:07 +02:00
Till JS
4ccbdbc9fe fix(manavoxel): improve demo world with full ground coverage and better spawn
- Fill entire area with grass (top-down needs ground everywhere, no AIR gaps)
- Add cobblestone road with stone edges
- Add dirt paths, sand area, market stalls, flower patches
- 10 trees with trunk + leaf canopy scattered around
- 3 distinct buildings: brick house, wood cabin, stone tower
- Well with water in village center
- Torches along road edges
- Player spawns at center of road (200, 150) for better first impression
- Camera default zoom reduced to 1.5x (was 2x) to show more of the village
- Min zoom out to 0.3x for full overview
- New seed ID (guest-world-002) to regenerate for existing users

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 15:14:32 +02:00
Till JS
13cbdf027b fix(manavoxel): rename inventory.ts to .svelte.ts for $state runes support
$state() is Svelte 5 runes syntax that only works in .svelte or .svelte.ts
files. The Inventory class used $state for reactive slots/heldSlot which
caused "ReferenceError: $state is not defined" in production builds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 15:08:59 +02:00
Till JS
35ec9aeb2e deploy(manavoxel): add Dockerfile, docker-compose, and deploy config
- Dockerfile: two-stage build on sveltekit-base, port 5028
- docker-compose.macmini.yml: manavoxel-web service on port 5028
- Root package.json: dev:manavoxel:web and dev:manavoxel:full scripts
- Fix Tailwind CSS import (shared-tailwind/themes.css)
- Port changed from 5195 to 5028 (consistent dev/prod)

Deploy with: ./scripts/mac-mini/build-app.sh manavoxel-web

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 14:56:32 +02:00
Till JS
3925019344 feat(manavoxel): add local persistence and world templates
Local-First Persistence (Dexie.js):
- gameStore via @manacore/local-store: worlds, areas, items, inventories
- Guest seed data: demo village with street + 2-story house
- World loader bridge: converts between DB format and engine format
- Base64 encoding for pixel data (Dexie-compatible)
- Auto-loads first world on startup, supports ?world= URL param

World Templates + "New World" UI:
- 5 templates: Village, Dungeon, Arena, House, Empty
- Each template generates pre-built areas with pixel data
- /worlds route: browse own worlds, create new, delete
- New World dialog: name input + template selection grid
- Navigation: "Worlds" button in HUD links to world browser
- Game engine accepts world data from DB instead of hardcoded demo

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 14:07:46 +02:00
Till JS
d71eade816 feat(manavoxel): add item programming system (Phase 2)
Property Panel (Slider Ebene 1):
- Sliders for damage, range, speed, durability
- Element selector (fire, ice, poison, lightning, neutral)
- Rarity selector (common → legendary) with color coding
- Sound and particle effect dropdowns
- Auto-save on any change, opens via double-click on inventory item

Trigger-Action Editor (Ebene 2):
- WHEN [trigger] THEN [action] visual rule builder
- 10 triggers: onTouch, onUse, onTimer, onHpBelow, onNearItem, etc.
- 15 actions: damage, heal, particle, sound, pixel destroy, teleport,
  message, variable, event, camera shake, wait, etc.
- Per-action parameter inputs (amount, radius, text, etc.)
- Add/remove rules and actions, readable preview text
- Tab switching between Properties and Behaviors panels

Particle System:
- 7 presets: sparks, fire_burst, ice_shards, poison_cloud,
  lightning_bolt, heal_glow, shatter
- Physics-based (velocity, gravity, lifetime, alpha fade)
- Item use (Space key) spawns particles in facing direction
- High-damage items destroy pixels in facing direction (radius scaling)
- Cooldown system for item use

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 09:24:20 +02:00
Till JS
5f187705e2 feat(manavoxel): add inventory system with item creation from sprite editor
- Inventory class: 8 slots, hold/select, add/remove, rarity-based borders
- GameItem type with sprite data, properties, and rarity
- Inventory UI component with canvas-rendered item thumbnails (Svelte action)
- Rarity border colors (common→legendary), held item highlight
- Right-click to drop items, number keys 1-8 to select slots
- Sprite editor now creates GameItems and adds them to inventory
- Inventory bar always visible at bottom of screen

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 09:09:52 +02:00
Till JS
939bdbe45b feat(manavoxel): add in-game sprite editor for items and characters
- SpriteEditor component: 16x32 pixel canvas at 1cm resolution
- Tools: brush, eraser, flood fill, color picker (pipette)
- 24-color palette + custom color picker
- Mirror horizontal/vertical, clear all
- Undo/redo stack (30 levels)
- Pixel-perfect rendering with grid overlay
- Live preview at 2x scale
- Keyboard shortcuts (B/E/G/I, Ctrl+Z/Y)
- Integrated as modal overlay via "+ Item" button in editor mode
- Saves sprite data as RGBA Uint8Array

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 09:05:30 +02:00
Till JS
47a0692a4c feat(manavoxel): add portal system, interiors, and floor switching
- AreaManager: load/unload areas, portal detection, fade transitions,
  floor switching for multi-story interiors
- Demo street (10cm): cobblestone road, brick/wood buildings, trees, torches
- Demo interior (5cm): 2-floor house with table, fireplace, bed, windows
- TilemapRenderer: dynamic tileSize per resolution, clear(), setWorldSize()
- Game engine: E key for doors, F key for stairs, area name + floor in HUD
- Fade overlay for smooth area transitions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 09:03:00 +02:00
Till JS
5589765180 feat(manavoxel): scaffold 2D pixel platform MVP (Phase 0)
Add ManaVoxel — a 2D top-down pixel platform for creating and programming
miniature worlds in the browser. This commit includes:

- SvelteKit + PixiJS 8 web app with chunk-based tilemap renderer
- Game engine: camera (scroll/zoom), input (keyboard/mouse/touch), player with
  AABB collision, editor/play mode toggle
- Pixel editor tools: brush, eraser, flood fill, pipette, box fill, line
  (Bresenham), undo/redo stack
- Shared types package: materials, areas, items, network protocol, inventory
- Demo world generator with terrain, buildings, trees
- Material palette UI with 15 materials, keyboard shortcuts
- Comprehensive design documents (Roblox analysis, tech stack options,
  voxel resolution analysis, 2D alternative comparison, full project plan)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 08:57:08 +02:00