mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 08:30:05 +00:00
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:
@@ -627,11 +627,17 @@ export class AdminService {
|
||||
//
|
||||
// AirTrail and Dawarich: both addons exist to reach a server the admin
|
||||
// runs themselves, and a managed instance has no route to one.
|
||||
//
|
||||
// AI assistant: the same reasoning as AI parsing, and its connection
|
||||
// would put a key of the instance's own beside the operator's.
|
||||
.filter(
|
||||
(a) =>
|
||||
!(
|
||||
readEnv().managed.enabled &&
|
||||
(a.id === ADDON_IDS.LLM_PARSING || a.id === ADDON_IDS.AIRTRAIL || a.id === ADDON_IDS.DAWARICH)
|
||||
(a.id === ADDON_IDS.LLM_PARSING ||
|
||||
a.id === ADDON_IDS.AI_ASSISTANT ||
|
||||
a.id === ADDON_IDS.AIRTRAIL ||
|
||||
a.id === ADDON_IDS.DAWARICH)
|
||||
),
|
||||
);
|
||||
const providers = (await this.photoProviders.listAllOrdered())
|
||||
@@ -709,7 +715,7 @@ export class AdminService {
|
||||
// the operator owns the endpoint, the model and the per-document cost, so
|
||||
// there is nothing here for an instance admin to set — including whether it
|
||||
// runs at all. listAddons hides the row; this closes the route behind it.
|
||||
if (readEnv().managed.enabled && id === ADDON_IDS.LLM_PARSING) {
|
||||
if (readEnv().managed.enabled && (id === ADDON_IDS.LLM_PARSING || id === ADDON_IDS.AI_ASSISTANT)) {
|
||||
throw new DomainError(403, MANAGED_FORBIDDEN_ERROR.error);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user