Skip to content

core/quests/sources/personal.ts ​

Generated from the exports of core/quests/sources/personal.ts · npm run docs:gen

Personal quests generated from the owner's tasks (PLAN-V2 P7, P8; lot Q2). Two sources: - tasks typed in the game (Save.tasks): one quest each, made by a declaration (a manual step); - a Markdown file of checkboxes under ~/ that the owner chose, read by the server and never written by the game: one quest each, proven by the source itself (check task: the box is ticked in the file). 5 xp a task, at most 25 a day (the core's record() caps it); no streak. A task that leaves its source takes its quest with it (the xp already won stays: see evaluate()). A task already ticked in the file the first time the game sees it gives nothing: its quest is only made once the game saw the task open (Save.seen["task:<id>"], written by the client) or once it was rewarded.

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

Exports ​

PERSONAL_BRANCH const ​

ts
const PERSONAL_BRANCH = "_personal"

FileTask interface ​

A task of the file, as GET /api/tasks and /api/game (sources.tasks) give it.

ts
interface FileTask { id: string; title: string; done: boolean }

TaskSource interface ​

ts
interface TaskSource { source: string | null; tasks: FileTask[] }

TASK_ID const ​

ts
const TASK_ID = /^[a-z0-9][a-z0-9-]{0,39}$/

personalUid const ​

ts
const personalUid = (taskId: string) => …

seenKey const ​

ts
const seenKey = (taskId: string) => …

DONE_STEP const ​

The step a typed task is declared done with (its tick key: "_personal.<id>/done").

ts
const DONE_STEP = "done"

personalBranch function ​

The personal branch: the tasks typed in the game, then the open (or seen open) tasks of the owner's file.

ts
function personalBranch(file: TaskSource | null | undefined, save: Save, say: Say): Branch | null

Alta OS is open source (MIT).