feat(assistant): trip assistant chat with your own AI connection

Adds an in-app assistant that reads and plans the open trip. Users connect
their own provider (Sign in with ChatGPT, or an Anthropic, OpenAI, Gemini or
OpenRouter key) or use the one the admin set up, including a custom
OpenAI-compatible server. It is an addon and only shows while a connection
is usable.

The chat runs on the existing MCP tools, pinned to the trip. Every change is
held as a change card the user applies or discards, and applied changes can
be undone. On the desktop it is a floating window that can be moved and
resized; on the phone it is fullscreen. Search results show as place cards
that can go onto a day, weather lookups as a strip, proposed places as
ghost markers on the map with a before/after switch, and an answer can be
shared into the trip chat. Booking files can be dropped in and are read
into change cards.
This commit is contained in:
Maurice
2026-10-21 18:52:44 +02:00
parent bb3c0151d5
commit 214984f398
505 changed files with 51841 additions and 227 deletions
+1
View File
@@ -86,6 +86,7 @@ function checkPluralForms(locale, keys, groups) {
* ungrouped count string fails the check, so the list cannot go stale.
*/
export const NOT_PLURAL = [
{ key: 'assistant.place.addToShort', because: 'the number of the day a found place would go on ("+ Day 3")' },
{ key: 'collab.polls.optionPlaceholder', because: 'the position of a poll option ("Option 3")' },
{ key: 'collections.importOnDay', because: 'the number of the day a place is planned on' },
{ key: 'dashboard.atlas.aroundEquator', because: 'a decimal multiplier ("≈ 1.37×"), not a count of things' },
+13 -1
View File
@@ -54,9 +54,12 @@ export const BRAND_NAMES = [
'Anthropic',
'Apple Maps',
'Atlas',
'ChatGPT',
'Claude',
'Dawarich',
'Discord',
'Docker',
'Gemini',
'Google',
'Google Maps',
'Google Places',
@@ -64,6 +67,8 @@ export const BRAND_NAMES = [
'Immich',
'Mapbox',
'Ntfy',
'Ollama',
'OpenRouter',
'Organic Maps',
'Polaroid',
'Synology',
@@ -76,6 +81,13 @@ export const BRAND_NAMES = [
/** Unit symbols, short codes rather than words: "{count} km", "{minutes} min". */
export const UNITS = ['km', 'mi', 'ft', 'min'];
/**
* Key cap labels, printed on the keyboard in Latin letters whatever the
* language around them ("Ctrl" on a Russian or Japanese keyboard too). A
* locale whose keyboards print another word (German "Strg") translates it.
*/
export const KEY_NAMES = ['Ctrl'];
/**
* Locales written in a script other than Latin. A Latin word left in one of
* them is English whatever the word, so `// same-as-en` is not honoured
@@ -113,7 +125,7 @@ const WORD_RE = /\p{L}[\p{L}\p{M}'’-]*/gu;
const escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
// Longest first, so "Google Maps" goes as one name before "Google" could split it.
const NAME_RE = new RegExp(
`(?<![\\p{L}\\p{N}])(?:${[...BRAND_NAMES, ...UNITS]
`(?<![\\p{L}\\p{N}])(?:${[...BRAND_NAMES, ...UNITS, ...KEY_NAMES]
.sort((a, b) => b.length - a.length)
.map(escapeRe)
.join('|')})(?![\\p{L}\\p{N}])`,