# `core/quests/sources/common.ts`

<p class="generated-note">Generated from the exports of <a href="https://github.com/altasystem-ai/alta/blob/main/core/quests/sources/common.ts"><code>core/quests/sources/common.ts</code></a> · <code>npm run docs:gen</code></p>

Shared by the quest sources (lot Q2): texts given by the caller, slugs that the save accepts, the window an incident stays visible after it was solved. Pure: no DOM, no clock of its own, no file.

**Standards that cite this file**: No standard page cites this file yet.

## Exports

### `Say` 
Texts of a source, by key, in every language (the client reads them from content/copy/&lt;lang&gt;/generated.json).

```ts
type Say = (key: string, vars?: Record<string, string>) => Text;
```

### `sayFrom` 
A `Say` over copy tables: `{name}` is filled with vars; a key missing in a language falls back to English.

```ts
function sayFrom(copy: Partial<Record<"en" | "fr", Record<string, string>>>): Say
```

### `sayOwn` 
The text of `key.variant` when the copy has it, the text of `key` otherwise.

```ts
function sayOwn(say: Say, key: string, variant: string, vars?: Record<string, string>)
```

### `same` 
The same text in every language (a name read on the machine is never translated).

```ts
const same = (s: string): Text => …
```

### `slug` 
A part of a uid: lower case, digits and dashes, at most 60 characters (the bounds of server/save.mjs).

```ts
function slug(id: string): string
```

### `recentlySolved` 
An incident solved less than 24 h ago stays visible (done); a relapse in that time is the same incident.

```ts
function recentlySolved(save: Save, id: string, now: number): boolean
```

### `stillOpen` 
An incident still open in the save.

```ts
const stillOpen = (save: Save, id: string): boolean => …
```

### `generatedBranch` 
A generated branch: reserved id, one act, no skills; null when it has no quest.

```ts
function generatedBranch(id: string, title: Text, act: Text, quests: Branch["quests"]): Branch | null
```
