mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 01:01:09 +02:00
SvelteKit hook + new DB table + founder-gated API + UI section. Ships
the code path for public-site routing on {slug}.mana.how and custom
hostnames. Cloudflare SaaS Hostnames integration is stubbed — see
plan §M6 "Offene Enden".
apps/api/src/modules/website:
- schema.ts: new `customDomains` table. Fields: id, site_id, hostname
(unique), status (pending | verifying | verified | failed),
verification_token, dns_target, verified_at.
- drizzle/website/0002_custom_domains.sql: manual migration with
partial unique index on (hostname) WHERE status='verified'.
- domains.ts (new, authenticated + founder-gated via
`requireTier('founder')`): POST/GET/DELETE /sites/:id/domains,
POST /sites/:id/domains/:domainId/verify. Verify runs CNAME + TXT
checks via node:dns/promises with an apex-domain A-record fallback.
Reserved-hostname list prevents users from binding mana.how subdomains.
- public-routes.ts: new GET /public/resolve-host?host= — unauthenticated
resolver used by hooks.server.ts. Returns { slug, siteId } only for
verified bindings tied to a currently-published site.
apps/mana/apps/web/src/hooks.server.ts:
- After the existing https/app-subdomain guards, a new
`resolveWebsiteRewrite()` step rewrites `event.url.pathname`:
{slug}.mana.how/path → /s/{slug}/path (pure string)
custom-host.com/path → /s/{resolved}/path (API call, 60s LRU)
- Browser URL stays on the custom host — this is a server-side rewrite,
not a 302. APP_SUBDOMAINS + RESERVED_WEBSITE_SUBDOMAINS win over
website routing. Localhost and apex mana.how are skipped.
apps/mana/apps/web/src/lib/modules/website:
- domains.ts (new): typed client for list/add/verify/remove. Handles
200 + expected 400 (verification-failed) separately.
- components/DomainsSection.svelte: add-input, per-domain status pill,
DNS-instructions box (CNAME + TXT with copy-to-clipboard), Verify
button. Mounted inside SiteSettingsDialog as its own section — the
existing theme/footer controls stay put.
docs/plans/website-builder.md:
- M6 checklist updated with what shipped vs. ops-gap (CF SaaS).
- `mana-landing-builder` consolidation: DECIDED to keep parallel. Four
reasons in the plan. Revisit-criterion stated.
- Shipping log table seeded with M1→M6 commits.
Validation:
- pnpm run validate:all: 6/6 gates green
- pnpm run check (web): 0 errors, 0 warnings
- apps/api type-check: green
Apply schema with:
psql "$DATABASE_URL" -f apps/api/drizzle/website/0002_custom_domains.sql
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| agent-loop-improvements-m1.md | ||
| ai-mission-key-grant.md | ||
| articles-homepage.md | ||
| articles-module.md | ||
| broadcast-module.md | ||
| data-export-v2.md | ||
| event-discovery.md | ||
| invoices-module.md | ||
| library-module.md | ||
| mail-module-plan.md | ||
| mana-mcp-and-personas.md | ||
| mana-research-service.md | ||
| me-images-and-reference-generation.md | ||
| multi-agent-workbench.md | ||
| news-research-module.md | ||
| per-space-vs-user-global-tags.md | ||
| planner-function-calling.md | ||
| README.md | ||
| scene-scope-empty-state.md | ||
| shared-space-smoketest.md | ||
| social-relay-module.md | ||
| space-scoped-data-model.md | ||
| spaces-foundation.md | ||
| team-workbench.md | ||
| tipps-module.md | ||
| wardrobe-module.md | ||
| website-builder.md | ||
| workbench-cards-migration.md | ||
| workbench-templates.md | ||
Plans
Design + rollout plans, grouped by topic. Plans are long-form docs with baked-in decisions, phasing, open questions, and (when shipped) a history section with commit refs.
AI / Workbench roadmap
The Mana AI Workbench has evolved in three successive planned waves — each one laying foundations the next one relies on:
User hat einen Companion (v0 — shipped before these docs)
│
▼
AI Missions + Proposals + Policy + Revert
│
▼
Mission Key-Grants ← ai-mission-key-grant.md ✅
(encrypted inputs decryptable by the server runner)
│
▼
Multi-Agent Workbench ← multi-agent-workbench.md ✅
(named agents, per-agent policy/memory/budget,
identity-aware Actor, scene→agent lens)
│
▼
Team Workbench ← team-workbench.md 📝 (not started)
(multi-user + shared AI context,
admin lens on team members)
| Plan | Status | Scope |
|---|---|---|
ai-mission-key-grant.md |
✅ Shipped | Per-mission RSA-wrapped key grant so mana-ai can decrypt allowlisted encrypted records when user opts in. |
multi-agent-workbench.md |
✅ Shipped | Identity-aware Actor + named AI agents owning missions + per-agent policy + scene lens. 28 tools across 11 modules including server-side web-research. |
workbench-templates.md |
✅ T1 Shipped | Generalised templates: 3 agent-templates + 3 non-AI workbench starter-kits. Seed-handler registry for per-module data seeding. |
team-workbench.md |
📝 Forward-looking | TeamSpace with membership, team-encrypted records, admin lens on team members. Reuses Actor.principalId + key-wrapping patterns from the two above. |
Cross-references:
- Architecture narrative:
docs/architecture/COMPANION_BRAIN_ARCHITECTURE.md§20 (AI Workbench base), §21 (Mission Grants), §22 (Multi-Agent), §23 (Reasoning Loop + Research + Debug) - Non-plan ideas backlog:
docs/future/AI_AGENTS_IDEAS.md - Service-internal notes:
services/mana-ai/CLAUDE.md - Webapp-internal notes:
apps/mana/CLAUDE.md→ "AI Workbench" section
Other plans
| Plan | Topic |
|---|---|
mail-module-plan.md |
Mail module — IMAP/SMTP integration |
news-research-module.md |
News + research pipeline |