mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-21 19:40:34 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bc60aea839 | |||
| b5cd951bd2 | |||
| fd818050bd | |||
| 0313597b10 | |||
| 2c867673bf | |||
| 39ebf0976c | |||
| 1ecc449f3e | |||
| b8990782cc |
@@ -47,6 +47,14 @@ describe('aiConnectModel', () => {
|
||||
expect(connectErrorKey(new Error('boom'))).toBe('assistant.error.generic');
|
||||
});
|
||||
|
||||
it('FE-AI-CONNECT-MODEL-002b: tells an own server that answered without a model list from one that is down (#2808)', () => {
|
||||
const noList = { response: { data: { code: 'provider_unavailable', reason: 'no_model_list' } } };
|
||||
expect(connectErrorKey(noList)).toBe('assistant.connect.noModelList');
|
||||
expect(connectErrorKey({ response: { data: { code: 'provider_unavailable', reason: 'other' } } })).toBe(
|
||||
'assistant.error.providerDown'
|
||||
);
|
||||
});
|
||||
|
||||
it('FE-AI-CONNECT-MODEL-003: offers the way back into a broken connection, none for a working one', () => {
|
||||
expect(repairModeOf(VIEW)).toBeNull();
|
||||
expect(repairModeOf({ ...VIEW, status: 'error' })).toBe('key');
|
||||
|
||||
@@ -33,9 +33,20 @@ const CONNECT_ERRORS: Record<string, { messageKey: string }> = {
|
||||
offline: { messageKey: 'assistant.error.offline' },
|
||||
};
|
||||
|
||||
/** The line a failed connect shows. Takes `{provider}` where the line names one. */
|
||||
/** What a refused connect says for the `reason` it carries next to its code, ahead of the code's line. */
|
||||
const CONNECT_REASONS: Record<string, { messageKey: string }> = {
|
||||
no_model_list: { messageKey: 'assistant.connect.noModelList' },
|
||||
};
|
||||
|
||||
/**
|
||||
* The line a failed connect shows. Takes `{provider}` where the line names one.
|
||||
* An own server that answered without a model list is up, so it gets its own
|
||||
* line about the address instead of "not responding" (#2808).
|
||||
*/
|
||||
export function connectErrorKey(err: unknown): string {
|
||||
return CONNECT_ERRORS[refusalCode(err) ?? '']?.messageKey ?? 'assistant.error.generic';
|
||||
const reason = (err as { response?: { data?: { reason?: unknown } } } | null)?.response?.data?.reason;
|
||||
const byReason = typeof reason === 'string' ? CONNECT_REASONS[reason] : undefined;
|
||||
return byReason?.messageKey ?? CONNECT_ERRORS[refusalCode(err) ?? '']?.messageKey ?? 'assistant.error.generic';
|
||||
}
|
||||
|
||||
/** How each connection state reads on its pill. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// FE-GPX-PREVIEW-001 to FE-GPX-PREVIEW-003
|
||||
// FE-GPX-PREVIEW-001 to FE-GPX-PREVIEW-004
|
||||
// The GPX preview as ACT-01 uses it: preset to the tour's type, a city walk
|
||||
// imported as one, and when a track was recorded shown where it carried times.
|
||||
import { fireEvent, render, screen } from '@testing-library/react';
|
||||
@@ -47,6 +47,13 @@ describe('TourGpxPreviewDialog (ACT-01)', () => {
|
||||
expect(recorded[0]).toHaveTextContent('50 min');
|
||||
});
|
||||
|
||||
it('FE-GPX-PREVIEW-004: a track taken over from before Tours reads as one, not as a duplicate (#2810)', () => {
|
||||
render(<TourGpxPreviewDialog gpxImport={gpxImport([track({ adopts_track: true })])} />);
|
||||
expect(screen.getByTestId('gpx-preview-track')).not.toHaveAttribute('data-duplicate');
|
||||
expect(screen.getByText(/tours\.import\.previewAdopts|becomes a tour/)).toBeInTheDocument();
|
||||
expect(screen.queryByText(/tours\.import\.previewDuplicate|Already in the trip/)).toBeNull();
|
||||
});
|
||||
|
||||
it('FE-GPX-PREVIEW-002: imports as the preset type, a paddle tour with its boat and water', () => {
|
||||
const current = gpxImport([track()]);
|
||||
render(
|
||||
|
||||
@@ -79,6 +79,7 @@ function PreviewTrackRow({
|
||||
{track.name || name}
|
||||
</span>
|
||||
{track.duplicate && <SoftPill tone="warning">{t('tours.import.previewDuplicate')}</SoftPill>}
|
||||
{track.adopts_track && <SoftPill>{t('tours.import.previewAdopts')}</SoftPill>}
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-1.5 ps-8" style={fs(11)}>
|
||||
<span className={BADGE}>{formatDistance(track.distance_km, unit)}</span>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"@typescript-eslint/no-require-imports": 18,
|
||||
"@typescript-eslint/no-unsafe-function-type": 1,
|
||||
"@typescript-eslint/no-unused-vars": 36,
|
||||
"no-await-in-loop": 563,
|
||||
"no-await-in-loop": 562,
|
||||
"no-console": 235,
|
||||
"no-empty": 6
|
||||
},
|
||||
|
||||
@@ -91,7 +91,17 @@ const PROVIDER_MESSAGES: Partial<Record<AssistantErrorCode, string>> = {
|
||||
provider_unavailable: 'The provider is not responding',
|
||||
};
|
||||
|
||||
/** A provider's failure as the refusal a REST route answers with. */
|
||||
/**
|
||||
* A provider's failure as the refusal a REST route answers with. An own server
|
||||
* that answered without a model list says so in `reason`, so the form can name
|
||||
* the address instead of calling a server that is up unresponsive (#2808).
|
||||
*/
|
||||
export function providerRefusal(err: AiProviderError): DomainError {
|
||||
if (err.providerCode === 'no_model_list') {
|
||||
return new DomainError(REFUSAL_STATUS[err.code], 'The server answered, but sent no model list', {
|
||||
code: err.code,
|
||||
details: { code: err.code, reason: 'no_model_list' },
|
||||
});
|
||||
}
|
||||
return aiRefusal(err.code, PROVIDER_MESSAGES[err.code] ?? 'The provider refused the request');
|
||||
}
|
||||
|
||||
@@ -238,7 +238,15 @@ export class ModelCatalogService {
|
||||
const { models } = await this.llmLocal.listModels(baseUrl ?? undefined, apiKey ?? undefined);
|
||||
return models.map((m) => ({ id: m.name, label: m.name, supportsTools: true }));
|
||||
} catch (err) {
|
||||
if (err instanceof DomainError) throw new AiProviderError('provider_unavailable', err.getStatus(), true);
|
||||
// The server's own answer decides what the admin reads: a refused key, a
|
||||
// server that answered without a model list, or one that is not there.
|
||||
// All three read as "not responding" before, which sent people looking
|
||||
// at a server that was up (#2808).
|
||||
if (err instanceof DomainError) {
|
||||
if (err.code === 'llm_key_refused') throw new AiProviderError('invalid_key', err.getStatus(), false);
|
||||
const reason = err.code === 'llm_no_model_list' ? 'no_model_list' : undefined;
|
||||
throw new AiProviderError('provider_unavailable', err.getStatus(), true, undefined, reason);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,12 @@ const tagsResponseSchema = z.object({
|
||||
/** The OpenAI-compatible list (`GET /v1/models`) that LM Studio, vLLM and llama.cpp serve. */
|
||||
const openAiModelsSchema = z.object({ data: z.array(z.object({ id: z.string().optional() })) });
|
||||
|
||||
/** One place a server may list its models, and how its answer reads. */
|
||||
interface ModelListSource {
|
||||
url: string;
|
||||
read: (body: unknown) => { name?: string; size?: number }[] | undefined;
|
||||
}
|
||||
|
||||
/** The Bearer header the extraction sends, when a key is configured. */
|
||||
function authHeader(apiKey: string | undefined): Record<string, string> {
|
||||
return apiKey ? { authorization: `Bearer ${apiKey}` } : {};
|
||||
@@ -43,11 +49,23 @@ function upstreamRefusal(status: number, apiKey: string | undefined, fallback: s
|
||||
apiKey
|
||||
? `Local LLM server rejected the API key (${status})`
|
||||
: `Local LLM server requires an API key (${status}). Save the key for this address first.`,
|
||||
{ code: 'llm_key_refused' },
|
||||
);
|
||||
}
|
||||
return new DomainError(502, fallback);
|
||||
}
|
||||
|
||||
/**
|
||||
* A URL without its trailing slashes. Scanned off instead of `/\/+$/`-replaced:
|
||||
* that pattern re-walks the slash run from every start position of the
|
||||
* admin-supplied URL.
|
||||
*/
|
||||
function trimTrailingSlashes(url: string): string {
|
||||
let end = url.length;
|
||||
while (end > 0 && url.charCodeAt(end - 1) === 47 /* '/' */) end--;
|
||||
return url.slice(0, end);
|
||||
}
|
||||
|
||||
/**
|
||||
* Admin helpers for managing a local OpenAI-compatible LLM server (Ollama).
|
||||
* Talks to Ollama's *management* API (`/api/tags`, `/api/pull`), which lives at
|
||||
@@ -72,11 +90,7 @@ export class LlmLocalService {
|
||||
if (url.protocol !== 'http:' && url.protocol !== 'https:') {
|
||||
throw new HttpException({ error: 'Base URL must be http(s)' }, 400);
|
||||
}
|
||||
// Trailing slashes are scanned off instead of `/\/+$/`-replaced: that pattern
|
||||
// re-walks the slash run from every start position of the admin-supplied URL.
|
||||
let end = raw.length;
|
||||
while (end > 0 && raw.charCodeAt(end - 1) === 47 /* '/' */) end--;
|
||||
return raw.slice(0, end).replace(/\/v1$/, '');
|
||||
return trimTrailingSlashes(raw).replace(/\/v1$/, '');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,39 +108,69 @@ export class LlmLocalService {
|
||||
}
|
||||
|
||||
/**
|
||||
* List models already pulled on the local server. A server without Ollama's
|
||||
* `/api/tags` (LM Studio, vLLM, llama.cpp) answers 404 there, so its
|
||||
* OpenAI-compatible `/v1/models` is asked instead.
|
||||
* List the models the server offers. Ollama's `/api/tags` is asked first, then
|
||||
* the OpenAI-compatible list: at the address as entered (the one the chat
|
||||
* calls `/chat/completions` on, `https://api.groq.com/openai/v1` say), then at
|
||||
* `/v1/models` under the root for an address given without `/v1`.
|
||||
*
|
||||
* An answer only counts when it reads as a model list. LM Studio answers an
|
||||
* unknown path with 200 and an error object, and a proxy may answer it with a
|
||||
* login page, so stopping at the first answer that is not a 404 refused
|
||||
* servers whose list was one request further (#2808).
|
||||
*/
|
||||
async listModels(
|
||||
baseUrl: string | undefined,
|
||||
apiKey?: string,
|
||||
): Promise<{ models: { name: string; size: number }[] }> {
|
||||
const root = this.ollamaRoot(baseUrl);
|
||||
let res = await this.getModelList(`${root}/api/tags`, root, apiKey);
|
||||
let openAi = false;
|
||||
if (res.status === 404) {
|
||||
const fallback = await this.getModelList(`${root}/v1/models`, root, apiKey);
|
||||
if (fallback.ok) {
|
||||
discardBody(res);
|
||||
res = fallback;
|
||||
openAi = true;
|
||||
const asEntered = trimTrailingSlashes((baseUrl ?? '').trim()) || root;
|
||||
const lists: ModelListSource[] = [
|
||||
{ url: `${root}/api/tags`, read: (body) => tagsResponseSchema.safeParse(body).data?.models },
|
||||
...[...new Set([`${asEntered}/models`, `${root}/v1/models`])].map((url) => ({
|
||||
url,
|
||||
read: (body: unknown) => openAiModelsSchema.safeParse(body).data?.data.map((m) => ({ name: m.id, size: 0 })),
|
||||
})),
|
||||
];
|
||||
const seen = { firstStatus: 0, refusedStatus: 0 };
|
||||
const listed = await this.firstModelList(lists, 0, root, apiKey, seen);
|
||||
if (listed) return { models: listed.map((m) => ({ name: m.name ?? '', size: m.size ?? 0 })).filter((m) => m.name) };
|
||||
if (seen.refusedStatus) throw upstreamRefusal(seen.refusedStatus, apiKey, '');
|
||||
throw new DomainError(502, `Local LLM server sent no model list (${seen.firstStatus})`, {
|
||||
code: 'llm_no_model_list',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* The first of `lists`, from `index` on, that answers with a readable list,
|
||||
* asked one after the other. Only the first request tells whether the server
|
||||
* is there at all; a later one failing is that path, not the server.
|
||||
*/
|
||||
private async firstModelList(
|
||||
lists: ModelListSource[],
|
||||
index: number,
|
||||
root: string,
|
||||
apiKey: string | undefined,
|
||||
seen: { firstStatus: number; refusedStatus: number },
|
||||
): Promise<{ name?: string; size?: number }[] | null> {
|
||||
const list = lists[index];
|
||||
if (!list) return null;
|
||||
let res: Response | null = null;
|
||||
try {
|
||||
res = await this.getModelList(list.url, root, apiKey);
|
||||
} catch (err) {
|
||||
if (index === 0) throw err;
|
||||
}
|
||||
if (res) {
|
||||
seen.firstStatus ||= res.status;
|
||||
if (res.status === 401 || res.status === 403) seen.refusedStatus ||= res.status;
|
||||
if (res.ok) {
|
||||
const listed = list.read(await readCappedJson<unknown>(res, MAX_LIST_BYTES).catch(() => undefined));
|
||||
if (listed) return listed;
|
||||
} else {
|
||||
// Neither list exists: report the first answer, as before.
|
||||
discardBody(fallback);
|
||||
discardBody(res);
|
||||
}
|
||||
}
|
||||
if (!res.ok) {
|
||||
discardBody(res);
|
||||
throw upstreamRefusal(res.status, apiKey, `Local LLM server error (${res.status})`);
|
||||
}
|
||||
const body = await readCappedJson<unknown>(res, MAX_LIST_BYTES);
|
||||
const listed = openAi
|
||||
? openAiModelsSchema.safeParse(body).data?.data.map((m) => ({ name: m.id, size: 0 }))
|
||||
: tagsResponseSchema.safeParse(body).data?.models;
|
||||
if (!listed) throw new DomainError(502, 'Local LLM server sent an unreadable model list');
|
||||
const models = listed.map((m) => ({ name: m.name ?? '', size: m.size ?? 0 })).filter((m) => m.name);
|
||||
return { models };
|
||||
return this.firstModelList(lists, index + 1, root, apiKey, seen);
|
||||
}
|
||||
|
||||
private async getModelList(url: string, root: string, apiKey: string | undefined): Promise<Response> {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/**
|
||||
* Minimal Ollama native-API client used by the extraction router.
|
||||
* Minimal Ollama native-API client used by the extraction router. A server that
|
||||
* has no `/api/chat` gets the same extraction over OpenAI-compatible
|
||||
* `/chat/completions` instead (see extractOpenAiCompatible below).
|
||||
*
|
||||
* Why not the OpenAI-compatible `/v1/chat/completions` path the rest of llm-parse uses?
|
||||
* Ollama's `/v1` endpoint does NOT faithfully honour OpenAI's `response_format:{json_schema,strict}`
|
||||
@@ -12,7 +14,9 @@
|
||||
*/
|
||||
import { readEnv } from '../../../app-config';
|
||||
import { safeFetchLlm } from '../../../utils/ssrfGuard';
|
||||
import { OpenAiCompatibleClient } from '../clients/openai-compatible.client';
|
||||
import { parseLenientJson } from '../lenient-json';
|
||||
import type { LlmExtractionFile } from '../llm-provider.interface';
|
||||
|
||||
export interface EnforcedExtractInput {
|
||||
/** Ollama base URL — accepts the addon's `…/v1` form; the `/v1` suffix is stripped. */
|
||||
@@ -40,6 +44,13 @@ export function toNativeBase(baseUrl: string): string {
|
||||
return baseUrl.slice(0, end).replace(/\/v1$/, '');
|
||||
}
|
||||
|
||||
/**
|
||||
* The answers that say the server has no `/api/chat` at all, unless the body is
|
||||
* Ollama's own 404 for a model it has not pulled (OLLAMA_MISSING_MODEL).
|
||||
*/
|
||||
const NOT_OLLAMA_STATUSES = new Set([404, 405, 501]);
|
||||
const OLLAMA_MISSING_MODEL = /\bmodel\b.*\bnot found\b/i;
|
||||
|
||||
/**
|
||||
* Run one schema-constrained chat completion against Ollama's native `/api/chat`.
|
||||
* Returns the parsed JSON object (constrained to `schema`), or null if the request
|
||||
@@ -85,10 +96,61 @@ export async function extractEnforced(input: EnforcedExtractInput): Promise<Reco
|
||||
|
||||
if (!res.ok) {
|
||||
const detail = await res.text().catch(() => '');
|
||||
if (NOT_OLLAMA_STATUSES.has(res.status) && !OLLAMA_MISSING_MODEL.test(detail))
|
||||
return extractOpenAiCompatible(input);
|
||||
throw new Error(`Ollama /api/chat failed (${res.status}): ${detail.slice(0, 200)}`);
|
||||
}
|
||||
|
||||
const data = (await res.json()) as { message?: { content?: string } };
|
||||
const data = (await res.json().catch(() => null)) as { message?: { content?: string } } | null;
|
||||
// LM Studio answers a path it does not serve with 200 and an error object,
|
||||
// so an answer without Ollama's `message` is a server of another kind too.
|
||||
if (!data || typeof data.message !== 'object') return extractOpenAiCompatible(input);
|
||||
const parsed = parseLenientJson(data.message?.content);
|
||||
return parsed && typeof parsed === 'object' ? (parsed as Record<string, unknown>) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The same extraction against an OpenAI-compatible server (Groq, vLLM,
|
||||
* LM Studio, a LiteLLM proxy), which the "Own server" connection also names.
|
||||
* It goes to `/chat/completions` at the address as entered, the endpoint the
|
||||
* assistant chats on, through the client that already handles what such
|
||||
* servers refuse (`json_schema`, `max_tokens`, `temperature`). The schema is
|
||||
* asked for as a one-element list, the shape that client reads (#2806).
|
||||
*/
|
||||
async function extractOpenAiCompatible(input: EnforcedExtractInput): Promise<Record<string, unknown> | null> {
|
||||
const [file, ...pageImages] = (input.images ?? []).map(imageFile);
|
||||
const list = await new OpenAiCompatibleClient().extract({
|
||||
// The shape goes into the prompt as well: the client's later rungs send no
|
||||
// schema (json_object, then nothing), and json_object wants the word JSON.
|
||||
prompt:
|
||||
`${input.system} Answer with JSON only, as {"result": [object]} where the object follows this ` +
|
||||
`JSON Schema: ${JSON.stringify(input.schema)}`,
|
||||
jsonSchema: {
|
||||
type: 'object',
|
||||
properties: { result: { type: 'array', items: input.schema } },
|
||||
required: ['result'],
|
||||
},
|
||||
rootKey: 'result',
|
||||
userText: input.user,
|
||||
model: input.model,
|
||||
baseUrl: input.baseUrl,
|
||||
apiKey: input.apiKey,
|
||||
file,
|
||||
pageImages,
|
||||
});
|
||||
const first = list[0];
|
||||
return first && typeof first === 'object' ? first : null;
|
||||
}
|
||||
|
||||
/** The first characters of a base64 image, per type. Anything else is sent as JPEG. */
|
||||
const IMAGE_PREFIXES: [string, string][] = [
|
||||
['iVBOR', 'image/png'],
|
||||
['UklGR', 'image/webp'],
|
||||
['R0lGOD', 'image/gif'],
|
||||
];
|
||||
|
||||
/** A base64 image as a file, its type read from its first bytes. */
|
||||
function imageFile(base64: string): LlmExtractionFile {
|
||||
const mimeType = IMAGE_PREFIXES.find(([prefix]) => base64.startsWith(prefix))?.[1] ?? 'image/jpeg';
|
||||
return { mimeType, data: Buffer.from(base64, 'base64') };
|
||||
}
|
||||
|
||||
@@ -70,7 +70,10 @@ export function activityFacts(
|
||||
}
|
||||
|
||||
/** The times an import stores for a track, as the DATETIME columns hold them; NULL without. */
|
||||
function storedTimes(row: PreparedGpxPlace | undefined): { started: DbTimestamp | null; ended: DbTimestamp | null } {
|
||||
export function recordedTimesOf(row: PreparedGpxPlace | undefined): {
|
||||
started: DbTimestamp | null;
|
||||
ended: DbTimestamp | null;
|
||||
} {
|
||||
const times = row?.trackTimes;
|
||||
return times
|
||||
? { started: dbNow(new Date(times.startedAt)), ended: dbNow(new Date(times.endedAt)) }
|
||||
@@ -93,7 +96,7 @@ export function trackTimesFor(
|
||||
(row, at) => !taken.has(at) && row.name === place.name && row.lat === place.lat && row.lng === place.lng,
|
||||
);
|
||||
if (index >= 0) taken.add(index);
|
||||
byPlace.set(place.id, storedTimes(rows[index]));
|
||||
byPlace.set(place.id, recordedTimesOf(rows[index]));
|
||||
}
|
||||
return byPlace;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import { normalizePlaceName } from '@trek/shared';
|
||||
|
||||
/** A place of the trip as the places list reads it: enough to tell a track that is no tour yet. */
|
||||
export interface TripPlaceForAdoption {
|
||||
id: number;
|
||||
name: string;
|
||||
route_geometry?: string | null;
|
||||
tour_place_id?: number | null;
|
||||
}
|
||||
|
||||
/** A track of the trip a file row takes over: its place and the line it already holds. */
|
||||
export interface AdoptedTrack {
|
||||
id: number;
|
||||
route_geometry: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The rows of a tour import that take over a track already in the trip, by
|
||||
* row index: a place with a line and no tour yet, under the same name
|
||||
* (trimmed, any case, the duplicate rule's own reading), one place per row
|
||||
* and oldest first. A GPX file imported before Tours existed (4.x) left its
|
||||
* tracks as plain places, and the name alone made every tour import of the
|
||||
* same file a duplicate, with no tour to show for it (#2810).
|
||||
*/
|
||||
export function tracksToAdopt(
|
||||
rows: ReadonlyArray<{ name: string }>,
|
||||
places: ReadonlyArray<TripPlaceForAdoption>,
|
||||
): Map<number, AdoptedTrack> {
|
||||
const byName = new Map<string, AdoptedTrack[]>();
|
||||
for (const place of [...places].sort((a, b) => a.id - b.id)) {
|
||||
const key = normalizePlaceName(place.name);
|
||||
if (!key || !place.route_geometry || place.tour_place_id != null) continue;
|
||||
byName.set(key, [...(byName.get(key) ?? []), { id: place.id, route_geometry: place.route_geometry }]);
|
||||
}
|
||||
const adopt = new Map<number, AdoptedTrack>();
|
||||
rows.forEach((row, index) => {
|
||||
const key = normalizePlaceName(row.name);
|
||||
const track = key ? byName.get(key)?.shift() : undefined;
|
||||
if (track) adopt.set(index, track);
|
||||
});
|
||||
return adopt;
|
||||
}
|
||||
@@ -16,7 +16,7 @@ import { toRowId } from '../common/row-id';
|
||||
import { UnitOfWork } from '../database/unit-of-work';
|
||||
import { PlaceImportService } from '../place-import/place-import.service';
|
||||
import { PlacesService } from '../places/places.service';
|
||||
import { toActivity, trackTimesFor } from './tour-activities.helpers';
|
||||
import { recordedTimesOf, toActivity, trackTimesFor } from './tour-activities.helpers';
|
||||
import {
|
||||
copiedFacet,
|
||||
copyStart,
|
||||
@@ -29,6 +29,7 @@ import { readTourFile } from './tour-file-import.helpers';
|
||||
import { provenanceSource, tourItemOf } from './tour-item.helpers';
|
||||
import { TourPaddleCheckService } from './tour-paddle-check.service';
|
||||
import { advanceTourRevision } from './tour-revision';
|
||||
import { tracksToAdopt } from './tour-track-adoption';
|
||||
import { toVisit } from './tour-visits.service';
|
||||
import { checkTourCommand, firstPointOf, importFileName, keyedWaypoints, tourRouteFields } from './tour-write.helpers';
|
||||
import { computeTourMetrics, localHashOf, parseRouteGeometry, type GeometryPoint } from './tours.helpers';
|
||||
@@ -58,6 +59,30 @@ import {
|
||||
wandererDifficultyToSac,
|
||||
} from '@trek/shared';
|
||||
|
||||
/** `fn` over `items` one after the other, in order: the writes of one import share a transaction. */
|
||||
async function inOrder<T, R>(items: readonly T[], fn: (item: T) => Promise<R>): Promise<R[]> {
|
||||
return items.reduce<Promise<R[]>>(async (done, item) => [...(await done), await fn(item)], Promise.resolve([]));
|
||||
}
|
||||
|
||||
/**
|
||||
* What the type adds to each tour a file import makes: a bike tour and a run
|
||||
* their profile, a paddle tour its boat and water, a ski track its discipline
|
||||
* and technique (SKI-02). A run comes in without a pace and a ski track
|
||||
* without a time: neither is worked out for them, so they stay unknown.
|
||||
*/
|
||||
function importedTypeFields(fields: TourGpxImportFields) {
|
||||
return {
|
||||
bike_profile: fields.bike_profile ?? null,
|
||||
run_profile: fields.run_profile ?? null,
|
||||
run_pace_seconds_per_km: null,
|
||||
ski_discipline: fields.ski_discipline ?? null,
|
||||
ski_technique: fields.ski_technique ?? null,
|
||||
boat_type: fields.boat_type ?? null,
|
||||
water_context: fields.water_context ?? null,
|
||||
paddle_speed_kmh: null,
|
||||
};
|
||||
}
|
||||
|
||||
export interface ImportGpxAsTourResult {
|
||||
tours: TourListItem[];
|
||||
caution: boolean;
|
||||
@@ -783,88 +808,45 @@ export class ToursService {
|
||||
const { rows } = await readTourFile(this.placeImport, fileBuffer, fileName);
|
||||
if (rows.length === 0) return null;
|
||||
await this.assertTourTypeEnabled(fields.tour_type);
|
||||
// What the type adds to each imported tour: a bike tour and a run their profile, a paddle tour its boat and water,
|
||||
// a ski track its discipline and technique (SKI-02). A run comes in without a pace and a ski track without a
|
||||
// time: neither is worked out for them, so they stay unknown.
|
||||
const typeFields = {
|
||||
bike_profile: fields.bike_profile ?? null,
|
||||
run_profile: fields.run_profile ?? null,
|
||||
run_pace_seconds_per_km: null,
|
||||
ski_discipline: fields.ski_discipline ?? null,
|
||||
ski_technique: fields.ski_technique ?? null,
|
||||
boat_type: fields.boat_type ?? null,
|
||||
water_context: fields.water_context ?? null,
|
||||
paddle_speed_kmh: null,
|
||||
};
|
||||
const typeFields = importedTypeFields(fields);
|
||||
|
||||
const adopt = await this.adoptableTracks(tripId, rows);
|
||||
const fresh = rows.filter((_, index) => !adopt.has(index));
|
||||
const tours: TourListItem[] = [];
|
||||
const adopted: number[] = [];
|
||||
const result = await this.uow.transactional(async () => {
|
||||
// A nested transactional, so the places and their facets commit together.
|
||||
const imported = await this.places.importPreparedGpx(tripId, rows);
|
||||
const times = trackTimesFor(rows, imported.places);
|
||||
for (const place of imported.places) {
|
||||
const recorded = times.get(place.id);
|
||||
const metrics = computeTourMetrics(parseRouteGeometry(place.route_geometry));
|
||||
const matchConfidence = metrics.hasElevation ? 1 : 0.3;
|
||||
await this.toursRepo.insertTour({
|
||||
place_id: place.id,
|
||||
tour_type: fields.tour_type,
|
||||
...typeFields,
|
||||
distance: metrics.distanceKm,
|
||||
elevation_gain: metrics.elevationGainM,
|
||||
elevation_loss: metrics.elevationLossM,
|
||||
duration: null,
|
||||
planned_duration_minutes: null,
|
||||
break_additional_minutes: null,
|
||||
match_confidence: matchConfidence,
|
||||
max_hiking_difficulty: null,
|
||||
origin: 'gpx',
|
||||
origin_file_name: importFileName(fileName),
|
||||
track_started_at: recorded?.started ?? null,
|
||||
track_ended_at: recorded?.ended ?? null,
|
||||
});
|
||||
tours.push(
|
||||
tourItemOf({
|
||||
place_id: place.id,
|
||||
name: place.name,
|
||||
description: place.description ?? null,
|
||||
website: place.website ?? null,
|
||||
tour_type: fields.tour_type,
|
||||
...typeFields,
|
||||
distance: metrics.distanceKm,
|
||||
elevation_gain: metrics.elevationGainM,
|
||||
elevation_loss: metrics.elevationLossM,
|
||||
duration: null,
|
||||
planned_duration_minutes: null,
|
||||
break_additional_minutes: null,
|
||||
difficulty: null,
|
||||
wanderer_ref: null,
|
||||
match_confidence: matchConfidence,
|
||||
max_hiking_difficulty: null,
|
||||
derived_from_place_id: null,
|
||||
origin: 'gpx',
|
||||
portage_speed_kmh: null,
|
||||
paddle_lake_style: null,
|
||||
track_marks: null,
|
||||
has_recorded_track: 0,
|
||||
planned: 0,
|
||||
has_waypoints: 0,
|
||||
stage_ends: 0,
|
||||
route_missing: 0,
|
||||
revision: 1,
|
||||
hiking_preferences: null,
|
||||
track_started_at: recorded?.started ?? null,
|
||||
track_ended_at: recorded?.ended ?? null,
|
||||
}),
|
||||
);
|
||||
}
|
||||
const imported =
|
||||
fresh.length > 0 ? await this.places.importPreparedGpx(tripId, fresh) : { places: [], count: 0, skipped: 0 };
|
||||
const times = trackTimesFor(fresh, imported.places);
|
||||
tours.push(
|
||||
...(await inOrder(imported.places, (place) =>
|
||||
this.insertImportedTour(
|
||||
place,
|
||||
place.route_geometry ?? null,
|
||||
times.get(place.id),
|
||||
fields,
|
||||
typeFields,
|
||||
fileName,
|
||||
),
|
||||
)),
|
||||
);
|
||||
// A track from before Tours keeps its place and its line and becomes the
|
||||
// tour; the file adds the recorded times 4.x never stored.
|
||||
await inOrder([...adopt], async ([index, track]) => {
|
||||
const place = await this.places.get(tripId, String(track.id));
|
||||
if (!place) return;
|
||||
const recorded = recordedTimesOf(rows[index]);
|
||||
tours.push(await this.insertImportedTour(place, track.route_geometry, recorded, fields, typeFields, fileName));
|
||||
adopted.push(place.id);
|
||||
});
|
||||
return imported;
|
||||
});
|
||||
|
||||
if (result.places.length === 0) return { tours: [], caution: false, skipped: result.skipped };
|
||||
if (tours.length === 0) return { tours: [], caution: false, skipped: result.skipped };
|
||||
this.broadcastToursChanged(
|
||||
tripId,
|
||||
result.places.map((place) => place.id),
|
||||
tours.map((tour) => tour.place_id),
|
||||
socketId,
|
||||
);
|
||||
for (const place of result.places) {
|
||||
@@ -874,9 +856,90 @@ export class ToursService {
|
||||
this.logger.warn(`Committed GPX place ${place.id}: realtime notification failed`);
|
||||
}
|
||||
}
|
||||
// The taken-over places now read as tours; the other clients get the row again.
|
||||
await inOrder(adopted, async (id) => {
|
||||
try {
|
||||
const place = await this.places.get(tripId, String(id));
|
||||
if (place) this.places.broadcast(tripId, 'place:updated', { place }, socketId);
|
||||
} catch {
|
||||
this.logger.warn(`Committed GPX tour on place ${id}: realtime notification failed`);
|
||||
}
|
||||
});
|
||||
return { tours, caution: tours.some((t) => t.caution), skipped: result.skipped };
|
||||
}
|
||||
|
||||
/** Which rows of a file take over a track of the trip from before Tours (#2810), read off the places list. */
|
||||
private async adoptableTracks(tripId: string, rows: ReadonlyArray<{ name: string }>) {
|
||||
return tracksToAdopt(rows, await this.places.list(tripId, {}));
|
||||
}
|
||||
|
||||
/**
|
||||
* The `tours` row for one place of a GPX import, with its metrics read off
|
||||
* `geometry` and the recorded times, and the list item the import answers
|
||||
* with. A new place and a track taken over from before Tours (#2810) get the
|
||||
* same row.
|
||||
*/
|
||||
private async insertImportedTour(
|
||||
place: { id: number; name: string; description?: string | null; website?: string | null },
|
||||
geometry: string | null,
|
||||
recorded: ReturnType<typeof recordedTimesOf> | undefined,
|
||||
fields: TourGpxImportFields,
|
||||
typeFields: ReturnType<typeof importedTypeFields>,
|
||||
fileName: string | undefined,
|
||||
): Promise<TourListItem> {
|
||||
const metrics = computeTourMetrics(parseRouteGeometry(geometry));
|
||||
const matchConfidence = metrics.hasElevation ? 1 : 0.3;
|
||||
await this.toursRepo.insertTour({
|
||||
place_id: place.id,
|
||||
tour_type: fields.tour_type,
|
||||
...typeFields,
|
||||
distance: metrics.distanceKm,
|
||||
elevation_gain: metrics.elevationGainM,
|
||||
elevation_loss: metrics.elevationLossM,
|
||||
duration: null,
|
||||
planned_duration_minutes: null,
|
||||
break_additional_minutes: null,
|
||||
match_confidence: matchConfidence,
|
||||
max_hiking_difficulty: null,
|
||||
origin: 'gpx',
|
||||
origin_file_name: importFileName(fileName),
|
||||
track_started_at: recorded?.started ?? null,
|
||||
track_ended_at: recorded?.ended ?? null,
|
||||
});
|
||||
return tourItemOf({
|
||||
place_id: place.id,
|
||||
name: place.name,
|
||||
description: place.description ?? null,
|
||||
website: place.website ?? null,
|
||||
tour_type: fields.tour_type,
|
||||
...typeFields,
|
||||
distance: metrics.distanceKm,
|
||||
elevation_gain: metrics.elevationGainM,
|
||||
elevation_loss: metrics.elevationLossM,
|
||||
duration: null,
|
||||
planned_duration_minutes: null,
|
||||
break_additional_minutes: null,
|
||||
difficulty: null,
|
||||
wanderer_ref: null,
|
||||
match_confidence: matchConfidence,
|
||||
max_hiking_difficulty: null,
|
||||
derived_from_place_id: null,
|
||||
origin: 'gpx',
|
||||
portage_speed_kmh: null,
|
||||
paddle_lake_style: null,
|
||||
track_marks: null,
|
||||
has_recorded_track: 0,
|
||||
planned: 0,
|
||||
has_waypoints: 0,
|
||||
stage_ends: 0,
|
||||
route_missing: 0,
|
||||
revision: 1,
|
||||
hiking_preferences: null,
|
||||
track_started_at: recorded?.started ?? null,
|
||||
track_ended_at: recorded?.ended ?? null,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* PAD-02: what a file would import, read with the import's own parser and
|
||||
* duplicate rule and written nowhere. Null when the file holds no track or
|
||||
@@ -887,6 +950,7 @@ export class ToursService {
|
||||
const { rows, leftOut } = await readTourFile(this.placeImport, fileBuffer, fileName);
|
||||
if (rows.length === 0) return null;
|
||||
const duplicates = await this.places.gpxDuplicates(tripId, rows);
|
||||
const adopt = await this.adoptableTracks(tripId, rows);
|
||||
return {
|
||||
tracks: rows.map((row, index) => {
|
||||
const geometry = parseRouteGeometry(row.routeGeometry);
|
||||
@@ -900,7 +964,8 @@ export class ToursService {
|
||||
elevation_loss_m: metrics.elevationLossM,
|
||||
started_at: row.trackTimes?.startedAt ?? null,
|
||||
ended_at: row.trackTimes?.endedAt ?? null,
|
||||
duplicate: duplicates[index] ?? false,
|
||||
duplicate: !adopt.has(index) && (duplicates[index] ?? false),
|
||||
...(adopt.has(index) ? { adopts_track: true } : {}),
|
||||
};
|
||||
}),
|
||||
...(leftOut ? { left_out: leftOut } : {}),
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
/**
|
||||
* An "Own server" that is OpenAI-compatible but not Ollama, end to end: the
|
||||
* whole app against a fake server on loopback that only answers under
|
||||
* `/openai/v1`, the way Groq does, and 404s every Ollama path.
|
||||
*
|
||||
* Covered: connecting it as the instance connection (#2808), the refusal that
|
||||
* says the server answered without a model list, a refused key, and a booking
|
||||
* read through it by AI parsing, which used to call Ollama's `/api/chat` and
|
||||
* fail with the server's 404 (#2806).
|
||||
*/
|
||||
import { buildApp } from '../../src/bootstrap';
|
||||
import { withRequestContext } from '../../src/nest/database/request-context';
|
||||
import { LlmParseService } from '../../src/nest/llm-parse/llm-parse.service';
|
||||
import { setAddonEnabled } from '../helpers/factories/settings';
|
||||
import { makeUser } from '../helpers/factories/users';
|
||||
import { resetRateLimits } from '../helpers/test-db';
|
||||
import { sessionCookie } from './harness';
|
||||
import { MikroORM } from '@mikro-orm/core';
|
||||
import type { INestApplication } from '@nestjs/common';
|
||||
|
||||
import { createServer, type IncomingMessage, type Server as HttpServer, type ServerResponse } from 'node:http';
|
||||
import type { AddressInfo } from 'node:net';
|
||||
import request from 'supertest';
|
||||
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest';
|
||||
|
||||
// ── The fake server ──────────────────────────────────────────────────────────
|
||||
|
||||
/** How the fake answers: as Groq does, with 200 and a page for every path, or refusing every key. */
|
||||
const server = { mode: 'groq' as 'groq' | 'html' | 'refuse', seen: [] as string[], chats: [] as unknown[] };
|
||||
|
||||
async function readBody(req: IncomingMessage): Promise<string> {
|
||||
let text = '';
|
||||
for await (const chunk of req) text += String(chunk);
|
||||
return text;
|
||||
}
|
||||
|
||||
function json(res: ServerResponse, status: number, body: unknown): void {
|
||||
res.writeHead(status, { 'content-type': 'application/json' });
|
||||
res.end(JSON.stringify(body));
|
||||
}
|
||||
|
||||
async function answer(req: IncomingMessage, res: ServerResponse): Promise<void> {
|
||||
server.seen.push(`${req.method} ${req.url}`);
|
||||
const body = await readBody(req);
|
||||
if (server.mode === 'refuse') return json(res, 401, { error: { message: 'Invalid API Key' } });
|
||||
if (server.mode === 'html') {
|
||||
res.writeHead(200, { 'content-type': 'text/html' });
|
||||
res.end('<html><body>Sign in</body></html>');
|
||||
return;
|
||||
}
|
||||
if (req.method === 'GET' && req.url === '/openai/v1/models') {
|
||||
return json(res, 200, { object: 'list', data: [{ id: 'openai/gpt-oss-120b', object: 'model' }] });
|
||||
}
|
||||
if (req.method === 'POST' && req.url === '/openai/v1/chat/completions') {
|
||||
server.chats.push(JSON.parse(body));
|
||||
const hotel = {
|
||||
name: 'Hotel Sakura',
|
||||
address: '1-2-3 Asakusa, Tokyo',
|
||||
checkin_time: '2026-11-02T15:00:00',
|
||||
checkout_time: '2026-11-05T11:00:00',
|
||||
};
|
||||
const result = { result: [hotel] };
|
||||
return json(res, 200, { choices: [{ message: { content: JSON.stringify(result) }, finish_reason: 'stop' }] });
|
||||
}
|
||||
json(res, 404, {
|
||||
error: {
|
||||
message: `Unknown request URL: ${req.method} ${req.url}.`,
|
||||
type: 'invalid_request_error',
|
||||
code: 'unknown_url',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// ── The app ──────────────────────────────────────────────────────────────────
|
||||
|
||||
let nestApp: INestApplication;
|
||||
let orm: MikroORM;
|
||||
let fake: HttpServer;
|
||||
let adminId: number;
|
||||
|
||||
function connect(apiKey = 'gsk_test'): request.Test {
|
||||
const { port } = fake.address() as AddressInfo;
|
||||
return request(nestApp.getHttpServer())
|
||||
.put('/api/admin/ai/connection')
|
||||
.set('Cookie', sessionCookie(adminId))
|
||||
.send({ kind: 'custom', baseUrl: `http://127.0.0.1:${port}/openai/v1`, apiKey, model: 'openai/gpt-oss-120b' });
|
||||
}
|
||||
|
||||
beforeAll(async () => {
|
||||
fake = createServer((req, res) => {
|
||||
answer(req, res).catch(() => res.destroy());
|
||||
});
|
||||
await new Promise<void>((resolve) => fake.listen(0, '127.0.0.1', resolve));
|
||||
nestApp = await buildApp();
|
||||
orm = nestApp.get(MikroORM);
|
||||
await setAddonEnabled(orm, 'ai_assistant', true);
|
||||
adminId = (await makeUser(orm, { role: 'admin' })).user.id;
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await resetRateLimits(nestApp);
|
||||
server.mode = 'groq';
|
||||
server.seen = [];
|
||||
server.chats = [];
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await nestApp.close();
|
||||
await new Promise<void>((resolve) => fake.close(() => resolve()));
|
||||
});
|
||||
|
||||
// ── Cases ────────────────────────────────────────────────────────────────────
|
||||
|
||||
describe('An OpenAI-compatible own server', () => {
|
||||
it('AIOWN-E2E-001: connects, its models read from the list at the address as entered (#2808)', async () => {
|
||||
const res = await connect();
|
||||
expect(res.status).toBe(200);
|
||||
expect(server.seen.slice(0, 2)).toEqual(['GET /openai/api/tags', 'GET /openai/v1/models']);
|
||||
});
|
||||
|
||||
it('AIOWN-E2E-002: a server that answers without a model list is told apart from one that is down', async () => {
|
||||
server.mode = 'html';
|
||||
// Its own key, so the list the first case read is not taken from the catalog's cache.
|
||||
const res = await connect('gsk_html');
|
||||
expect(res.status).toBe(502);
|
||||
expect(res.body).toMatchObject({ code: 'provider_unavailable', reason: 'no_model_list' });
|
||||
});
|
||||
|
||||
it('AIOWN-E2E-003: a refused key reads as a refused key, not as a server that is down', async () => {
|
||||
server.mode = 'refuse';
|
||||
const res = await connect('wrong');
|
||||
expect(res.status).toBe(422);
|
||||
expect(res.body).toMatchObject({ code: 'invalid_key' });
|
||||
});
|
||||
|
||||
it('AIOWN-E2E-004: AI parsing reads a booking through /chat/completions when /api/chat is missing (#2806)', async () => {
|
||||
expect((await connect()).status).toBe(200);
|
||||
await setAddonEnabled(orm, 'llm_parsing', true);
|
||||
server.seen = [];
|
||||
// Outside a request, so it needs its own ORM context, as a job would.
|
||||
const booking = {
|
||||
buffer: Buffer.from('Booking confirmation\nHotel Sakura, Tokyo\nCheck-in 2 Nov 2026, check-out 5 Nov 2026'),
|
||||
originalName: 'booking.txt',
|
||||
};
|
||||
const out = await withRequestContext(orm, () => nestApp.get(LlmParseService).parse(booking, adminId));
|
||||
expect(out.warnings.filter((w) => /failed/i.test(w))).toEqual([]);
|
||||
expect(out.kiItems).toHaveLength(1);
|
||||
expect(server.seen).toContain('POST /openai/api/chat');
|
||||
expect(server.seen).toContain('POST /openai/v1/chat/completions');
|
||||
const sent = server.chats[0] as { model: string; messages: { role: string }[] };
|
||||
expect(sent.model).toBe('openai/gpt-oss-120b');
|
||||
});
|
||||
});
|
||||
@@ -535,6 +535,36 @@ describe('Tours e2e (real guards + temp SQLite)', () => {
|
||||
expect(await countRows(orm, Tours)).toBe(1);
|
||||
});
|
||||
|
||||
it('takes over a track from before Tours with the same name instead of skipping it (#2810)', async () => {
|
||||
// 4.x stored a GPX track as a plain place: a line, no tours row.
|
||||
const line = '[[49,12,100],[49.01,12.01,150],[49.02,12.02,120]]';
|
||||
const legacy = (await makePlace(orm, 5, { name: 'Alpine Loop ', lat: 49, lng: 12, route_geometry: line })).id;
|
||||
const elsewhere = (await makePlace(orm, 6, { name: 'Alpine loop', lat: 49, lng: 12, route_geometry: line })).id;
|
||||
|
||||
const preview = await previewGpx(OWNER, TRACK_GPX);
|
||||
expect(preview.status).toBe(200);
|
||||
expect(preview.body.tracks[0]).toMatchObject({ duplicate: false, adopts_track: true });
|
||||
expect(await countRows(orm, Tours)).toBe(0);
|
||||
|
||||
const res = await importGpx(OWNER, TRACK_GPX);
|
||||
expect(res.status).toBe(201);
|
||||
expect(res.body).toMatchObject({ caution: false, skipped: 0 });
|
||||
expect(res.body.tours.map((tour: { place_id: number }) => tour.place_id)).toEqual([legacy]);
|
||||
expect(await countRows(orm, Places, { trip: 5 })).toBe(1);
|
||||
expect(await placeColumns(legacy, 'name', 'route_geometry')).toEqual({
|
||||
name: 'Alpine Loop ',
|
||||
route_geometry: line,
|
||||
});
|
||||
expect(await findRow(orm, Tours, { place: legacy })).toMatchObject({ tour_type: 'hike', origin: 'gpx' });
|
||||
expect(await findRow(orm, Tours, { place: elsewhere })).toBeNull();
|
||||
expect(broadcast.mock.calls.map((c) => c[1])).toEqual(expect.arrayContaining(['tours:changed', 'place:updated']));
|
||||
expect(broadcast.mock.calls.map((c) => c[1])).not.toContain('place:created');
|
||||
|
||||
// Now a tour, the same file is a duplicate again.
|
||||
expect((await previewGpx(OWNER, TRACK_GPX)).body.tracks[0]).toMatchObject({ duplicate: true });
|
||||
expect((await importGpx(OWNER, TRACK_GPX)).body).toEqual({ tours: [], caution: false, skipped: 1 });
|
||||
});
|
||||
|
||||
it('400 without a file, and for a file with no track or route', async () => {
|
||||
const missing = await importGpx(OWNER, null);
|
||||
expect(missing.status).toBe(400);
|
||||
|
||||
@@ -127,6 +127,16 @@ describe('constants', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('AIHLP-031b: an own server that answered without a model list says so in reason (#2808)', () => {
|
||||
const err = providerRefusal(new AiProviderError('provider_unavailable', 404, true, undefined, 'no_model_list'));
|
||||
expect(err.getStatus()).toBe(502);
|
||||
expect(err.toBody()).toEqual({
|
||||
error: 'The server answered, but sent no model list',
|
||||
code: 'provider_unavailable',
|
||||
reason: 'no_model_list',
|
||||
});
|
||||
});
|
||||
|
||||
it('AIHLP-032: the host a conversation goes to', () => {
|
||||
expect(aiHostOf('anthropic', null)).toBe('api.anthropic.com');
|
||||
expect(aiHostOf('chatgpt', null)).toBe('api.openai.com');
|
||||
|
||||
@@ -201,6 +201,19 @@ describe('ModelCatalogService', () => {
|
||||
).rejects.toMatchObject({ code: 'provider_unavailable', status: 502 });
|
||||
});
|
||||
|
||||
it('MCAT-007b: a custom server that refuses the key, or answers without a list, says so (#2808)', async () => {
|
||||
const target = { kind: 'custom' as const, baseUrl: 'https://llm.example.org/v1', secret: 'k' };
|
||||
llmLocal.listModels.mockRejectedValueOnce(new DomainError(502, 'rejected', { code: 'llm_key_refused' }));
|
||||
await expect(catalog().list(target)).rejects.toMatchObject({ code: 'invalid_key', retryable: false });
|
||||
llmLocal.listModels.mockRejectedValueOnce(new DomainError(502, 'no list', { code: 'llm_no_model_list' }));
|
||||
await expect(catalog().list(target)).rejects.toMatchObject({
|
||||
code: 'provider_unavailable',
|
||||
providerCode: 'no_model_list',
|
||||
});
|
||||
llmLocal.listModels.mockRejectedValueOnce(new Error('boom'));
|
||||
await expect(catalog().list(target)).rejects.toThrow('boom');
|
||||
});
|
||||
|
||||
it('MCAT-008: the default model is a capable one, else the first listed', () => {
|
||||
const list = (...ids: string[]) => ids.map((id) => ({ id, label: id, supportsTools: true }));
|
||||
expect(pickDefaultModel('anthropic', list('claude-haiku', 'claude-sonnet-5', 'claude-opus'))).toBe(
|
||||
|
||||
@@ -247,7 +247,7 @@ describe('what the engine reads', () => {
|
||||
|
||||
expect(travel.entries.map((e) => [e.id, e.title, e.mood])).toEqual([[entry.id, 'Alfama', 'amazing']]);
|
||||
expect(travel.locale).toBe('de-DE');
|
||||
expect(travel.labels).toMatchObject({ day: 'TAG {day}', stations: 'Stationen', pros: 'Pro', cons: 'Contra' });
|
||||
expect(travel.labels).toMatchObject({ day: 'TAG {day}', stations: 'Unterwegs', pros: 'Pro', cons: 'Contra' });
|
||||
expect(travel.path).toEqual([]);
|
||||
expect((await edit.wordsFor(owner.id)).locale).toBe('de-DE');
|
||||
});
|
||||
|
||||
@@ -21,7 +21,7 @@ describe('the book words', () => {
|
||||
expect(french.locale).toBe('fr-FR');
|
||||
expect(french.labels).toMatchObject({
|
||||
day: 'JOUR {day}',
|
||||
stations: 'Étapes',
|
||||
stations: 'En chemin',
|
||||
summary: 'Résumé',
|
||||
countries: 'Pays',
|
||||
});
|
||||
@@ -30,7 +30,7 @@ describe('the book words', () => {
|
||||
locale: 'en-US',
|
||||
labels: {
|
||||
day: 'DAY {day}',
|
||||
stations: 'Stations',
|
||||
stations: 'Along the way',
|
||||
summary: 'Summary',
|
||||
countries: 'Countries',
|
||||
distance: 'Distance',
|
||||
|
||||
@@ -96,11 +96,63 @@ describe('LlmLocalService.listModels', () => {
|
||||
expect(fetchFn.mock.calls[1][1].headers).toMatchObject({ authorization: 'Bearer k' });
|
||||
});
|
||||
|
||||
it('keeps the 404 when the OpenAI model list is missing too', async () => {
|
||||
mockFetch(async () => ({ ok: false, status: 404, body: null }));
|
||||
it('says no model list came, with the first status, when no list exists anywhere', async () => {
|
||||
const fetchFn = mockFetch(async () => ({ ok: false, status: 404, body: null }));
|
||||
await expect(svc().listModels('http://nothing:1')).rejects.toMatchObject({
|
||||
response: { error: 'Local LLM server error (404)' },
|
||||
code: 'llm_no_model_list',
|
||||
response: { error: 'Local LLM server sent no model list (404)' },
|
||||
});
|
||||
expect(fetchFn.mock.calls.map((c: unknown[]) => c[0])).toEqual([
|
||||
'http://nothing:1/api/tags',
|
||||
'http://nothing:1/models',
|
||||
'http://nothing:1/v1/models',
|
||||
]);
|
||||
});
|
||||
|
||||
it('reads past an /api/tags that answers 200 without a model list, as LM Studio does (#2808)', async () => {
|
||||
mockFetch(async (url?: string) =>
|
||||
url?.endsWith('/api/tags')
|
||||
? { ok: true, status: 200, json: async () => ({ error: 'Unexpected endpoint or method. (GET /api/tags)' }) }
|
||||
: { ok: true, status: 200, json: async () => ({ data: [{ id: 'qwen3-8b' }] }) },
|
||||
);
|
||||
expect((await svc().listModels('http://lmstudio:1234/v1')).models).toEqual([{ name: 'qwen3-8b', size: 0 }]);
|
||||
});
|
||||
|
||||
it('asks the address as entered when it does not end in /v1 (#2808)', async () => {
|
||||
const fetchFn = mockFetch(async (url?: string) =>
|
||||
url === 'https://owui.example.org/api/models'
|
||||
? { ok: true, status: 200, json: async () => ({ data: [{ id: 'llama3.3' }] }) }
|
||||
: { ok: false, status: 404, body: null },
|
||||
);
|
||||
expect((await svc().listModels('https://owui.example.org/api/', 'k')).models).toEqual([
|
||||
{ name: 'llama3.3', size: 0 },
|
||||
]);
|
||||
expect(fetchFn.mock.calls.map((c: unknown[]) => c[0])).toEqual([
|
||||
'https://owui.example.org/api/api/tags',
|
||||
'https://owui.example.org/api/models',
|
||||
]);
|
||||
});
|
||||
|
||||
it('reports a refused key even when the refusal came from a later list', async () => {
|
||||
mockFetch(async (url?: string) =>
|
||||
url?.endsWith('/api/tags') ? { ok: false, status: 404, body: null } : { ok: false, status: 401, body: null },
|
||||
);
|
||||
await expect(svc().listModels('https://api.groq.com/openai/v1', 'bad')).rejects.toMatchObject({
|
||||
code: 'llm_key_refused',
|
||||
response: { error: 'Local LLM server rejected the API key (401)' },
|
||||
});
|
||||
});
|
||||
|
||||
it('skips a later list that cannot be reached, and a body that is not JSON', async () => {
|
||||
safeFetchLlmMock
|
||||
.mockImplementationOnce(async () => ({
|
||||
ok: true,
|
||||
status: 200,
|
||||
json: async () => Promise.reject(new Error('html')),
|
||||
}))
|
||||
.mockImplementationOnce(() => Promise.reject(new Error('ECONNRESET')))
|
||||
.mockImplementationOnce(async () => ({ ok: true, status: 200, json: async () => ({ data: [{ id: 'm' }] }) }));
|
||||
expect((await svc().listModels('http://vllm:8000')).models).toEqual([{ name: 'm', size: 0 }]);
|
||||
});
|
||||
|
||||
it('502s when the server is unreachable', async () => {
|
||||
|
||||
@@ -95,4 +95,79 @@ describe('extractEnforced', () => {
|
||||
mockFetch(() => jsonResponse({ error: 'model not found' }, false, 404));
|
||||
await expect(extractEnforced(INPUT)).rejects.toThrow(/Ollama \/api\/chat failed \(404\)/);
|
||||
});
|
||||
|
||||
it('throws for a server error without trying another path', async () => {
|
||||
const fetchFn = mockFetch(() => jsonResponse({ error: 'boom' }, false, 500));
|
||||
await expect(extractEnforced(INPUT)).rejects.toThrow(/failed \(500\)/);
|
||||
expect(fetchFn).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('extractEnforced on an OpenAI-compatible server (#2806)', () => {
|
||||
const GROQ = { ...INPUT, baseUrl: 'https://api.groq.com/openai/v1', model: 'openai/gpt-oss-120b', apiKey: 'gsk' };
|
||||
const chatAnswer = (content: string) => jsonResponse({ choices: [{ message: { content } }] });
|
||||
const unknownUrl = (url: string) =>
|
||||
jsonResponse(
|
||||
{ error: { message: `Unknown request URL: POST ${new URL(url).pathname}.`, code: 'unknown_url' } },
|
||||
false,
|
||||
404,
|
||||
);
|
||||
|
||||
it('sends the extraction to /chat/completions at the address as entered when /api/chat is missing', async () => {
|
||||
const fetchFn = mockFetch((url = '') =>
|
||||
url.endsWith('/api/chat') ? unknownUrl(url) : chatAnswer('{"result":[{"name":"Hotel"}]}'),
|
||||
);
|
||||
expect(await extractEnforced(GROQ)).toEqual({ name: 'Hotel' });
|
||||
expect(fetchFn.mock.calls.map((c) => c[0])).toEqual([
|
||||
'https://api.groq.com/openai/api/chat',
|
||||
'https://api.groq.com/openai/v1/chat/completions',
|
||||
]);
|
||||
const init = fetchFn.mock.calls[1][1] as RequestInit;
|
||||
expect((init.headers as Record<string, string>).authorization).toBe('Bearer gsk');
|
||||
const body = JSON.parse(init.body as string);
|
||||
expect(body.model).toBe('openai/gpt-oss-120b');
|
||||
expect(body.response_format.json_schema.schema).toEqual({
|
||||
type: 'object',
|
||||
properties: { result: { type: 'array', items: { type: 'object' } } },
|
||||
required: ['result'],
|
||||
});
|
||||
expect(body.messages[0].content).toContain('{"result": [object]}');
|
||||
expect(body.messages[1].content[0].text).toBe('doc');
|
||||
});
|
||||
|
||||
it('falls back on a 405 or 501 too, and on a 200 that is not an Ollama answer (LM Studio)', async () => {
|
||||
const fallsBackAfter = async (first: Response) => {
|
||||
mockFetch((url = '') => (url.endsWith('/api/chat') ? first : chatAnswer('{"result":[{"a":1}]}')));
|
||||
expect(await extractEnforced(GROQ)).toEqual({ a: 1 });
|
||||
};
|
||||
await fallsBackAfter(jsonResponse({}, false, 405));
|
||||
await fallsBackAfter(jsonResponse({}, false, 501));
|
||||
await fallsBackAfter(jsonResponse({ error: 'Unexpected endpoint' }));
|
||||
});
|
||||
|
||||
it('answers null when the server returns no object', async () => {
|
||||
mockFetch((url = '') => (url.endsWith('/api/chat') ? unknownUrl(url) : chatAnswer('{"result":[]}')));
|
||||
expect(await extractEnforced(GROQ)).toBeNull();
|
||||
});
|
||||
|
||||
it('passes the images on as image parts with their type', async () => {
|
||||
const fetchFn = mockFetch((url = '') =>
|
||||
url.endsWith('/api/chat') ? unknownUrl(url) : chatAnswer('{"result":[{}]}'),
|
||||
);
|
||||
await extractEnforced({ ...GROQ, images: ['iVBORw0K', '/9j/4AAQ', 'UklGRiQA', 'R0lGODlh'] });
|
||||
const parts = JSON.parse((fetchFn.mock.calls[1][1] as RequestInit).body as string).messages[1].content;
|
||||
expect(parts.slice(1).map((p: { image_url: { url: string } }) => p.image_url.url.split(';')[0])).toEqual([
|
||||
'data:image/png',
|
||||
'data:image/jpeg',
|
||||
'data:image/webp',
|
||||
'data:image/gif',
|
||||
]);
|
||||
});
|
||||
|
||||
it('reports the OpenAI-compatible failure when that path fails too', async () => {
|
||||
mockFetch((url = '') =>
|
||||
url.endsWith('/api/chat') ? unknownUrl(url) : jsonResponse({ error: 'bad model' }, false, 404),
|
||||
);
|
||||
await expect(extractEnforced(GROQ)).rejects.toThrow(/LLM request failed \(404\)/);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* tracksToAdopt (#2810): which rows of a tour import take over a track that a
|
||||
* GPX import before Tours left as a plain place.
|
||||
*/
|
||||
import { tracksToAdopt } from '../../../src/nest/tours/tour-track-adoption';
|
||||
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
const LINE = '[[46.1,11.1,1200],[46.2,11.2,1300]]';
|
||||
const track = (
|
||||
id: number,
|
||||
name: string,
|
||||
extra: { route_geometry?: string | null; tour_place_id?: number | null } = {},
|
||||
) => ({
|
||||
id,
|
||||
name,
|
||||
route_geometry: LINE,
|
||||
tour_place_id: null,
|
||||
...extra,
|
||||
});
|
||||
const rows = (...names: string[]) => names.map((name) => ({ name }));
|
||||
|
||||
describe('tracksToAdopt', () => {
|
||||
it('TRACK-ADOPT-001: pairs a row with a track of the same name, trimmed and in any case', () => {
|
||||
expect([...tracksToAdopt(rows('GARMIN HIKE'), [track(4, ' Garmin hike ')])]).toEqual([
|
||||
[0, { id: 4, route_geometry: LINE }],
|
||||
]);
|
||||
});
|
||||
|
||||
it('TRACK-ADOPT-002: gives each track to one row only, oldest first', () => {
|
||||
const adopt = tracksToAdopt(rows('Hike', 'hike', 'HIKE'), [track(9, 'hike'), track(3, 'Hike')]);
|
||||
expect([...adopt]).toEqual([
|
||||
[0, { id: 3, route_geometry: LINE }],
|
||||
[1, { id: 9, route_geometry: LINE }],
|
||||
]);
|
||||
});
|
||||
|
||||
it('TRACK-ADOPT-003: leaves out a tour, a place without a line, an unnamed place and an unnamed row', () => {
|
||||
const places = [
|
||||
track(1, 'Ridge', { tour_place_id: 1 }),
|
||||
track(2, 'Cafe', { route_geometry: null }),
|
||||
track(3, ' '),
|
||||
track(4, 'Lake'),
|
||||
];
|
||||
expect([...tracksToAdopt(rows('Ridge', 'Cafe', '', 'Other'), places)]).toEqual([]);
|
||||
});
|
||||
});
|
||||
@@ -27,8 +27,8 @@ import { RealtimeService } from '../../../src/nest/realtime/realtime.service';
|
||||
import { ToursService } from '../../../src/nest/tours/tours.service';
|
||||
import { UnsplashService } from '../../../src/nest/unsplash/unsplash.service';
|
||||
import { accommodationsOver } from '../../helpers/accommodations-service';
|
||||
import { createTrip, createUser } from '../../helpers/factories';
|
||||
import { countRows, findRows } from '../../helpers/factories/rows';
|
||||
import { createPlace, createTrip, createUser } from '../../helpers/factories';
|
||||
import { countRows, findRows, updateRows } from '../../helpers/factories/rows';
|
||||
import { noPaddleChecks } from '../../helpers/fake-paddle-checks';
|
||||
import { tourStageDays } from '../../helpers/fake-tour-stage-days';
|
||||
import { createTestBudgetItemsRepo } from '../../helpers/files-repos';
|
||||
@@ -86,7 +86,7 @@ const mixedGpx = Buffer.from(`<gpx>
|
||||
</trkseg><trkseg><trkpt lat="49.02" lon="12.02"><ele>120</ele></trkpt></trkseg></trk>
|
||||
</gpx>`);
|
||||
|
||||
const TRIGGERS = ['fail_facet', 'fail_place', 'fail_color'];
|
||||
const TRIGGERS = ['fail_facet', 'fail_place', 'fail_color', 'fail_adopt'];
|
||||
|
||||
/** The collaborator set the container hands PlacesService (the places.service.test.ts builder). */
|
||||
async function makePlacesService(): Promise<PlacesService> {
|
||||
@@ -314,6 +314,21 @@ describe('Tours GPX atomic persistence and postcommit publication', () => {
|
||||
await expectEmpty();
|
||||
});
|
||||
|
||||
it('rolls the new places back too when taking over a track from before Tours fails (#2810)', async () => {
|
||||
const legacy = createPlace(testDb, Number(tripId), { name: 'Ridge' }).id;
|
||||
await updateRows(
|
||||
await sharedTestOrm(testDb),
|
||||
Places,
|
||||
{ id: legacy },
|
||||
{ route_geometry: '[[49,12,100],[49.01,12.01,150]]' },
|
||||
);
|
||||
testDb.exec(`CREATE TRIGGER fail_adopt BEFORE INSERT ON tours WHEN NEW.place_id = ${legacy}
|
||||
BEGIN SELECT RAISE(ABORT, 'adopt failure'); END;`);
|
||||
await expect(tours.importGpxAsTour(tripId, mixedGpx)).rejects.toThrow('adopt failure');
|
||||
expect(await Promise.all([count('places'), count('tours')])).toEqual([1, 0]);
|
||||
expect(broadcast).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('rolls back carriers and earlier colors when later coloring fails', async () => {
|
||||
testDb.exec(`CREATE TRIGGER fail_color BEFORE UPDATE OF route_color ON places WHEN NEW.name = 'Ridge'
|
||||
BEGIN SELECT RAISE(ABORT, 'color failure'); END;`);
|
||||
|
||||
@@ -39,6 +39,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'فتح المساعد',
|
||||
'assistant.connect.badKey': 'هذا المفتاح لا يعمل.',
|
||||
'assistant.connect.unknownModel': 'هذا النموذج غير متاح هنا.',
|
||||
'assistant.connect.noModelList':
|
||||
'استجاب الخادم، لكنه لم يرسل قائمة بالنماذج. تحقّق من العنوان، فهو ينتهي عادةً بـ /v1.',
|
||||
'assistant.connect.getKey': 'الحصول على مفتاح',
|
||||
'assistant.connect.hintAnthropic': 'تتضمن باقتا Claude Max وTeam رصيدًا لـ API.',
|
||||
'assistant.connect.hintOpenai': 'أنشئ مفتاحًا في لوحة تحكم OpenAI.',
|
||||
|
||||
@@ -321,7 +321,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'تخطيط تلقائي',
|
||||
'journey.studio.export': 'تصدير',
|
||||
'journey.studio.day': 'اليوم {day}',
|
||||
'journey.studio.stations': 'المحطات',
|
||||
'journey.studio.stations': 'على الطريق',
|
||||
'journey.studio.peersHere': 'هنا',
|
||||
'journey.studio.folioAuto': 'تلقائي',
|
||||
'journey.studio.exportLayout': 'التخطيط',
|
||||
|
||||
@@ -969,6 +969,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'لم يُعثر على ملف KML في {name}',
|
||||
'tours.import.archiveTooLargeIn': '{name} كبير جدًا بعد فك الضغط',
|
||||
'tours.import.previewDuplicate': 'موجود بالفعل في الرحلة',
|
||||
'tours.import.previewAdopts': 'مسار موجود في الرحلة، سيصبح جولة',
|
||||
'tours.import.previewAllDuplicates': 'كل المسارات موجودة بالفعل في الرحلة، فلا شيء للاستيراد.',
|
||||
'tours.import.previewAs': 'الاستيراد كـ',
|
||||
'tours.import.previewConfirm': 'استيراد {count} جولة',
|
||||
|
||||
@@ -41,6 +41,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Köməkçini aç',
|
||||
'assistant.connect.badKey': 'Bu açar işləmir.',
|
||||
'assistant.connect.unknownModel': 'Bu model burada təklif olunmur.',
|
||||
'assistant.connect.noModelList':
|
||||
'Server cavab verdi, amma model siyahısı göndərmədi. Ünvanı yoxlayın, adətən /v1 ilə bitir.',
|
||||
'assistant.connect.getKey': 'Açar əldə et',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max və Team planlarına API kreditləri daxildir.',
|
||||
'assistant.connect.hintOpenai': 'OpenAI panelinizdə açar yaradın.',
|
||||
|
||||
@@ -323,7 +323,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Avtomatik tərtibat',
|
||||
'journey.studio.export': 'İxrac et',
|
||||
'journey.studio.day': 'GÜN {day}',
|
||||
'journey.studio.stations': 'Dayanacaqlar',
|
||||
'journey.studio.stations': 'Yol boyunca',
|
||||
'journey.studio.peersHere': 'burada',
|
||||
'journey.studio.folioAuto': 'Avtomatik',
|
||||
|
||||
|
||||
@@ -958,6 +958,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': '{name} içində KML faylı tapılmadı',
|
||||
'tours.import.archiveTooLargeIn': '{name} açıldıqdan sonra çox böyükdür',
|
||||
'tours.import.previewDuplicate': 'Artıq səyahətdədir',
|
||||
'tours.import.previewAdopts': 'Artıq səyahətdə trek kimi var, tura çevriləcək',
|
||||
'tours.import.previewAllDuplicates': 'Bütün treklər artıq səyahətdədir, idxal ediləcək heç nə yoxdur.',
|
||||
'tours.import.previewAs': 'Bu kimi idxal et',
|
||||
'tours.import.previewConfirm': '{count} tur idxal et',
|
||||
|
||||
@@ -41,6 +41,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Abrir assistente',
|
||||
'assistant.connect.badKey': 'Esta chave não funciona.',
|
||||
'assistant.connect.unknownModel': 'Este modelo não está disponível aqui.',
|
||||
'assistant.connect.noModelList':
|
||||
'O servidor respondeu, mas não enviou uma lista de modelos. Confira o endereço, ele costuma terminar em /v1.',
|
||||
'assistant.connect.getKey': 'Obter uma chave',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max e Team incluem créditos de API.',
|
||||
'assistant.connect.hintOpenai': 'Crie uma chave no seu painel da OpenAI.',
|
||||
|
||||
@@ -300,7 +300,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Layout automático',
|
||||
'journey.studio.export': 'Exportar',
|
||||
'journey.studio.day': 'DIA {day}',
|
||||
'journey.studio.stations': 'Etapas',
|
||||
'journey.studio.stations': 'Pelo caminho',
|
||||
'journey.studio.peersHere': 'aqui',
|
||||
'journey.studio.folioAuto': 'Automático',
|
||||
'journey.studio.exportLayout': 'Layout', // same-as-en
|
||||
|
||||
@@ -964,6 +964,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'Nenhum arquivo KML encontrado em {name}',
|
||||
'tours.import.archiveTooLargeIn': '{name} é grande demais depois de descompactado',
|
||||
'tours.import.previewDuplicate': 'Já está na viagem',
|
||||
'tours.import.previewAdopts': 'Já é uma trilha na viagem, vira um passeio',
|
||||
'tours.import.previewAllDuplicates': 'Todas as trilhas já estão na viagem, não há nada para importar.',
|
||||
'tours.import.previewAs': 'Importar como',
|
||||
'tours.import.previewConfirm': 'Importar {count} passeios',
|
||||
|
||||
@@ -41,6 +41,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Obre l’assistent',
|
||||
'assistant.connect.badKey': 'Aquesta clau no funciona.',
|
||||
'assistant.connect.unknownModel': 'Aquest model no s’ofereix aquí.',
|
||||
'assistant.connect.noModelList':
|
||||
'El servidor ha respost, però no ha enviat cap llista de models. Revisa l’adreça, normalment acaba en /v1.',
|
||||
'assistant.connect.getKey': 'Obtén una clau',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max i Team inclouen crèdits d’API.',
|
||||
'assistant.connect.hintOpenai': 'Crea una clau al teu tauler d’OpenAI.',
|
||||
|
||||
@@ -298,7 +298,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Disseny automàtic',
|
||||
'journey.studio.export': 'Exporta',
|
||||
'journey.studio.day': 'DIA {day}',
|
||||
'journey.studio.stations': 'Etapes',
|
||||
'journey.studio.stations': 'Pel camí',
|
||||
'journey.studio.peersHere': 'aquí',
|
||||
'journey.studio.folioAuto': 'Automàtic',
|
||||
'journey.studio.exportLayout': 'Disposició',
|
||||
|
||||
@@ -966,6 +966,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': "No s'ha trobat cap fitxer KML a {name}",
|
||||
'tours.import.archiveTooLargeIn': '{name} és massa gran un cop descomprimit',
|
||||
'tours.import.previewDuplicate': 'Ja és al viatge',
|
||||
'tours.import.previewAdopts': 'Ja és una traça al viatge, es converteix en excursió',
|
||||
'tours.import.previewAllDuplicates': 'Tots els tracks ja són al viatge, no hi ha res a importar.',
|
||||
'tours.import.previewAs': 'Importa com a',
|
||||
'tours.import.previewConfirm': 'Importa {count} rutes',
|
||||
|
||||
@@ -40,6 +40,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Otevřít asistenta',
|
||||
'assistant.connect.badKey': 'Tento klíč nefunguje.',
|
||||
'assistant.connect.unknownModel': 'Tento model tu není k dispozici.',
|
||||
'assistant.connect.noModelList':
|
||||
'Server odpověděl, ale neposlal seznam modelů. Zkontrolujte adresu, obvykle končí na /v1.',
|
||||
'assistant.connect.getKey': 'Získat klíč',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max a Team zahrnují kredity API.',
|
||||
'assistant.connect.hintOpenai': 'Vytvoř klíč na svém panelu OpenAI.',
|
||||
|
||||
@@ -304,7 +304,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Automatické rozvržení',
|
||||
'journey.studio.export': 'Exportovat',
|
||||
'journey.studio.day': 'DEN {day}',
|
||||
'journey.studio.stations': 'Zastávky',
|
||||
'journey.studio.stations': 'Cestou',
|
||||
'journey.studio.peersHere': 'zde',
|
||||
'journey.studio.folioAuto': 'Automaticky',
|
||||
'journey.studio.exportLayout': 'Rozvržení',
|
||||
|
||||
@@ -952,6 +952,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'V souboru {name} není žádný soubor KML',
|
||||
'tours.import.archiveTooLargeIn': 'Soubor {name} je po rozbalení příliš velký',
|
||||
'tours.import.previewDuplicate': 'Už je v cestě',
|
||||
'tours.import.previewAdopts': 'Už je v cestě jako trasa, stane se výletem',
|
||||
'tours.import.previewAllDuplicates': 'Všechny trasy už v cestě jsou, není co importovat.',
|
||||
'tours.import.previewAs': 'Importovat jako',
|
||||
'tours.import.previewConfirm': 'Importovat {count} túr',
|
||||
|
||||
@@ -42,6 +42,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Assistent öffnen',
|
||||
'assistant.connect.badKey': 'Dieser Schlüssel funktioniert nicht.',
|
||||
'assistant.connect.unknownModel': 'Dieses Modell wird hier nicht angeboten.',
|
||||
'assistant.connect.noModelList':
|
||||
'Der Server antwortet, schickt aber keine Modellliste. Prüfe die Adresse, meist endet sie auf /v1.',
|
||||
'assistant.connect.getKey': 'Schlüssel holen',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max und Team enthalten API-Guthaben.',
|
||||
'assistant.connect.hintOpenai': 'Leg einen Schlüssel in deinem OpenAI-Dashboard an.',
|
||||
|
||||
@@ -300,7 +300,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Automatisch anordnen',
|
||||
'journey.studio.export': 'Exportieren',
|
||||
'journey.studio.day': 'TAG {day}',
|
||||
'journey.studio.stations': 'Stationen',
|
||||
'journey.studio.stations': 'Unterwegs',
|
||||
'journey.studio.peersHere': 'hier',
|
||||
'journey.studio.folioAuto': 'Automatisch',
|
||||
'journey.studio.exportLayout': 'Layout', // same-as-en
|
||||
|
||||
@@ -975,6 +975,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'Keine KML-Datei in {name} gefunden',
|
||||
'tours.import.archiveTooLargeIn': '{name} ist entpackt zu groß',
|
||||
'tours.import.previewDuplicate': 'Schon in der Reise',
|
||||
'tours.import.previewAdopts': 'Schon als Track in der Reise, wird zur Tour',
|
||||
'tours.import.previewAllDuplicates': 'Alle Tracks sind schon in der Reise, es gibt nichts zu importieren.',
|
||||
'tours.import.previewAs': 'Importieren als',
|
||||
'tours.import.previewConfirm': '{count} Touren importieren',
|
||||
|
||||
@@ -40,6 +40,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Open assistant',
|
||||
'assistant.connect.badKey': 'This key doesn’t work.',
|
||||
'assistant.connect.unknownModel': 'This model isn’t offered here.',
|
||||
'assistant.connect.noModelList':
|
||||
'The server answered, but sent no list of models. Check the address, it usually ends in /v1.',
|
||||
'assistant.connect.getKey': 'Get a key',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max and Team include API credits.',
|
||||
'assistant.connect.hintOpenai': 'Create a key in your OpenAI dashboard.',
|
||||
|
||||
@@ -297,7 +297,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Auto layout',
|
||||
'journey.studio.export': 'Export',
|
||||
'journey.studio.day': 'DAY {day}',
|
||||
'journey.studio.stations': 'Stations',
|
||||
'journey.studio.stations': 'Along the way',
|
||||
'journey.studio.peersHere': 'here',
|
||||
'journey.studio.folioAuto': 'Automatic',
|
||||
'journey.studio.exportLayout': 'Layout',
|
||||
|
||||
@@ -946,6 +946,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'No KML file found in {name}',
|
||||
'tours.import.archiveTooLargeIn': '{name} is too large once unpacked',
|
||||
'tours.import.previewDuplicate': 'Already in the trip',
|
||||
'tours.import.previewAdopts': 'Already a track in the trip, becomes a tour',
|
||||
'tours.import.previewAllDuplicates': 'Every track is already in the trip, so there is nothing to import.',
|
||||
'tours.import.previewAs': 'Import as',
|
||||
'tours.import.previewConfirm': 'Import {count} tours',
|
||||
|
||||
@@ -40,6 +40,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Abrir asistente',
|
||||
'assistant.connect.badKey': 'Esta clave no funciona.',
|
||||
'assistant.connect.unknownModel': 'Este modelo no está disponible aquí.',
|
||||
'assistant.connect.noModelList':
|
||||
'El servidor respondió, pero no envió una lista de modelos. Revisa la dirección, suele terminar en /v1.',
|
||||
'assistant.connect.getKey': 'Obtener una clave',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max y Team incluyen créditos de API.',
|
||||
'assistant.connect.hintOpenai': 'Crea una clave en tu panel de OpenAI.',
|
||||
|
||||
@@ -299,7 +299,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Diseño automático',
|
||||
'journey.studio.export': 'Exportar',
|
||||
'journey.studio.day': 'DÍA {day}',
|
||||
'journey.studio.stations': 'Etapas',
|
||||
'journey.studio.stations': 'Por el camino',
|
||||
'journey.studio.peersHere': 'aquí',
|
||||
'journey.studio.folioAuto': 'Automático',
|
||||
'journey.studio.exportLayout': 'Diseño',
|
||||
|
||||
@@ -963,6 +963,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'No hay ningún archivo KML en {name}',
|
||||
'tours.import.archiveTooLargeIn': '{name} es demasiado grande una vez descomprimido',
|
||||
'tours.import.previewDuplicate': 'Ya está en el viaje',
|
||||
'tours.import.previewAdopts': 'Ya es un track en el viaje, pasa a ser una excursión',
|
||||
'tours.import.previewAllDuplicates': 'Todos los tracks ya están en el viaje, no hay nada que importar.',
|
||||
'tours.import.previewAs': 'Importar como',
|
||||
'tours.import.previewConfirm': 'Importar {count} rutas',
|
||||
|
||||
@@ -41,6 +41,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Ava assistent',
|
||||
'assistant.connect.badKey': 'See võti ei tööta.',
|
||||
'assistant.connect.unknownModel': 'Seda mudelit siin ei pakuta.',
|
||||
'assistant.connect.noModelList':
|
||||
'Server vastas, kuid ei saatnud mudelite loendit. Kontrolli aadressi, tavaliselt lõpeb see /v1-ga.',
|
||||
'assistant.connect.getKey': 'Hangi võti',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max ja Team sisaldavad API-krediiti.',
|
||||
'assistant.connect.hintOpenai': 'Loo võti oma OpenAI juhtpaneelil.',
|
||||
|
||||
@@ -299,7 +299,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Automaatne paigutus',
|
||||
'journey.studio.export': 'Eksport',
|
||||
'journey.studio.day': '{day}. PÄEV',
|
||||
'journey.studio.stations': 'Peatused',
|
||||
'journey.studio.stations': 'Teel',
|
||||
'journey.studio.peersHere': 'siin',
|
||||
'journey.studio.folioAuto': 'Automaatne',
|
||||
'journey.studio.exportLayout': 'Paigutus',
|
||||
|
||||
@@ -948,6 +948,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'Failis {name} pole KML-faili',
|
||||
'tours.import.archiveTooLargeIn': 'Fail {name} on lahtipakituna liiga suur',
|
||||
'tours.import.previewDuplicate': 'Juba reisil',
|
||||
'tours.import.previewAdopts': 'Juba reisil rajana, muutub retkeks',
|
||||
'tours.import.previewAllDuplicates': 'Kõik rajad on juba reisil, pole midagi importida.',
|
||||
'tours.import.previewAs': 'Impordi kui',
|
||||
'tours.import.previewConfirm': 'Impordi {count} matka',
|
||||
|
||||
@@ -41,6 +41,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Ouvrir l’assistant',
|
||||
'assistant.connect.badKey': 'Cette clé ne fonctionne pas.',
|
||||
'assistant.connect.unknownModel': 'Ce modèle n’est pas proposé ici.',
|
||||
'assistant.connect.noModelList':
|
||||
'Le serveur a répondu, mais sans liste de modèles. Vérifiez l’adresse, elle se termine généralement par /v1.',
|
||||
'assistant.connect.getKey': 'Obtenir une clé',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max et Team incluent des crédits API.',
|
||||
'assistant.connect.hintOpenai': 'Créez une clé dans votre tableau de bord OpenAI.',
|
||||
|
||||
@@ -299,7 +299,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Mise en page auto',
|
||||
'journey.studio.export': 'Exporter',
|
||||
'journey.studio.day': 'JOUR {day}',
|
||||
'journey.studio.stations': 'Étapes',
|
||||
'journey.studio.stations': 'En chemin',
|
||||
'journey.studio.peersHere': 'ici',
|
||||
'journey.studio.folioAuto': 'Automatique',
|
||||
'journey.studio.exportLayout': 'Mise en page',
|
||||
|
||||
@@ -981,6 +981,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'Aucun fichier KML trouvé dans {name}',
|
||||
'tours.import.archiveTooLargeIn': '{name} est trop volumineux une fois décompressé',
|
||||
'tours.import.previewDuplicate': 'Déjà dans le voyage',
|
||||
'tours.import.previewAdopts': 'Déjà une trace dans le voyage, devient une sortie',
|
||||
'tours.import.previewAllDuplicates': 'Toutes les traces sont déjà dans le voyage : il n’y a rien à importer.',
|
||||
'tours.import.previewAs': 'Importer comme',
|
||||
'tours.import.previewConfirm': 'Importer {count} sorties',
|
||||
|
||||
@@ -42,6 +42,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Άνοιγμα βοηθού',
|
||||
'assistant.connect.badKey': 'Αυτό το κλειδί δεν λειτουργεί.',
|
||||
'assistant.connect.unknownModel': 'Αυτό το μοντέλο δεν προσφέρεται εδώ.',
|
||||
'assistant.connect.noModelList':
|
||||
'Ο διακομιστής απάντησε, αλλά δεν έστειλε λίστα μοντέλων. Ελέγξτε τη διεύθυνση, συνήθως τελειώνει σε /v1.',
|
||||
'assistant.connect.getKey': 'Λήψη κλειδιού',
|
||||
'assistant.connect.hintAnthropic': 'Τα Claude Max και Team περιλαμβάνουν μονάδες API.',
|
||||
'assistant.connect.hintOpenai': 'Δημιουργήστε ένα κλειδί στον πίνακα ελέγχου του OpenAI.',
|
||||
|
||||
@@ -302,7 +302,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Αυτόματη διάταξη',
|
||||
'journey.studio.export': 'Εξαγωγή',
|
||||
'journey.studio.day': 'ΗΜΕΡΑ {day}',
|
||||
'journey.studio.stations': 'Στάσεις',
|
||||
'journey.studio.stations': 'Στη διαδρομή',
|
||||
'journey.studio.peersHere': 'εδώ',
|
||||
'journey.studio.folioAuto': 'Αυτόματα',
|
||||
'journey.studio.exportLayout': 'Διάταξη',
|
||||
|
||||
@@ -986,6 +986,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'Δεν βρέθηκε αρχείο KML στο {name}',
|
||||
'tours.import.archiveTooLargeIn': 'Το {name} είναι πολύ μεγάλο μετά την αποσυμπίεση',
|
||||
'tours.import.previewDuplicate': 'Υπάρχει ήδη στο ταξίδι',
|
||||
'tours.import.previewAdopts': 'Υπάρχει ήδη ως διαδρομή στο ταξίδι, γίνεται εκδρομή',
|
||||
'tours.import.previewAllDuplicates': 'Όλα τα ίχνη υπάρχουν ήδη στο ταξίδι, δεν υπάρχει τίποτα για εισαγωγή.',
|
||||
'tours.import.previewAs': 'Εισαγωγή ως',
|
||||
'tours.import.previewConfirm': 'Εισαγωγή {count} διαδρομών',
|
||||
|
||||
@@ -41,6 +41,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Asszisztens megnyitása',
|
||||
'assistant.connect.badKey': 'Ez a kulcs nem működik.',
|
||||
'assistant.connect.unknownModel': 'Ez a modell itt nem érhető el.',
|
||||
'assistant.connect.noModelList':
|
||||
'A szerver válaszolt, de nem küldött modellistát. Ellenőrizd a címet, általában /v1-re végződik.',
|
||||
'assistant.connect.getKey': 'Kulcs igénylése',
|
||||
'assistant.connect.hintAnthropic': 'A Claude Max és Team csomag API-kreditet is tartalmaz.',
|
||||
'assistant.connect.hintOpenai': 'Hozz létre egy kulcsot az OpenAI irányítópultján.',
|
||||
|
||||
@@ -298,7 +298,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Automatikus elrendezés',
|
||||
'journey.studio.export': 'Exportálás',
|
||||
'journey.studio.day': '{day}. NAP',
|
||||
'journey.studio.stations': 'Állomások',
|
||||
'journey.studio.stations': 'Útközben',
|
||||
'journey.studio.peersHere': 'itt',
|
||||
'journey.studio.folioAuto': 'Automatikus',
|
||||
'journey.studio.exportLayout': 'Elrendezés',
|
||||
|
||||
@@ -963,6 +963,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'A(z) {name} nem tartalmaz KML-fájlt',
|
||||
'tours.import.archiveTooLargeIn': 'A(z) {name} kicsomagolva túl nagy',
|
||||
'tours.import.previewDuplicate': 'Már az utazásban van',
|
||||
'tours.import.previewAdopts': 'Már nyomvonalként szerepel az utazásban, túra lesz belőle',
|
||||
'tours.import.previewAllDuplicates': 'Minden nyomvonal már az utazásban van, nincs mit importálni.',
|
||||
'tours.import.previewAs': 'Importálás mint',
|
||||
'tours.import.previewConfirm': '{count} túra importálása',
|
||||
|
||||
@@ -41,6 +41,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Buka asisten',
|
||||
'assistant.connect.badKey': 'Kunci ini tidak berfungsi.',
|
||||
'assistant.connect.unknownModel': 'Model ini tidak tersedia di sini.',
|
||||
'assistant.connect.noModelList':
|
||||
'Server menjawab, tetapi tidak mengirim daftar model. Periksa alamatnya, biasanya diakhiri dengan /v1.',
|
||||
'assistant.connect.getKey': 'Dapatkan kunci',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max dan Team sudah termasuk kredit API.',
|
||||
'assistant.connect.hintOpenai': 'Buat kunci di dasbor OpenAI kamu.',
|
||||
|
||||
@@ -291,7 +291,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Tata letak otomatis',
|
||||
'journey.studio.export': 'Ekspor',
|
||||
'journey.studio.day': 'HARI {day}',
|
||||
'journey.studio.stations': 'Persinggahan',
|
||||
'journey.studio.stations': 'Sepanjang jalan',
|
||||
'journey.studio.peersHere': 'di sini',
|
||||
'journey.studio.folioAuto': 'Otomatis',
|
||||
'journey.studio.exportLayout': 'Tata letak',
|
||||
|
||||
@@ -954,6 +954,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'Tidak ada berkas KML di {name}',
|
||||
'tours.import.archiveTooLargeIn': '{name} terlalu besar setelah diekstrak',
|
||||
'tours.import.previewDuplicate': 'Sudah ada di perjalanan',
|
||||
'tours.import.previewAdopts': 'Sudah ada sebagai jalur di perjalanan, menjadi tur',
|
||||
'tours.import.previewAllDuplicates': 'Semua jejak sudah ada di perjalanan, tidak ada yang perlu diimpor.',
|
||||
'tours.import.previewAs': 'Impor sebagai',
|
||||
'tours.import.previewConfirm': 'Impor {count} tur',
|
||||
|
||||
@@ -41,6 +41,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Apri l’assistente',
|
||||
'assistant.connect.badKey': 'Questa chiave non funziona.',
|
||||
'assistant.connect.unknownModel': 'Questo modello non è disponibile qui.',
|
||||
'assistant.connect.noModelList':
|
||||
'Il server ha risposto, ma non ha inviato un elenco di modelli. Controlla l’indirizzo, di solito termina con /v1.',
|
||||
'assistant.connect.getKey': 'Ottieni una chiave',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max e Team includono crediti API.',
|
||||
'assistant.connect.hintOpenai': 'Crea una chiave nella dashboard di OpenAI.',
|
||||
|
||||
@@ -298,7 +298,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Layout automatico',
|
||||
'journey.studio.export': 'Esporta',
|
||||
'journey.studio.day': 'GIORNO {day}',
|
||||
'journey.studio.stations': 'Tappe',
|
||||
'journey.studio.stations': 'Lungo la strada',
|
||||
'journey.studio.peersHere': 'qui',
|
||||
'journey.studio.folioAuto': 'Automatico',
|
||||
'journey.studio.exportLayout': 'Impaginazione',
|
||||
|
||||
@@ -970,6 +970,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'Nessun file KML trovato in {name}',
|
||||
'tours.import.archiveTooLargeIn': '{name} è troppo grande una volta decompresso',
|
||||
'tours.import.previewDuplicate': 'Già nel viaggio',
|
||||
'tours.import.previewAdopts': 'Già una traccia nel viaggio, diventa un’escursione',
|
||||
'tours.import.previewAllDuplicates': 'Tutte le tracce sono già nel viaggio, non c’è nulla da importare.',
|
||||
'tours.import.previewAs': 'Importa come',
|
||||
'tours.import.previewConfirm': 'Importa {count} tour',
|
||||
|
||||
@@ -41,6 +41,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'アシスタントを開く',
|
||||
'assistant.connect.badKey': 'このキーは使えません。',
|
||||
'assistant.connect.unknownModel': 'このモデルはここでは提供されていません。',
|
||||
'assistant.connect.noModelList':
|
||||
'サーバーは応答しましたが、モデル一覧が返りませんでした。アドレスを確認してください。通常は /v1 で終わります。',
|
||||
'assistant.connect.getKey': 'キーを取得',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max と Team には API クレジットが含まれています。',
|
||||
'assistant.connect.hintOpenai': 'OpenAI のダッシュボードでキーを作成してください。',
|
||||
|
||||
@@ -290,7 +290,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': '自動レイアウト',
|
||||
'journey.studio.export': 'エクスポート',
|
||||
'journey.studio.day': '{day}日目',
|
||||
'journey.studio.stations': '立ち寄り先',
|
||||
'journey.studio.stations': '道中で',
|
||||
'journey.studio.peersHere': '閲覧中',
|
||||
'journey.studio.folioAuto': '自動',
|
||||
'journey.studio.exportLayout': 'レイアウト',
|
||||
|
||||
@@ -930,6 +930,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': '{name}にKMLファイルが見つかりません',
|
||||
'tours.import.archiveTooLargeIn': '{name}は展開すると大きすぎます',
|
||||
'tours.import.previewDuplicate': 'すでに旅行にあります',
|
||||
'tours.import.previewAdopts': '旅行にトラックとしてあります。ツアーになります',
|
||||
'tours.import.previewAllDuplicates': 'すべてのトラックがすでに旅行にあるため、取り込むものはありません。',
|
||||
'tours.import.previewAs': '取り込む種類',
|
||||
'tours.import.previewConfirm': '{count} 件のツアーを取り込む',
|
||||
|
||||
@@ -41,6 +41,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': '어시스턴트 열기',
|
||||
'assistant.connect.badKey': '이 키는 작동하지 않습니다.',
|
||||
'assistant.connect.unknownModel': '이 모델은 여기에서 제공되지 않습니다.',
|
||||
'assistant.connect.noModelList':
|
||||
'서버가 응답했지만 모델 목록을 보내지 않았습니다. 주소를 확인하세요. 보통 /v1로 끝납니다.',
|
||||
'assistant.connect.getKey': '키 받기',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max와 Team에는 API 크레딧이 포함되어 있습니다.',
|
||||
'assistant.connect.hintOpenai': 'OpenAI 대시보드에서 키를 만드세요.',
|
||||
|
||||
@@ -287,7 +287,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': '자동 레이아웃',
|
||||
'journey.studio.export': '내보내기',
|
||||
'journey.studio.day': '{day}일차',
|
||||
'journey.studio.stations': '경유지',
|
||||
'journey.studio.stations': '가는 길에',
|
||||
'journey.studio.peersHere': '접속 중',
|
||||
'journey.studio.folioAuto': '자동',
|
||||
'journey.studio.exportLayout': '레이아웃',
|
||||
|
||||
@@ -922,6 +922,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': '{name}에 KML 파일이 없습니다',
|
||||
'tours.import.archiveTooLargeIn': '{name}은(는) 압축을 풀면 너무 큽니다',
|
||||
'tours.import.previewDuplicate': '이미 여행에 있음',
|
||||
'tours.import.previewAdopts': '이미 여행에 트랙으로 있음, 투어가 됩니다',
|
||||
'tours.import.previewAllDuplicates': '모든 트랙이 이미 여행에 있어 가져올 것이 없습니다.',
|
||||
'tours.import.previewAs': '가져올 유형',
|
||||
'tours.import.previewConfirm': '투어 {count}개 가져오기',
|
||||
|
||||
@@ -41,6 +41,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Assistent openen',
|
||||
'assistant.connect.badKey': 'Deze sleutel werkt niet.',
|
||||
'assistant.connect.unknownModel': 'Dit model wordt hier niet aangeboden.',
|
||||
'assistant.connect.noModelList':
|
||||
'De server antwoordde, maar stuurde geen lijst met modellen. Controleer het adres, dat eindigt meestal op /v1.',
|
||||
'assistant.connect.getKey': 'Sleutel aanvragen',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max en Team bevatten API-tegoed.',
|
||||
'assistant.connect.hintOpenai': 'Maak een sleutel aan in je OpenAI-dashboard.',
|
||||
|
||||
@@ -300,7 +300,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Automatische opmaak',
|
||||
'journey.studio.export': 'Exporteren',
|
||||
'journey.studio.day': 'DAG {day}',
|
||||
'journey.studio.stations': 'Etappes',
|
||||
'journey.studio.stations': 'Onderweg',
|
||||
'journey.studio.peersHere': 'hier',
|
||||
'journey.studio.folioAuto': 'Automatisch',
|
||||
'journey.studio.exportLayout': 'Opmaak',
|
||||
|
||||
@@ -967,6 +967,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'Geen KML-bestand gevonden in {name}',
|
||||
'tours.import.archiveTooLargeIn': '{name} is uitgepakt te groot',
|
||||
'tours.import.previewDuplicate': 'Al in de reis',
|
||||
'tours.import.previewAdopts': 'Al een track in de reis, wordt een tocht',
|
||||
'tours.import.previewAllDuplicates': 'Alle tracks staan al in de reis, er is niets te importeren.',
|
||||
'tours.import.previewAs': 'Importeren als',
|
||||
'tours.import.previewConfirm': '{count} tochten importeren',
|
||||
|
||||
@@ -41,6 +41,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Otwórz asystenta',
|
||||
'assistant.connect.badKey': 'Ten klucz nie działa.',
|
||||
'assistant.connect.unknownModel': 'Ten model nie jest tu dostępny.',
|
||||
'assistant.connect.noModelList':
|
||||
'Serwer odpowiedział, ale nie przesłał listy modeli. Sprawdź adres, zwykle kończy się na /v1.',
|
||||
'assistant.connect.getKey': 'Uzyskaj klucz',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max i Team zawierają środki na API.',
|
||||
'assistant.connect.hintOpenai': 'Utwórz klucz w panelu OpenAI.',
|
||||
|
||||
@@ -312,7 +312,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Układ automatyczny',
|
||||
'journey.studio.export': 'Eksportuj',
|
||||
'journey.studio.day': 'DZIEŃ {day}',
|
||||
'journey.studio.stations': 'Etapy',
|
||||
'journey.studio.stations': 'Po drodze',
|
||||
'journey.studio.peersHere': 'tutaj',
|
||||
'journey.studio.folioAuto': 'Automatycznie',
|
||||
'journey.studio.exportLayout': 'Układ',
|
||||
|
||||
@@ -986,6 +986,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'W pliku {name} nie ma pliku KML',
|
||||
'tours.import.archiveTooLargeIn': 'Plik {name} po rozpakowaniu jest za duży',
|
||||
'tours.import.previewDuplicate': 'Już jest w podróży',
|
||||
'tours.import.previewAdopts': 'Już jest śladem w podróży, stanie się wycieczką',
|
||||
'tours.import.previewAllDuplicates': 'Wszystkie ślady są już w podróży, nie ma czego importować.',
|
||||
'tours.import.previewAs': 'Importuj jako',
|
||||
'tours.import.previewConfirm': 'Importuj {count} wycieczki',
|
||||
|
||||
@@ -41,6 +41,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Открыть ассистента',
|
||||
'assistant.connect.badKey': 'Этот ключ не работает.',
|
||||
'assistant.connect.unknownModel': 'Эта модель здесь недоступна.',
|
||||
'assistant.connect.noModelList':
|
||||
'Сервер ответил, но не прислал список моделей. Проверьте адрес, обычно он заканчивается на /v1.',
|
||||
'assistant.connect.getKey': 'Получить ключ',
|
||||
'assistant.connect.hintAnthropic': 'В Claude Max и Team входят кредиты API.',
|
||||
'assistant.connect.hintOpenai': 'Создайте ключ в панели управления OpenAI.',
|
||||
|
||||
@@ -312,7 +312,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Автомакет',
|
||||
'journey.studio.export': 'Экспорт',
|
||||
'journey.studio.day': 'ДЕНЬ {day}',
|
||||
'journey.studio.stations': 'Остановки',
|
||||
'journey.studio.stations': 'По пути',
|
||||
'journey.studio.peersHere': 'здесь',
|
||||
'journey.studio.folioAuto': 'Автоматически',
|
||||
'journey.studio.exportLayout': 'Макет',
|
||||
|
||||
@@ -989,6 +989,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'В {name} не найден файл KML',
|
||||
'tours.import.archiveTooLargeIn': '{name} слишком велик после распаковки',
|
||||
'tours.import.previewDuplicate': 'Уже в поездке',
|
||||
'tours.import.previewAdopts': 'Уже есть в поездке как трек, станет туром',
|
||||
'tours.import.previewAllDuplicates': 'Все треки уже в поездке, импортировать нечего.',
|
||||
'tours.import.previewAs': 'Импортировать как',
|
||||
'tours.import.previewConfirm': 'Импортировать {count} тура',
|
||||
|
||||
@@ -40,6 +40,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Otvoriť asistenta',
|
||||
'assistant.connect.badKey': 'Tento kľúč nefunguje.',
|
||||
'assistant.connect.unknownModel': 'Tento model tu nie je k dispozícii.',
|
||||
'assistant.connect.noModelList':
|
||||
'Server odpovedal, ale neposlal zoznam modelov. Skontrolujte adresu, zvyčajne končí na /v1.',
|
||||
'assistant.connect.getKey': 'Získať kľúč',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max a Team obsahujú kredity pre API.',
|
||||
'assistant.connect.hintOpenai': 'Vytvor kľúč vo svojom prehľade OpenAI.',
|
||||
|
||||
@@ -304,7 +304,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Automatické rozloženie',
|
||||
'journey.studio.export': 'Exportovať',
|
||||
'journey.studio.day': 'DEŇ {day}',
|
||||
'journey.studio.stations': 'Zastávky',
|
||||
'journey.studio.stations': 'Cestou',
|
||||
'journey.studio.peersHere': 'tu',
|
||||
'journey.studio.folioAuto': 'Automaticky',
|
||||
'journey.studio.exportLayout': 'Rozloženie',
|
||||
|
||||
@@ -954,6 +954,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'V súbore {name} nie je žiadny súbor KML',
|
||||
'tours.import.archiveTooLargeIn': 'Súbor {name} je po rozbalení príliš veľký',
|
||||
'tours.import.previewDuplicate': 'Už je v ceste',
|
||||
'tours.import.previewAdopts': 'Už je v ceste ako trasa, stane sa túrou',
|
||||
'tours.import.previewAllDuplicates': 'Všetky trasy už v ceste sú, nie je čo importovať.',
|
||||
'tours.import.previewAs': 'Importovať ako',
|
||||
'tours.import.previewConfirm': 'Importovať {count} túr',
|
||||
|
||||
@@ -42,6 +42,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Öppna assistenten',
|
||||
'assistant.connect.badKey': 'Den här nyckeln fungerar inte.',
|
||||
'assistant.connect.unknownModel': 'Den här modellen erbjuds inte här.',
|
||||
'assistant.connect.noModelList':
|
||||
'Servern svarade men skickade ingen lista med modeller. Kontrollera adressen, den slutar oftast på /v1.',
|
||||
'assistant.connect.getKey': 'Skaffa en nyckel',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max och Team inkluderar API-krediter.',
|
||||
'assistant.connect.hintOpenai': 'Skapa en nyckel i din OpenAI-översikt.',
|
||||
|
||||
@@ -298,7 +298,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Automatisk layout',
|
||||
'journey.studio.export': 'Exportera',
|
||||
'journey.studio.day': 'DAG {day}',
|
||||
'journey.studio.stations': 'Etapper',
|
||||
'journey.studio.stations': 'Längs vägen',
|
||||
'journey.studio.peersHere': 'här',
|
||||
'journey.studio.folioAuto': 'Automatiskt',
|
||||
'journey.studio.exportLayout': 'Layout', // same-as-en
|
||||
|
||||
@@ -945,6 +945,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'Ingen KML-fil hittades i {name}',
|
||||
'tours.import.archiveTooLargeIn': '{name} är för stor när den packats upp',
|
||||
'tours.import.previewDuplicate': 'Finns redan i resan',
|
||||
'tours.import.previewAdopts': 'Finns redan som spår i resan, blir en tur',
|
||||
'tours.import.previewAllDuplicates': 'Alla spår finns redan i resan, det finns inget att importera.',
|
||||
'tours.import.previewAs': 'Importera som',
|
||||
'tours.import.previewConfirm': 'Importera {count} turer',
|
||||
|
||||
@@ -40,6 +40,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'เปิดผู้ช่วย',
|
||||
'assistant.connect.badKey': 'คีย์นี้ใช้งานไม่ได้',
|
||||
'assistant.connect.unknownModel': 'ไม่มีโมเดลนี้ให้ใช้ที่นี่',
|
||||
'assistant.connect.noModelList':
|
||||
'เซิร์ฟเวอร์ตอบกลับแล้ว แต่ไม่ได้ส่งรายการโมเดลมา ตรวจสอบที่อยู่ ซึ่งมักลงท้ายด้วย /v1',
|
||||
'assistant.connect.getKey': 'รับคีย์',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max และ Team มีเครดิต API รวมอยู่ด้วย',
|
||||
'assistant.connect.hintOpenai': 'สร้างคีย์ในแดชบอร์ด OpenAI ของคุณ',
|
||||
|
||||
@@ -287,7 +287,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'เค้าโครงอัตโนมัติ',
|
||||
'journey.studio.export': 'ส่งออก',
|
||||
'journey.studio.day': 'วันที่ {day}',
|
||||
'journey.studio.stations': 'สถานี',
|
||||
'journey.studio.stations': 'ระหว่างทาง',
|
||||
'journey.studio.peersHere': 'ที่นี่',
|
||||
'journey.studio.folioAuto': 'อัตโนมัติ',
|
||||
'journey.studio.exportLayout': 'เค้าโครง',
|
||||
|
||||
@@ -907,6 +907,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'ไม่พบไฟล์ KML ใน {name}',
|
||||
'tours.import.archiveTooLargeIn': '{name} ใหญ่เกินไปเมื่อแตกไฟล์',
|
||||
'tours.import.previewDuplicate': 'มีอยู่ในทริปแล้ว',
|
||||
'tours.import.previewAdopts': 'มีอยู่ในทริปเป็นเส้นทางแล้ว จะกลายเป็นทัวร์',
|
||||
'tours.import.previewAllDuplicates': 'ทุกแทร็กมีอยู่ในทริปแล้ว จึงไม่มีอะไรให้นำเข้า',
|
||||
'tours.import.previewAs': 'นำเข้าเป็น',
|
||||
'tours.import.previewConfirm': 'นำเข้า {count} ทริป',
|
||||
|
||||
@@ -20,7 +20,7 @@ const toursModules = import.meta.glob<{ default: TranslationStrings }>('./*/tour
|
||||
const TOUR_DOMAINS: { file: string; generalKeyCount: number; modules: DomainModules }[] = [
|
||||
{
|
||||
file: 'tours',
|
||||
generalKeyCount: 1349,
|
||||
generalKeyCount: 1350,
|
||||
modules: toursModules,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -40,6 +40,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Asistanı aç',
|
||||
'assistant.connect.badKey': 'Bu anahtar çalışmıyor.',
|
||||
'assistant.connect.unknownModel': 'Bu model burada sunulmuyor.',
|
||||
'assistant.connect.noModelList':
|
||||
'Sunucu yanıt verdi ama model listesi göndermedi. Adresi kontrol edin, genellikle /v1 ile biter.',
|
||||
'assistant.connect.getKey': 'Anahtar al',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max ve Team, API kredisi içerir.',
|
||||
'assistant.connect.hintOpenai': 'OpenAI panelinde bir anahtar oluştur.',
|
||||
|
||||
@@ -297,7 +297,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Otomatik yerleşim',
|
||||
'journey.studio.export': 'Dışa aktar',
|
||||
'journey.studio.day': '{day}. GÜN',
|
||||
'journey.studio.stations': 'Duraklar',
|
||||
'journey.studio.stations': 'Yol boyunca',
|
||||
'journey.studio.peersHere': 'burada',
|
||||
'journey.studio.folioAuto': 'Otomatik',
|
||||
'journey.studio.exportLayout': 'Yerleşim',
|
||||
|
||||
@@ -956,6 +956,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': '{name} içinde KML dosyası bulunamadı',
|
||||
'tours.import.archiveTooLargeIn': '{name} açıldığında çok büyük',
|
||||
'tours.import.previewDuplicate': 'Zaten seyahatte',
|
||||
'tours.import.previewAdopts': 'Seyahatte iz olarak zaten var, tura dönüşecek',
|
||||
'tours.import.previewAllDuplicates': 'Tüm izler zaten seyahatte, içe aktarılacak bir şey yok.',
|
||||
'tours.import.previewAs': 'Şu olarak içe aktar',
|
||||
'tours.import.previewConfirm': '{count} turu içe aktar',
|
||||
|
||||
@@ -41,6 +41,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Відкрити асистента',
|
||||
'assistant.connect.badKey': 'Цей ключ не працює.',
|
||||
'assistant.connect.unknownModel': 'Ця модель тут недоступна.',
|
||||
'assistant.connect.noModelList':
|
||||
'Сервер відповів, але не надіслав список моделей. Перевірте адресу, зазвичай вона закінчується на /v1.',
|
||||
'assistant.connect.getKey': 'Отримати ключ',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max і Team містять кредити API.',
|
||||
'assistant.connect.hintOpenai': 'Створіть ключ у панелі керування OpenAI.',
|
||||
|
||||
@@ -313,7 +313,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Автомакет',
|
||||
'journey.studio.export': 'Експорт',
|
||||
'journey.studio.day': 'ДЕНЬ {day}',
|
||||
'journey.studio.stations': 'Зупинки',
|
||||
'journey.studio.stations': 'Дорогою',
|
||||
'journey.studio.peersHere': 'тут',
|
||||
'journey.studio.folioAuto': 'Автоматично',
|
||||
'journey.studio.exportLayout': 'Макет',
|
||||
|
||||
@@ -980,6 +980,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'У {name} не знайдено файлу KML',
|
||||
'tours.import.archiveTooLargeIn': '{name} завеликий після розпакування',
|
||||
'tours.import.previewDuplicate': 'Уже в подорожі',
|
||||
'tours.import.previewAdopts': 'Уже є в подорожі як трек, стане туром',
|
||||
'tours.import.previewAllDuplicates': 'Усі треки вже в подорожі, імпортувати нічого.',
|
||||
'tours.import.previewAs': 'Імпортувати як',
|
||||
'tours.import.previewConfirm': 'Імпортувати {count} туру',
|
||||
|
||||
@@ -41,6 +41,8 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': 'Mở trợ lý',
|
||||
'assistant.connect.badKey': 'Khóa này không hoạt động.',
|
||||
'assistant.connect.unknownModel': 'Mô hình này không có ở đây.',
|
||||
'assistant.connect.noModelList':
|
||||
'Máy chủ đã phản hồi nhưng không gửi danh sách mô hình. Hãy kiểm tra địa chỉ, thường kết thúc bằng /v1.',
|
||||
'assistant.connect.getKey': 'Lấy khóa',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max và Team có kèm tín dụng API.',
|
||||
'assistant.connect.hintOpenai': 'Tạo khóa trong bảng điều khiển OpenAI của bạn.',
|
||||
|
||||
@@ -292,7 +292,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': 'Bố cục tự động',
|
||||
'journey.studio.export': 'Xuất',
|
||||
'journey.studio.day': 'NGÀY {day}',
|
||||
'journey.studio.stations': 'Chặng dừng',
|
||||
'journey.studio.stations': 'Dọc đường',
|
||||
'journey.studio.peersHere': 'ở đây',
|
||||
'journey.studio.folioAuto': 'Tự động',
|
||||
'journey.studio.exportLayout': 'Bố cục',
|
||||
|
||||
@@ -941,6 +941,7 @@ const tours: TranslationStrings = {
|
||||
'tours.import.archiveNoKmlIn': 'Không tìm thấy tệp KML trong {name}',
|
||||
'tours.import.archiveTooLargeIn': '{name} quá lớn sau khi giải nén',
|
||||
'tours.import.previewDuplicate': 'Đã có trong chuyến đi',
|
||||
'tours.import.previewAdopts': 'Đã có trong chuyến đi dưới dạng tuyến, sẽ thành chuyến tham quan',
|
||||
'tours.import.previewAllDuplicates': 'Mọi vết đã có trong chuyến đi, không có gì để nhập.',
|
||||
'tours.import.previewAs': 'Nhập dưới dạng',
|
||||
'tours.import.previewConfirm': 'Nhập {count} chuyến',
|
||||
|
||||
@@ -39,6 +39,7 @@ const assistant: TranslationStrings = {
|
||||
'assistant.connect.openAssistant': '開啟助理',
|
||||
'assistant.connect.badKey': '這組金鑰無效。',
|
||||
'assistant.connect.unknownModel': '這裡不提供此模型。',
|
||||
'assistant.connect.noModelList': '伺服器已回應,但沒有傳回模型清單。請檢查位址,通常以 /v1 結尾。',
|
||||
'assistant.connect.getKey': '取得金鑰',
|
||||
'assistant.connect.hintAnthropic': 'Claude Max 和 Team 包含 API 額度。',
|
||||
'assistant.connect.hintOpenai': '在你的 OpenAI 主控台建立金鑰。',
|
||||
|
||||
@@ -285,7 +285,7 @@ const journey: TranslationStrings = {
|
||||
'journey.studio.autoLayout': '自動排版',
|
||||
'journey.studio.export': '匯出',
|
||||
'journey.studio.day': '第{day}天',
|
||||
'journey.studio.stations': '途經地',
|
||||
'journey.studio.stations': '沿途',
|
||||
'journey.studio.peersHere': '在線',
|
||||
'journey.studio.folioAuto': '自動',
|
||||
'journey.studio.exportLayout': '版面',
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user