diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..eb47eda --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,9 @@ +{ + "permissions": { + "allow": [ + "Bash(npm rebuild:*)", + "Bash(npx tsc:*)", + "Bash(npm test:*)" + ] + } +} diff --git a/src/api/data/labNotesStore.ts b/src/api/data/labNotesStore.ts index 60e8b5d..36068b5 100644 --- a/src/api/data/labNotesStore.ts +++ b/src/api/data/labNotesStore.ts @@ -13,7 +13,7 @@ export type ApiLabNote = { published: string; // "" or YYYY-MM-DD status: "draft" | "published" | "archived"; - type: "labnote" | "paper" | "memo"; + type: "labnote" | "paper" | "memo" | "lore" | "weather" | "tail"; locale: string; department_id: string; diff --git a/src/mappers/labNotesMapper.ts b/src/mappers/labNotesMapper.ts index 6774f3a..723a527 100644 --- a/src/mappers/labNotesMapper.ts +++ b/src/mappers/labNotesMapper.ts @@ -1,6 +1,7 @@ // src/mappers/labNotesMapper.ts import { marked } from "marked"; -import type { LabNoteRecord } from "../types/labNotes.js"; +import type { LabNoteRecord, LabNoteStatus, LabNoteType } from "../types/labNotes.js"; +import { ALLOWED_NOTE_TYPES } from "../types/labNotes.js"; /* =========================================================== 🧭 Lab Notes Mapper — Ledger-First Output @@ -16,17 +17,6 @@ import type { LabNoteRecord } from "../types/labNotes.js"; - Auth decisions =========================================================== */ -type LabNoteStatus = "published" | "draft" | "archived"; -type LabNoteType = "labnote" | "paper" | "memo" | "lore" | "weather"; - -const ALLOWED_NOTE_TYPES: ReadonlySet = new Set([ - "labnote", - "paper", - "memo", - "lore", - "weather", -]); - marked.setOptions({ gfm: true, breaks: false, // ✅ strict @@ -65,6 +55,7 @@ function deriveType(note: LabNoteRecord): LabNoteType { if (note.category === "memo") return "memo"; if (note.category === "lore") return "lore"; if (note.category === "weather") return "weather"; + if (note.category === "tail") return "tail"; return "labnote"; } @@ -188,3 +179,4 @@ export function mapToLabNotePreview(note: LabNoteRecord, tags: string[]) { card_style: note.card_style ?? undefined, }; } + diff --git a/src/types/UpsertBody.ts b/src/types/UpsertBody.ts index e143f3d..8eb5568 100644 --- a/src/types/UpsertBody.ts +++ b/src/types/UpsertBody.ts @@ -10,7 +10,7 @@ export type UpsertBody = { summary?: string; // longer abstract (UI-facing) // taxonomy - type?: "labnote" | "paper" | "memo" | "lore"; + type?: "labnote" | "paper" | "memo" | "lore" | "weather" | "tail"; status?: "draft" | "published"; category?: string; // legacy / optional dept?: string; // human-facing dept label diff --git a/src/types/labNotes.ts b/src/types/labNotes.ts index b96c8b7..77841c5 100644 --- a/src/types/labNotes.ts +++ b/src/types/labNotes.ts @@ -1,6 +1,6 @@ // src/types/labNotes.ts -export type LabNoteType = "labnote" | "paper" | "memo" | "lore" | "weather"; +export type LabNoteType = "labnote" | "paper" | "memo" | "lore" | "weather" | "tail"; export type LabNoteStatus = "published" | "draft" | "archived"; export const ALLOWED_NOTE_TYPES: ReadonlySet = new Set([ @@ -9,6 +9,7 @@ export const ALLOWED_NOTE_TYPES: ReadonlySet = new Set([ "memo", "lore", "weather", + "tail", ]); export interface LabNoteRecord {