feat(assistant): one AI tile for assistant, parsing and MCP, a planner-aware chat

The three AI addons share one tile in the integration column; a dialog holds
the connection, the assistant's limits and AI parsing, which now reads with
the assistant's connection unless an install keeps its own. Existing parsing
configs stay where they are and keep winning.

The chat sees the map on screen, offers next questions under an answer,
shows its live step in the window head, previews waiting changes inside the
day list, checks whether a day still works, folds a multi-day plan into a
week grid, keeps per-trip notes and can estimate costs. An empty or cut-off
answer gets one push instead of ending silently, and the assistant's own
step and size limits are raised.
This commit is contained in:
Maurice
2026-10-21 20:55:06 +02:00
parent b64da26651
commit 123e27643d
142 changed files with 5456 additions and 1572 deletions
@@ -2,20 +2,19 @@ import { useTranslation } from '../../i18n';
import { useSettingsStore } from '../../store/settingsStore';
import { useToast } from '../shared/Toast';
/**
* Whether the trip map follows the assistant: pans to where it searches and
* frames the places it suggests. On unless switched off. Behind the switch in
* both AI settings shells, the desktop section and the phone card.
*/
export function useAssistantMapFollow(): { on: boolean; set: (on: boolean) => Promise<void> } {
const on = useSettingsStore((s) => s.settings.assistant_map_follow) !== false;
/** The assistant's own on/off settings; each reads as on unless switched off. */
type AssistantFlag = 'assistant_map_follow' | 'assistant_cost_estimates';
/** One of the assistant's switches, read and saved through the user's settings. */
function useAssistantFlag(key: AssistantFlag): { on: boolean; set: (on: boolean) => Promise<void> } {
const on = useSettingsStore((s) => s.settings[key]) !== false;
const updateSetting = useSettingsStore((s) => s.updateSetting);
const { t } = useTranslation();
const toast = useToast();
const set = async (next: boolean) => {
try {
await updateSetting('assistant_map_follow', next);
await updateSetting(key, next);
} catch (e: unknown) {
toast.error(e instanceof Error ? e.message : t('common.error'));
}
@@ -23,3 +22,21 @@ export function useAssistantMapFollow(): { on: boolean; set: (on: boolean) => Pr
return { on, set };
}
/**
* Whether the trip map follows the assistant: pans to where it searches and
* frames the places it suggests. On unless switched off. Behind the switch in
* both AI settings shells, the desktop section and the phone card.
*/
export function useAssistantMapFollow() {
return useAssistantFlag('assistant_map_follow');
}
/**
* Whether the assistant proposes an estimated budget item along with a place
* that costs money, as one more change card to apply or leave. On unless
* switched off; the server reads the same setting.
*/
export function useAssistantCostEstimates() {
return useAssistantFlag('assistant_cost_estimates');
}