47 Commits
Author SHA1 Message Date
CatoandClaude Opus 5.5 9dde8fbee9 feat(forms): prose fields on chatkit DictationField, with a working microphone (#330)
* wip: prose fields on chatkit DictationField (awaits chatkit 0.45)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuMRAXYWNkfowAXVfi

* feat(forms): prose fields on chatkit DictationField, with a working microphone

- Bump @bitbaum/chatkit to ^0.45.0.
- One app wrapper, components/forms/TextBox, around DictationField. Used by
  the bot builder (name, description, knowledge topic and content, system
  prompt), the custom-bot edit page (name, description, system prompt,
  greeting), the contact message, the demo intake questions, quick-create
  (name, relationship, memories) and the consultation form's
  react-hook-form message field ({...register('message')}).
- app/api/transcribe: dictation server leg on ai-kit's speechChain and
  transcribe(), rate limited, recordings and transcripts neither stored nor
  logged. Every field and every in-page chat points voice at it, so the
  microphone works where the browser has no recogniser of its own.
- Permissions-Policy allowed no microphone at all (microphone=()), which
  blocked every mic on the site; it now allows the site itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuMRAXYWNkfowAXVfi

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-19 14:23:42 +01:00
CatoandClaude Opus 5.5 ebe51fa38e feat(auth): every way in on AccountKit's own screens (#289)
* feat(auth): every way in on AccountKit's own screens

Botsmann signed people in against OrangeCat's GoTrue (auth.users). It now
runs on AccountKit (@bitbaum/accountkit 0.23) with AccountKit's own forms:
/auth/signin offers email and password, an emailed sign-in link, a
passkey, recovery through the mailed link and the second factor;
/auth/signup is sign-up; /account carries the account panel ("Sign-in and
security" in the account menu). "Continue with OrangeCat" and the shared
sign-in show when their clients are set, the link and recovery when mail
is. The GoTrue routes (/api/auth/signin, signup, forgot-password,
resend-verification, profile) and pages (callback, forgot-password,
reset-password, verify-email) and the cookie-session client are gone.

AccountKit's tables live in a host accounts database (drizzle/, loki
accounts-db.conf); the data stays in the botsmann supabase schema, which
every route already read with the service-role client. verifyUser now reads
AccountKit's session; /api/user/profile moves onto it too. New accounts get
uuid ids, and migration 013 drops the person columns' keys to auth.users,
which a new person's id is not in. Nothing is deleted. The profile editor
writes AccountKit's name and image.

Existing people keep their rows: scripts/db/accountkit-people.sql lists
everyone who owns rows with their OrangeCat actor id, and
scripts/db/accountkit-import.sql gives each an account under the same id,
linked to OrangeCat by that actor id, never by address (loki
accountkit-supabase.yml rehearses it rolled back, then imports).

Pages were served with public, max-age=3600 to every browser, account pages
included: after sign-out the browser showed its cached /account. /account
and /auth/* are now private, no-store. The account menu's trigger has a name.

tests/__tests__/accounts runs the ways in and the import on the committed
migration; browser-smoke.yml's account job rehearses the import and runs
the browser journey against the production build with AccountKit's real
mail caught by a sink.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

* fix(auth): send a signed-out visitor to sign in with the router

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

* ci(auth): the shared sign-in's button is matched by how it starts

AccountKit 0.24 names only the providers Morulia publishes, so the label
changes with Morulia.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

* ci(auth): expect the shared sign-in only once Morulia publishes a provider

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

* ci: run the checks on the journey change

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 23:27:16 +01:00
CatoandClaude Fable 5.1 bade0a1b8e chore: rename FleetCrown to Loki (#197)
The product was renamed on 2026-09-14: bitbaum/loki, loki.orangecat.ch,
LOKI_* env keys, loki-* units. This repo referenced the old name in
15 files changed, 29 insertions(+), 29 deletions(-).
Email addresses at the old sending domain stay until the new domain is
verified in Resend.


Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 16:23:24 -07:00
CatoandClaude Opus 5 a6906851d5 refactor(content): one markdown pipeline — bip-kit typed blocks replace MDX and two GitHub content repos (#183)
The blog and the Knowledge Center each fetched their markdown from a
SEPARATE GitHub repository at request time (g-but/botsmann-blog-content,
g-but/botsmann-knowledge-content) and rendered it through next-mdx-remote
with a hand-rolled component map per surface. Two maps for one markdown
vocabulary, already drifted: the blog slugged headings with rehype-slug, the
guides with a different inline regex; the guides highlighted code, the blog
did not; each had its own Callout. The content itself lived where nobody
reviewed it, behind a GitHub handle rename that now answers only via a 301.

Both surfaces now read content/*.md from this repo and render through
bip-kit's typed-block parser and reference renderer:

- content/blog/*.md (5 posts) and content/knowledge/**/*.md (10 guides) are
  vendered verbatim from the two content repos — word-level parity verified
  across all 15 files, zero words lost. Post images moved to public/blog/.
- The three app/blog/<slug>/page.mdx files came along as drafts. They were
  never routes: `page.mdx` only serves as a page when pageExtensions includes
  mdx, and this app never configured that, so all three were dead files. They
  are committed with `published: false` rather than deleted.
- lib/longform/ is the one pipeline both routes call: a fence-aware
  normalizer (`# ` → `## `, `*`/`+` bullets → `-`, nested items flattened —
  the guides carry 74 indented items and ~130 shell-comment `#` lines inside
  fences that a naive normalizer would have corrupted), then parse → blocks +
  TOC + reading time.
- setHighlighterLoader(() => import('shiki')) is registered at module scope.
  This app builds `output: standalone`, where bip-kit's zero-config shiki
  import is invisible to Next's file tracer — without the explicit literal,
  production ships unhighlighted while dev looks right.
- The TOC is derived from the same parse that renders the page, so a TOC
  anchor can no longer point at a heading id built by a different slug rule.
  types/knowledge.ts loses TableOfContentsItem accordingly.

Retired: next-mdx-remote, remark-gfm, rehype-slug, rehype-autolink-headings,
gray-matter (deps), components/blog/{Server,Client}MDXContent + MDXComponents,
components/knowledge/{Callout,CodeBlock,TableOfContents}. next.config drops
the raw.githubusercontent image pattern and the GitHub hosts from CSP
connect-src, and points frame-src at the privacy video players bip-kit uses.

Article typography now flows from the token SSOT: lib/longform/longform.css
maps globals.css onto bip-kit's --bp-* contract, replacing ~40 hardcoded
Tailwind greys. The mapping covers every --bp-* colour and pins the article
light, because Botsmann has no dark theme anywhere (zero `dark:` utilities,
no theme provider, light-only chrome) — letting bip-kit's dark defaults
through would put a dark article inside a white page. When the site grows a
dark tier, this file follows it by changing values in globals.css only.

tests/__tests__/lib/longform-content.test.ts walks every content file through
the real pipeline: committed content is bip-kit's trust boundary and a
malformed chart/stats fence throws at parse time, which without a test would
surface as a 500 on the live page.


Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 14:24:40 +00:00
Mao NakamotoandCursor 137c827306 fix(feedback): allow FleetCrown widget origin in CSP
The embed tag was in the HTML but script-src blocked widget.js, so the FAB
never booted and coverage stayed waiting for first page load.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-14 12:24:09 +02:00
Mao NakamotoandClaude Opus 4.8 122f4b6779 chore(deps): upgrade Next.js 15 → 16 + React 18 → 19
Framework major upgrade, stacked on #111 (Next 14 → 15).

Dependencies:
- next 15.5.21 → 16.2.12
- react / react-dom 18 → 19.2.8, @types/react(-dom) → 19
- eslint 8 → 9 (flat config), eslint-config-next → 16, @typescript-eslint 6 → 8
  (also clears the lingering ts-eslint Dependabot alert)

Config migrations required by Next 16:
- `next lint` removed → lint scripts use `eslint .`; migrated .eslintrc.json to
  eslint.config.mjs (flat) composing eslint-config-next 16's native flat configs
  (FlatCompat crashes on the react plugin's circular flat object)
- typedRoutes graduated from `experimental` to a stable top-level option
- tsconfig target es5 → ES2017 (Next 16 drops es5; noEmit, so type-check only)

React 19 type-tightening fixes (behaviour unchanged):
- ImgHTMLAttributes['src'] widened to string | Blob → narrow before string ops
  (MDXComponents, ServerMDXContent)
- ReactElement['props'] is now unknown → annotate read shape (guides pre block)
- useRef<T>(null) returns RefObject<T | null> → widen ChatMessageList prop

Deferred (out of scope for a framework upgrade, tracked as follow-up):
eslint-plugin-react-hooks v6 (bundled with Next 16) adds React-Compiler-era
rules (set-state-in-effect, error-boundaries, immutability) that flag 30
pre-existing intentional patterns; disabled here. no-unused-vars caughtErrors
pinned to 'none' to preserve the pre-upgrade contract (v8 flipped the default).

Verified: tsc --noEmit, next build (Turbopack, all pages), eslint ., jest 227 pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-26 11:45:50 +02:00
Mao NakamotoandClaude Opus 4.8 354b432326 chore(deps): upgrade Next.js 14 → 15.5.21 (clears 15 Dependabot alerts)
Bumps next + eslint-config-next 14.2.35 → 15.5.21. React stays on 18
(Next 15 supports React ^18.2.0), so no forced React 19 migration.

Clears all 15 open next-related Dependabot alerts (4 high) — the highest
patched version required is 15.5.16, so jumping to Next 16 would add
breakage (React 19, Turbopack default) for zero additional security gain.

Next 15 breaking-change migration:
- Async request APIs: params/searchParams awaited in the 6 dynamic pages
  that consume them as props; cookies() is now async, so
  createRouteHandlerClient() became async (9 call sites awaited).
- next.config: serverComponentsExternalPackages → top-level
  serverExternalPackages (renamed/destabilized in Next 15).
- typedRoutes tightening: object href {pathname, hash} is no longer
  accepted → string href "/path#hash" (4 governance pages).
- eslint: ignore the Next-generated next-env.d.ts (Next 15 adds a
  triple-slash routes.d.ts reference that trips no-triple-slash-reference).

Verified: `next build` green — compiles, type-checks, lints, and
prerenders all 81 pages. Client components using the useParams()
hook are unaffected and left untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 00:25:12 +02:00
Mao NakamotoandClaude Fable 5 e612331d2d feat(selfhost): migrate to self-hosted Hetzner (Vercel/Neon/Supabase exit 2026-06-12)
Standalone output, portable Postgres driver, proxy-aware fixes as needed.
Runbook: fleetcrown/docs/infrastructure/hetzner-migration.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-16 19:33:47 +02:00
g-butandClaude Opus 4.6 06531355bf feat(security): add security headers via next.config.js
Add CSP, HSTS (1 year), X-Content-Type-Options, X-Frame-Options,
Referrer-Policy, and Permissions-Policy headers to all routes.
CSP allows required external sources (Groq, OpenRouter, Supabase,
GitHub, YouTube, Giscus).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 09:51:15 +01:00
g-butandClaude Opus 4.5 1c7abeebac docs(claude): add global standards reference and update date
- Add @~/.claude/CLAUDE.md import for global engineering standards
- Update Last Updated date to 2026-01-23

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 15:22:36 +01:00
g-butandClaude Opus 4.5 403c9bf5a7 Add Phase 3: Document upload and RAG chat
- Add Transformers.js for local embeddings generation
- Create document upload API with Supabase Storage
- Create document processing pipeline (parse, chunk, embed)
- Create semantic search API using pgvector
- Create RAG chat API combining search + LLM
- Add documents page UI with upload, process, and chat
- Add database migration for document status columns
- Configure Next.js to externalize ONNX packages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 12:39:43 +01:00
g-butandClaude Opus 4.5 ddec243147 feat: add Swiss German RAG demo with keyword-based search
- Add RAG search module with TF-IDF-like scoring (lib/rag/)
- Create Swiss German knowledge base with 10+ chunks
- Build demo chat UI with suggested questions and source citations
- Add /api/demo/chat endpoint with Zod validation
- Update homepage with "Try the Demo" CTA and honest messaging
- Add /api/contact endpoint for consultation form
- Fix ConsultationForm to use real API endpoint
- Update bot cards to show accurate live/coming-soon status
- Remove legacy api/consultations.js (caused Vercel conflicts)
- Add nodemailer dependency for email functionality

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 08:38:43 +01:00
cato 3cf07bf591 Enable browser and CDN caching in next.config.js 2025-03-05 01:40:23 +01:00
cato e43f1de07e Add GitHub image domain to next.config.js 2025-03-05 01:36:11 +01:00
Devin AIandcato 500ffeb035 feat: add cache control headers to prevent caching
Co-Authored-By: G <butaeff@gmail.com>
2025-02-16 19:23:29 +00:00
Devin AIandcato 159fd02ce1 feat: add build-time deployment timestamp
Co-Authored-By: G <butaeff@gmail.com>
2025-02-16 19:16:04 +00:00
Devin AIandcato ab21fb71eb fix: simplify Next.js config and use standalone output
Co-Authored-By: G <butaeff@gmail.com>
2025-02-16 18:17:44 +00:00
Devin AIandcato eacea1bb65 fix: revert to export output for static site generation
Co-Authored-By: G <butaeff@gmail.com>
2025-02-16 18:06:03 +00:00
Devin AIandcato 109b9aa601 fix: update Next.js config with proper route handling settings
Co-Authored-By: G <butaeff@gmail.com>
2025-02-16 18:04:55 +00:00
Devin AIandcato a22e439d41 fix: update Next.js config and remove redundant server actions flag
Co-Authored-By: G <butaeff@gmail.com>
2025-02-16 18:02:06 +00:00
Devin AIandcato 5d8fb6bc9d fix: update Next.js output config for serverless deployment
Co-Authored-By: G <butaeff@gmail.com>
2025-02-16 18:01:31 +00:00
Devin AIandcato e090e0da45 fix: simplify Next.js config for Vercel deployment
Co-Authored-By: G <butaeff@gmail.com>
2025-02-16 17:59:14 +00:00
Devin AIandcato d222c01254 fix: update Next.js config for proper API route handling
Co-Authored-By: G <butaeff@gmail.com>
2025-02-16 17:58:55 +00:00
Devin AIandcato a304ad8fcf fix: add API route rewrites to Next.js config
Co-Authored-By: G <butaeff@gmail.com>
2025-02-16 17:56:46 +00:00
Devin AIandcato 27248cb712 fix: expose MongoDB URI to runtime and enable server actions
Co-Authored-By: G <butaeff@gmail.com>
2025-02-16 17:56:08 +00:00
Devin AIandcato a5925ddd0c fix: update Next.js config to generate proper routes manifest
Co-Authored-By: G <butaeff@gmail.com>
2025-02-16 17:54:35 +00:00
Devin AIandcato 676e837d47 fix: simplify Next.js config for standalone output
Co-Authored-By: G <butaeff@gmail.com>
2025-02-15 13:38:15 +00:00
Devin AIandcato 25e90baa47 fix: configure Next.js for standalone output with API support
Co-Authored-By: G <butaeff@gmail.com>
2025-02-15 13:34:16 +00:00
Devin AIandcato 4940b79cd4 fix: remove static export to support API routes
Co-Authored-By: G <butaeff@gmail.com>
2025-02-15 13:26:51 +00:00
Devin AIandcato 9b13afe62c fix: add export output configuration for static deployment
Co-Authored-By: G <butaeff@gmail.com>
2025-02-15 13:23:11 +00:00
Devin AIandcato d8c7ccf8b1 fix: update MDX configuration with proper loader setup
Co-Authored-By: G <butaeff@gmail.com>
2025-02-15 13:19:01 +00:00
Devin AIandcato f644aef7ad fix: simplify MDX setup and ensure proper client component boundaries
Co-Authored-By: G <butaeff@gmail.com>
2025-02-15 13:18:37 +00:00
Devin AIandcato 5dda3cb258 fix: simplify MDX configuration and remove experimental flag
Co-Authored-By: G <butaeff@gmail.com>
2025-02-15 13:17:59 +00:00
Devin AIandcato d22a12a943 fix: restore withMDX configuration for proper MDX file handling
Co-Authored-By: G <butaeff@gmail.com>
2025-02-15 13:17:22 +00:00
Devin AIandcato ef8a72cf36 fix: update MDX configuration for proper context creation
Co-Authored-By: G <butaeff@gmail.com>
2025-02-15 13:16:57 +00:00
Devin AIandcato 1184584924 fix: update next.config.js with proper MDX configuration
Co-Authored-By: G <butaeff@gmail.com>
2025-02-15 13:13:32 +00:00
Devin AIandcato cf5d3e05eb fix: update MDX configuration and imports
Co-Authored-By: G <butaeff@gmail.com>
2025-02-15 13:09:57 +00:00
Devin AIandcato f104477645 fix: enable experimental MDX support in Next.js config
Co-Authored-By: G <butaeff@gmail.com>
2025-02-15 12:58:27 +00:00
Devin AIandcato 2df0532a2e fix: update MDX configuration with provider import source
Co-Authored-By: G <butaeff@gmail.com>
2025-02-15 12:58:09 +00:00
Devin AIandcato 62f534f9e1 fix: add MDX plugin options to Next.js config
Co-Authored-By: G <butaeff@gmail.com>
2025-02-15 12:56:29 +00:00
Devin AIandcato 6f2a9ffa9b fix: configure Next.js for MDX support
Co-Authored-By: G <butaeff@gmail.com>
2025-02-15 12:56:13 +00:00
Devin AIandcato b39798d8fd fix: remove static export to support API routes
Co-Authored-By: G <butaeff@gmail.com>
2025-02-15 12:27:00 +00:00
Devin AIandcato 500e571531 fix: simplify Next.js configuration for static export
Co-Authored-By: G <butaeff@gmail.com>
2025-02-12 09:38:09 +00:00
Devin AIandcato fb552c224b chore: configure netlify deployment
Co-Authored-By: G <butaeff@gmail.com>
2025-02-09 18:50:18 +00:00
Devin AIandcato c3f6f96cc7 feat: add blog section, specialized bots, and project pages
Co-Authored-By: G <butaeff@gmail.com>
2025-02-08 18:28:51 +00:00
Devin AIandcato a0383baa2b chore: add MDX and typography support
Co-Authored-By: G <butaeff@gmail.com>
2025-02-08 18:16:44 +00:00
Devin AIandcato 22eb01ad44 feat: add OpenAI design system and layout components
Co-Authored-By: G <butaeff@gmail.com>
2025-02-08 17:46:55 +00:00