diff --git a/apps/home-a/App.tsx b/apps/home-a/App.tsx new file mode 100644 index 0000000..9456740 --- /dev/null +++ b/apps/home-a/App.tsx @@ -0,0 +1,56 @@ +/** + * Candidate A app shell — sign in as a known member (or not), then live in + * the conversation surface. The journal store is shared household state; the + * conversation controller (and its turn log) is per-member, rebuilt per sign-in. + */ +import { useState } from "react" +import { StyleSheet, View } from "react-native" + +import { ConversationController } from "./src/conversation/controller" +import { createSeptemberStore } from "./src/fixtures/september" +import { anonymousPrincipal, at as septemberAt, memberPrincipal } from "./src/fixtures/household" +import { SignInScreen } from "./src/ui/SignInScreen" +import { ConversationScreen } from "./src/ui/ConversationScreen" + +// One shared journal store for the demo session (synthetic September data). +const { store } = createSeptemberStore() + +const DEMO_NOW = septemberAt(16, 20, 0) // Wed Sep 16 2026, 20:00 EDT + +interface Session { + readonly memberId: string + readonly controller: ConversationController +} + +export default function App() { + const [session, setSession] = useState(null) + + if (session === null) { + return ( + + { + const principal = memberId === "mem_stranger" ? anonymousPrincipal : memberPrincipal(memberId) + const authorId = memberId === "mem_stranger" ? "mem_stranger" : memberId + setSession({ memberId, controller: new ConversationController(store, principal, authorId, DEMO_NOW) }) + }} + /> + + ) + } + + return ( + + setSession(null)} + /> + + ) +} + +const styles = StyleSheet.create({ + root: { flex: 1, backgroundColor: "#F7F5F2" }, +}) diff --git a/apps/home-a/app.json b/apps/home-a/app.json new file mode 100644 index 0000000..98ae085 --- /dev/null +++ b/apps/home-a/app.json @@ -0,0 +1,11 @@ +{ + "expo": { + "name": "Parent Home — Candidate A", + "slug": "parent-home-candidate-a", + "version": "0.1.0", + "scheme": "parenthomecandidatea", + "platforms": ["ios", "android", "web"], + "newArchEnabled": true, + "description": "Conversation-first parent home prototype on synthetic data only (A/B candidate A)" + } +} diff --git a/apps/home-a/babel.config.js b/apps/home-a/babel.config.js new file mode 100644 index 0000000..d3b791f --- /dev/null +++ b/apps/home-a/babel.config.js @@ -0,0 +1,8 @@ +// Expo 57 defaults to the React Compiler; this scaffold keeps Babel minimal +// until that migration is intentional. +module.exports = function (api) { + api.cache(true) + return { + presets: ["babel-preset-expo"], + } +} diff --git a/apps/home-a/index.ts b/apps/home-a/index.ts new file mode 100644 index 0000000..b2e38ad --- /dev/null +++ b/apps/home-a/index.ts @@ -0,0 +1,5 @@ +import { registerRootComponent } from "expo" + +import App from "./App" + +registerRootComponent(App) diff --git a/apps/home-a/metro.config.js b/apps/home-a/metro.config.js new file mode 100644 index 0000000..3dd7a36 --- /dev/null +++ b/apps/home-a/metro.config.js @@ -0,0 +1,15 @@ +const { getDefaultConfig } = require("expo/metro-config") +const path = require("path") + +// Monorepo support: let Metro watch and resolve workspace packages. +const projectRoot = __dirname +const workspaceRoot = path.resolve(projectRoot, "../..") + +const config = getDefaultConfig(projectRoot) +config.watchFolders = [workspaceRoot] +config.resolver.nodeModulesPaths = [ + path.resolve(projectRoot, "node_modules"), + path.resolve(workspaceRoot, "node_modules"), +] + +module.exports = config diff --git a/apps/home-a/package.json b/apps/home-a/package.json new file mode 100644 index 0000000..6911dec --- /dev/null +++ b/apps/home-a/package.json @@ -0,0 +1,30 @@ +{ + "name": "@journal/home-a", + "version": "0.1.0", + "private": true, + "description": "Parent Home Candidate A \u2014 conversation-first home prototype (synthetic data only). A/B candidate; see PR description for DO NOT AUTO-MERGE.", + "main": "index.ts", + "scripts": { + "typecheck": "tsc -p tsconfig.json --noEmit", + "test": "vitest run", + "start": "expo start", + "web": "expo start --web", + "android": "expo start --android", + "ios": "expo start --ios" + }, + "dependencies": { + "@journal/domain": "workspace:*", + "effect": "4.0.0-rc.115", + "expo": "~57.0.23", + "react": "19.2.3", + "react-dom": "19.2.3", + "react-native": "0.86.3", + "react-native-web": "^0.21.2" + }, + "devDependencies": { + "@types/node": "^20.19.0", + "@types/react": "~19.2.2", + "typescript": "~6.0.3", + "vitest": "^3.2.4" + } +} diff --git a/apps/home-a/src/capture/extraction.ts b/apps/home-a/src/capture/extraction.ts new file mode 100644 index 0000000..bc61764 --- /dev/null +++ b/apps/home-a/src/capture/extraction.ts @@ -0,0 +1,261 @@ +/** + * Deterministic rule-based extraction double (provider-agnostic stand-in). + * + * Canonical domain envelope in and out: builds an `ExtractionRequest`, and + * returns an `ExtractionResult` decoded through the domain schema — so every + * proposed event already satisfies the canonical `EventFields` (including + * `producedBy` lineage pointing at this run's attempt record). No live LLM + * call: the same utterance always yields the same proposals. + */ +import { Schema } from "effect" +import { + ExtractionRequest, + ExtractionResult, + type Event, + type EventCategory, +} from "@journal/domain" + +export const EXTRACTOR_VERSION = "home-a-extraction-double/0.1.0" +export const CONTRACT_SCHEMA_VERSION = "0.3.0" + +export interface ExtractionDoubleInput { + readonly captureId: string + readonly attempt: number + readonly transcript: string + /** Capture wall-clock (unix ms) — the reference point for relative times. */ + readonly capturedAt: number + readonly householdId: string + /** Child roster for name/alias → childId resolution. */ + readonly childIds: readonly string[] + readonly childNames: readonly { readonly name: string; readonly aliases: readonly string[] }[] + /** Last child mentioned — fallback for childless follow-on clauses. */ + readonly defaultChildId: string + /** Attempt record id this run owns (Event.producedBy.attemptId). */ + readonly attemptRecordId: string +} + +export interface UnstructuredClause { + readonly text: string + readonly reason: string +} + +export interface ExtractionOutcome { + readonly captureId: string + readonly attempt: number + readonly events: readonly Event[] + /** Parallel to `events` (one entry per event, expanded "both" included). */ + readonly sourceClauses: readonly string[] + readonly unstructured: readonly UnstructuredClause[] +} + +// --- clause splitting --------------------------------------------------------- + +const CLAUSE_SPLIT = /(?:,\s*(?:then|and|but)\s+|\s+and\s+then\s+|\s+then\s+|;\s+|\?\s+|\.\s+|!\s+)/ + +function splitClauses(transcript: string): string[] { + return transcript + .split(CLAUSE_SPLIT) + .map((part) => part.trim()) + .filter((part) => part.length > 0) +} + +// --- categories ------------------------------------------------------------------ + +interface CategoryRule { + readonly category: EventCategory + readonly pattern: RegExp + readonly priority: number +} + +const CATEGORY_RULES: readonly CategoryRule[] = [ + { category: "milestone", pattern: /\b(first|pedal(ed|s)?|learned to|new word|rolled over|sat up|tooth|steps)\b/i, priority: 10 }, + { category: "sleep", pattern: /\b(napped?|napping|asleep|bedtime|sleep|woke|waking|wakes|down (?:by|at)|crashed)\b/i, priority: 6 }, + { category: "meal", pattern: /\b(ate|eat|eating|refused|refuse|milk|formula|ounces|oz\b)|\b(breakfast|lunch|dinner|snack|eggs|toast|oatmeal|pancakes?|yogurt|berries|fruit|veggies|pasta|rice|chicken|crackers|applesauce|banana|cheese|sandwich|soup|smoothie|pickle|pretzels|pizza|waffle|cereal|sweet potato|grilled cheese)\b/i, priority: 8 }, + { category: "potty", pattern: /\b(poop(ed|ing)?|pee(d|ing)?|potty|diaper|toilet|underwear)\b/i, priority: 7 }, + { category: "mood", pattern: /\b(meltdown|tantrum|grumpy|crank(y|ier)|fussy|happy|giggly|giggled|cheerful|sad|cried|crying|upset|clingy|delighted|proud|frustrated|nervous)\b/i, priority: 4 }, + { category: "school", pattern: /\b(school|pre-?k|classroom|teacher|drop-?off|pickup|circle time|water play|show and tell|bucket brigade)\b/i, priority: 3 }, +] + +/** Content that stays raw on purpose (no matching contract category). */ +const UNSTRUCTURED_RULES: ReadonlyArray<{ readonly pattern: RegExp; readonly reason: string }> = [ + { pattern: /\b(checkup|doctor|pediatrician|appointment|shot|vaccine|fever|medicine|dose|symptom|rash|thermometer)\b/i, reason: "health-note-raw" }, +] + +function pickCategory(clause: string): EventCategory | undefined { + let matches = CATEGORY_RULES.filter((rule) => rule.pattern.test(clause)) + .sort((a, b) => b.priority - a.priority) + // A SKIPPED nap is not a sleep record — "skipped her nap" never becomes sleep. + if (/\bskip(ped|ping)?\b/i.test(clause)) { + matches = matches.filter((m) => m.category !== "sleep") + } + // "napped 45 minutes after lunch" — duration wording wins over the meal word. + const hasDuration = /\b\d{1,3}\s*(minutes?|mins?|hours?|hrs?)\b/i.test(clause) + if (hasDuration) { + const sleep = matches.find((m) => m.category === "sleep") + if (sleep !== undefined) return "sleep" + } + return matches[0]?.category +} + +function unstructuredReason(clause: string): string | undefined { + return UNSTRUCTURED_RULES.find((rule) => rule.pattern.test(clause))?.reason +} + +// --- quantities -------------------------------------------------------------------- + +function extractQuantity(clause: string): Record | undefined { + const duration = clause.match(/\b(\d{1,3})\s*(minutes?|mins?|hours?|hrs?)\b/i) + if (duration?.[1] !== undefined) { + const value = Number.parseInt(duration[1], 10) + const unit = (duration[2] ?? "").toLowerCase() + const minutes = unit.startsWith("h") ? value * 60 : value + return { minutes } + } + const count = clause.match(/\b(three|two|one|four|five)\b/i) + if (count?.[1] !== undefined) { + const words: Record = { one: 1, two: 2, three: 3, four: 4, five: 5 } + const value = words[(count[1] ?? "").toLowerCase()] + if (value !== undefined) return { count: value } + } + return undefined +} + +// --- time resolution ------------------------------------------------------------------ + +/** Day-part → local hour (the 2026 synthetic dataset is America/New_York, EDT = UTC−4). */ +const DAY_PART_HOURS: ReadonlyArray<{ readonly pattern: RegExp; readonly hour: number }> = [ + { pattern: /\bthis morning\b/i, hour: 8 }, + { pattern: /\bmid-morning\b/i, hour: 10 }, + { pattern: /\bat lunch\b|\blunchtime\b/i, hour: 12 }, + { pattern: /\bthis afternoon\b/i, hour: 14 }, + { pattern: /\btonight\b/i, hour: 19 }, + { pattern: /\bthis evening\b/i, hour: 18 }, +] + +const MEAL_HINT_HOURS: Record = { breakfast: 8, lunch: 12, dinner: 18, bedtime: 20 } + +/** UTC midnight (unix ms) of the day containing `atMs`. */ +function utcMidnight(atMs: number): number { + return atMs - ((atMs / 1000) % 86400) * 1000 +} + +function localHour(atMs: number): number { + return new Date(atMs).getUTCHours() - 4 +} + +function resolveTimestamp(clause: string, capturedAt: number): number { + const clock = clause.match(/\bat\s+(\d{1,2})(?::(\d{2}))?\b|\bfrom\s+(\d{1,2})(?::(\d{2}))?\b|\bto\s+(\d{1,2})(?::(\d{2}))?\b/) + if (clock !== null) { + const hourText = clock[1] ?? clock[3] ?? clock[5] + const minuteText = clock[2] ?? clock[4] ?? clock[6] + if (hourText !== undefined) { + let hour = Number.parseInt(hourText, 10) + const minute = minuteText !== undefined ? Number.parseInt(minuteText, 10) : 0 + // "at 3" spoken in the afternoon means 15:00. + if (hour <= 11 && localHour(capturedAt) >= 12) hour += 12 + return utcMidnight(capturedAt) + (hour + 4) * 3_600_000 + minute * 60_000 + } + } + for (const dayPart of DAY_PART_HOURS) { + if (dayPart.pattern.test(clause)) { + return utcMidnight(capturedAt) + (dayPart.hour + 4) * 3_600_000 + } + } + const mealHint = clause.match(/\b(breakfast|lunch|dinner|bedtime)\b/i) + if (mealHint !== null) { + const hour = MEAL_HINT_HOURS[(mealHint[1] ?? "").toLowerCase()] ?? 12 + return utcMidnight(capturedAt) + (hour + 4) * 3_600_000 + } + return capturedAt +} + +function escapeRegExp(text: string): string { + return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") +} + +// --- the double ------------------------------------------------------------------------ + +function buildDraftEvents( + input: ExtractionDoubleInput, +): { readonly drafts: readonly { readonly fields: unknown; readonly sourceClause: string }[]; readonly unstructured: UnstructuredClause[] } { + const clauses = splitClauses(input.transcript) + const drafts: { fields: unknown; sourceClause: string }[] = [] + const unstructured: UnstructuredClause[] = [] + let lastMentionedChildId: string | undefined + + for (const clause of clauses) { + // childNames is index-aligned with childIds (name-vs-id mismatch here made + // every clause resolve to the default child). + const mentioned = input.childIds + .map((childId, index) => ({ childId, def: input.childNames[index] })) + .filter(({ childId, def }) => { + if (def === undefined) return false + const names = [def.name, ...def.aliases] + return names.some((name) => new RegExp(`\\b${escapeRegExp(name)}\\b`, "i").test(clause)) + }) + .map(({ childId }) => childId) + // "Both kids down by 8" expands to one event per child. + const bothChildren = /\bboth\b/i.test(clause) && mentioned.length === 0 + const targetChildIds: readonly string[] = bothChildren + ? input.childIds + : mentioned.length > 0 + ? mentioned + : [lastMentionedChildId ?? input.defaultChildId] + if (mentioned.length > 0) lastMentionedChildId = mentioned[mentioned.length - 1] + + const category = pickCategory(clause) + if (category === undefined) { + const reason = unstructuredReason(clause) ?? "no-matching-contract-category" + unstructured.push({ text: clause, reason }) + continue + } + + const timestamp = resolveTimestamp(clause, input.capturedAt) + const payload = extractQuantity(clause) + for (const targetChildId of targetChildIds) { + drafts.push({ + sourceClause: clause, + fields: { + householdId: input.householdId, + childId: targetChildId, + category, + timestamp, + ...(payload === undefined ? {} : { payload }), + confidence: 0.9, + producedBy: { + attemptId: input.attemptRecordId, + extractorVersion: EXTRACTOR_VERSION, + schemaVersion: CONTRACT_SCHEMA_VERSION, + }, + }, + }) + } + } + return { drafts, unstructured } +} + +/** + * Run the deterministic double: canonical request in, canonical envelope out. + * The result is decoded through the domain `ExtractionResult` schema — the + * store receives only envelope-valid, EventFields-valid proposals. + */ +export function runExtraction(input: ExtractionDoubleInput): ExtractionOutcome { + const request = Schema.decodeUnknownSync(ExtractionRequest)({ + captureId: input.captureId, + attempt: input.attempt, + transcript: input.transcript, + }) + const built = buildDraftEvents(input) + const result = Schema.decodeUnknownSync(ExtractionResult)({ + captureId: request.captureId, + attempt: request.attempt, + events: built.drafts.map((draft) => draft.fields), + }) + return { + captureId: result.captureId, + attempt: result.attempt, + events: result.events, + sourceClauses: built.drafts.map((draft) => draft.sourceClause), + unstructured: built.unstructured, + } +} diff --git a/apps/home-a/src/capture/simulatedVoice.ts b/apps/home-a/src/capture/simulatedVoice.ts new file mode 100644 index 0000000..52dc01b --- /dev/null +++ b/apps/home-a/src/capture/simulatedVoice.ts @@ -0,0 +1,81 @@ +/** + * Simulated voice demo — the scripted replacement for a device transcriber. + * + * Real on-device voice (expo-audio + SpeechTranscriber, per the PR #8 spike + * patterns) needs a device build; in this environment the voice PATH is + * demonstrated with a scripted transcriber that is shaped exactly like the + * spike's VoiceTranscriber (available/prepare/transcribe + error codes), so + * the capture pipeline receives byte-identical transcripts from either path. + * The evidence doc discloses this fidelity openly. + */ +import type { TranscriptSegment } from "./transcript" + +export type SimulatedVoiceErrorCode = + | "unavailable" + | "unsupported-locale" + | "preparation-failed" + | "transcription-failed" + | "cancelled" + +export class SimulatedVoiceError extends Error { + readonly code: SimulatedVoiceErrorCode + constructor(code: SimulatedVoiceErrorCode, message: string) { + super(message) + this.name = "SimulatedVoiceError" + this.code = code + } +} + +export interface TranscriptionResult { + readonly locale: string + readonly segments: readonly TranscriptSegment[] +} + +/** Same contract surface the device transcriber will implement. */ +export interface VoiceTranscriberContract { + readonly name: string + isAvailable(locale?: string): boolean + prepare(locale?: string): Promise + /** Transcribes a scripted utterance into streamable segments. */ + transcribeScripted(text: string, locale?: string): TranscriptionResult +} + +const SUPPORTED_LOCALES = ["en-US"] + +/** + * Deterministic scripted transcriber. The full utterance is returned as ONE + * segment whose text is the exact scripted string — `joinedTranscriptText` + * then reproduces the utterance byte-for-byte (no lost spaces between + * clauses). Word-level "streaming" is a display effect the UI layers on top; + * the pipeline only ever sees the joined transcript. + */ +export function scriptedVoiceTranscriber(): VoiceTranscriberContract { + return { + name: "simulated-scripted", + isAvailable(locale = "en-US"): boolean { + return SUPPORTED_LOCALES.includes(locale) + }, + async prepare(locale = "en-US"): Promise { + if (!SUPPORTED_LOCALES.includes(locale)) { + throw new SimulatedVoiceError("unsupported-locale", `Locale ${locale} is not scripted`) + } + }, + transcribeScripted(text: string, locale = "en-US"): TranscriptionResult { + const trimmed = text.trim() + if (!SUPPORTED_LOCALES.includes(locale)) { + throw new SimulatedVoiceError("unsupported-locale", `Locale ${locale} is not scripted`) + } + if (trimmed.length === 0) { + throw new SimulatedVoiceError("transcription-failed", "Nothing spoken to transcribe") + } + // Byte fidelity: one segment holding the exact utterance. + const segments: TranscriptSegment[] = [{ text: trimmed, confidence: 0.98 }] + return { locale, segments } + }, + } +} + +/** Spike-shaped helper: join segments back to the transcript the pipeline sees. */ +export function joinedTranscriptText(result: TranscriptionResult): string { + return result.segments.map((segment) => segment.text).join("").trim() +} diff --git a/apps/home-a/src/capture/transcript.ts b/apps/home-a/src/capture/transcript.ts new file mode 100644 index 0000000..47d6845 --- /dev/null +++ b/apps/home-a/src/capture/transcript.ts @@ -0,0 +1,11 @@ +/** + * Transcription segment — shaped after the PR #8 voice-dictation spike's + * VoiceTranscriber output (timestamped segments with confidence). The + * simulated transcriber produces the same shape; the capture pipeline only + * ever consumes the joined transcript text. + */ +export interface TranscriptSegment { + readonly text: string + /** 0..1 transcription confidence from the (simulated) recognizer. */ + readonly confidence: number +} diff --git a/apps/home-a/src/conversation/controller.ts b/apps/home-a/src/conversation/controller.ts new file mode 100644 index 0000000..b496a5e --- /dev/null +++ b/apps/home-a/src/conversation/controller.ts @@ -0,0 +1,237 @@ +/** + * ConversationController — the conversation-first home surface engine. + * + * One thread holds everything: user turns, capture turns (raw + reviewable + * proposed events), publish receipts, corrections, and read-only answers. + * Voice (simulated) and text feed the SAME capture pipeline; questions and + * catch-up are strictly read-only. + */ +import { JournalStore, type DenyCode, type EventEdit, type ProposalRecord, type Receipt, type CorrectionRecord, type Audience, type Principal, type Answer } from "../journal/store" +import type { UnstructuredClause } from "../capture/extraction" +import { scriptedVoiceTranscriber, joinedTranscriptText } from "../capture/simulatedVoice" + +export type CaptureChannel = "voice-simulated" | "text" + +export type Turn = + | { readonly id: string; readonly kind: "user"; readonly authorId: string; readonly text: string; readonly channel: CaptureChannel; readonly at: number } + | { readonly id: string; readonly kind: "capture"; readonly entryId: string; readonly captureId: string; readonly rawTranscript: string; readonly proposals: readonly ProposalRecord[]; readonly unstructured: readonly UnstructuredClause[]; readonly at: number } + | { readonly id: string; readonly kind: "replayed"; readonly entryId: string; readonly captureId: string; readonly at: number } + | { readonly id: string; readonly kind: "publish-receipt"; readonly receipt: Receipt; readonly eventIds: readonly string[]; readonly at: number } + | { readonly id: string; readonly kind: "correction"; readonly record: CorrectionRecord; readonly at: number } + | { readonly id: string; readonly kind: "answer"; readonly question: string; readonly answer: Answer; readonly at: number } + | { readonly id: string; readonly kind: "catchup"; readonly result: Answer; readonly at: number } + | { readonly id: string; readonly kind: "month-view"; readonly view: Answer; readonly monthKey: string; readonly at: number } + | { readonly id: string; readonly kind: "denied"; readonly action: string; readonly code: DenyCode; readonly detail: string; readonly at: number } + | { readonly id: string; readonly kind: "system"; readonly text: string; readonly at: number } + +const QUESTION_STARTERS = /^(how|what|when|who|did|any|is|are)\b/i + +/** A read-only question routes to the answer engine, never the capture pipeline. */ +export function isReadOnlyQuestion(text: string): boolean { + const trimmed = text.trim() + return trimmed.endsWith("?") && QUESTION_STARTERS.test(trimmed) +} + +/** Omit must distribute over the Turn union — plain Omit collapses it. */ +type DistributiveOmit = T extends unknown ? Omit : never +type TurnInput = DistributiveOmit & { readonly id?: string } + +export class ConversationController { + private readonly turns: Turn[] = [] + private readonly listeners = new Set<() => void>() + private version = 0 + private readonly voice = scriptedVoiceTranscriber() + private turnSequence = 0 + + constructor( + private readonly store: JournalStore, + private principal: Principal, + private demoAuthorId: string, + /** Demo clock — fixed for deterministic demos/tests. */ + private now: number, + ) {} + + /** Swap the signed-in member (sign-in screen drives this). */ + switchPrincipal(next: Principal, authorId: string, atMs?: number): void { + this.principal = next + this.demoAuthorId = authorId + if (atMs !== undefined) this.now = atMs + this.push({ kind: "system", text: "Signed in. The journal thread below is scoped to what you may see — nothing more.", at: this.now }) + } + + setNow(atMs: number): void { + this.now = atMs + } + + // --- subscribe/notify (React external-store friendly) ----------------------- + + subscribe = (listener: () => void): (() => void) => { + this.listeners.add(listener) + return () => { + this.listeners.delete(listener) + } + } + + getVersion = (): number => this.version + + getTurns = (): readonly Turn[] => this.turns + + private push(turn: TurnInput): void { + this.turnSequence += 1 + const withId = { ...turn, id: turn.id ?? `turn_${this.turnSequence}` } as Turn + this.turns.push(withId) + this.version += 1 + for (const listener of this.listeners) listener() + } + + // --- capture: voice (simulated) and text hit the SAME pipeline --------------- + + sendText(text: string): void { + this.send(text, "text") + } + + /** Simulated voice path: scripted transcription → identical pipeline call. */ + sendVoiceDemo(text: string): void { + if (!this.voice.isAvailable()) { + this.push({ kind: "denied", action: "voice", code: "DENY_NO_HOUSEHOLD_PATH", detail: "Voice unavailable", at: this.now }) + return + } + const result = this.voice.transcribeScripted(text) + this.send(joinedTranscriptText(result), "voice-simulated") + } + + private send(text: string, channel: CaptureChannel): void { + const atMs = this.now + if (isReadOnlyQuestion(text)) { + this.ask(text) + return + } + this.push({ kind: "user", authorId: this.demoAuthorId, text, channel, at: atMs }) + + const captureId = `cap_${atMs}_${this.turnSequence}` + const outcome = this.store.capture(this.principal, { + captureId, + transcript: text, + authorId: this.demoAuthorId, + capturedAt: atMs, + channel, + }) + if (outcome.kind === "captured") { + this.push({ + kind: "capture", + entryId: outcome.entryId, + captureId, + rawTranscript: outcome.entry.rawTranscript, + proposals: outcome.proposals, + unstructured: [...outcome.unstructured], + at: atMs, + }) + } else if (outcome.kind === "replayed") { + this.push({ kind: "replayed", entryId: outcome.entryId, captureId, at: atMs }) + } else if (outcome.kind === "rejected") { + this.push({ kind: "system", text: `Nothing captured: ${outcome.reason}`, at: atMs }) + } else { + this.push({ kind: "denied", action: "capture", code: outcome.code, detail: outcome.detail, at: atMs }) + } + } + + // --- review → publish --------------------------------------------------------- + + /** Arrow field: the UI passes this as a bare reference, so it must not lose `this`. */ + publish = (entryId: string, edits: ReadonlyMap, audience?: Audience): void => { + const atMs = this.now + const result = this.store.publish(this.principal, { + entryId, + edits, + ...(audience === undefined ? {} : { audience }), + at: atMs, + }) + if (result.kind === "published") { + this.push({ kind: "publish-receipt", receipt: result.receipt, eventIds: result.eventIds, at: atMs }) + } else if (result.kind === "denied") { + this.push({ kind: "denied", action: "publish", code: result.code, detail: result.detail, at: atMs }) + } else { + this.push({ kind: "system", text: `Publish failed: ${result.reason}`, at: atMs }) + } + } + + proposalsFor(entryId: string): readonly ProposalRecord[] { + return this.store.proposalsFor(entryId) + } + + get childrenRoster() { + return this.store.childrenRoster + } + + /** Event lookup for in-thread correction forms. */ + eventFor(eventId: string) { + return this.store.event(eventId) + } + + // --- post-publish correction (append-only) ------------------------------------- + + /** Arrow field: the UI passes this as a bare reference, so it must not lose `this`. */ + correct = (eventId: string, changes: EventEdit, reason: string): void => { + const atMs = this.now + const result = this.store.correct(this.principal, { + eventId, + changes, + reason: reason.length > 0 ? reason : "Corrected in conversation", + authorId: this.demoAuthorId, + at: atMs, + }) + if (result.kind === "corrected") { + this.push({ kind: "correction", record: result.record, at: atMs }) + } else { + this.push({ kind: "denied", action: "correction", code: result.code, detail: result.detail, at: atMs }) + } + } + + /** Correction history for an event (read-only view for the UI). */ + correctionHistory(eventId: string) { + return this.store.correctionHistory(eventId) + } + + // --- read-only catch-up & questions ---------------------------------------------- + + ask(question: string): void { + const atMs = this.now + this.push({ kind: "user", authorId: this.demoAuthorId, text: question, channel: "text", at: atMs }) + const answer = this.store.ask(this.principal, question, atMs) + if (answer.kind === "denied") { + this.push({ kind: "denied", action: "question", code: answer.code, detail: answer.detail, at: atMs }) + } else { + this.push({ kind: "answer", question, answer, at: atMs }) + } + } + + catchUp(): void { + const atMs = this.now + const result = this.store.catchUp(this.principal, atMs) + if (result.kind === "denied") { + this.push({ kind: "denied", action: "catch-up", code: result.code, detail: result.detail, at: atMs }) + } else { + this.push({ kind: "catchup", result, at: atMs }) + } + } + + monthView(monthKey = "2026-09"): void { + const atMs = this.now + const view = this.store.monthView(this.principal, monthKey) + if (view.kind === "denied") { + this.push({ kind: "denied", action: "month view", code: view.code, detail: view.detail, at: atMs }) + } else { + this.push({ kind: "month-view", view, monthKey, at: atMs }) + } + } + + markCaughtUp(): void { + const atMs = this.now + const result = this.store.markCaughtUp(this.principal, atMs) + if (result.kind === "marked") { + this.push({ kind: "system", text: `Marked caught up — ${result.receipt.summary}`, at: atMs }) + } else { + this.push({ kind: "denied", action: "mark caught up", code: result.code, detail: result.detail, at: atMs }) + } + } +} diff --git a/apps/home-a/src/fixtures/demoUtterances.ts b/apps/home-a/src/fixtures/demoUtterances.ts new file mode 100644 index 0000000..6e5f127 --- /dev/null +++ b/apps/home-a/src/fixtures/demoUtterances.ts @@ -0,0 +1,16 @@ +/** Scripted demo utterances — the simulated-voice chips (and pipeline tests). */ +export const DEMO_UTTERANCES: readonly string[] = [ + "Milo ate scrambled eggs and toast at 8, then had a total meltdown when the block tower fell, and Iris napped 45 minutes.", + "Can you log that Iris had her checkup today? Oh and Milo refused dinner again.", + "Iris napped 50 minutes this afternoon.", + "Milo pooped on the potty at 3, big win!", + "Both kids down by 8 tonight.", +] + +/** Read-only question chips — answers come from history with citations. */ +export const DEMO_QUESTIONS: readonly string[] = [ + "How did naps go this week?", + "How did meals go today?", + "Any milestones this month?", + "Did Iris nap today?", +] diff --git a/apps/home-a/src/fixtures/household.ts b/apps/home-a/src/fixtures/household.ts new file mode 100644 index 0000000..c6cf571 --- /dev/null +++ b/apps/home-a/src/fixtures/household.ts @@ -0,0 +1,65 @@ +/** + * Synthetic household — the Polanco Household. 100% synthetic demo data; no + * real user data anywhere in this candidate. Members mirror the product scope: + * known parents + one caregiver who arrives by explicit invitation (never + * anonymous, never mass-assigned). + */ +import { Schema } from "effect" +import { ChildSchema, type Child } from "@journal/domain" + +import type { HouseholdSeed, Member, Principal } from "../journal/store" + +export const HOUSEHOLD_ID = "hh_polanco_household" +export const HOUSEHOLD_NAME = "Polanco Household" +export const TIMEZONE = "America/New_York" + +/** Local (EDT) wall-clock → unix ms for September 2026 (EDT = UTC−4). */ +export const at = (day: number, hour: number, minute = 0): number => Date.UTC(2026, 8, day, hour + 4, minute) + +export const MEMBERS: readonly Member[] = [ + { memberId: "mem_dana", displayName: "Dana Polanco", role: "parent", alias: "Mom", lastCheckedAt: null }, + { memberId: "mem_gilbert", displayName: "Gilbert Polanco", role: "parent", alias: "Dad", lastCheckedAt: null }, + { memberId: "mem_rosa", displayName: "Rosa Marin", role: "caregiver", alias: "Nana Rosa", lastCheckedAt: null }, +] + +/** Children as decoded domain Child documents (schema-validated). */ +export function childrenDocs(): readonly Child[] { + return [ + Schema.decodeUnknownSync(ChildSchema)({ + householdId: HOUSEHOLD_ID, + name: "Milo", + birthDate: Date.UTC(2022, 4, 12), // age 4 in September 2026 + createdAt: at(1, 0, 0), + }), + Schema.decodeUnknownSync(ChildSchema)({ + householdId: HOUSEHOLD_ID, + name: "Iris", + birthDate: Date.UTC(2025, 2, 30), // 18 months in September 2026 + createdAt: at(1, 0, 0), + }), + ] +} + +export const HOUSEHOLD_SEED: HouseholdSeed = { + householdId: HOUSEHOLD_ID, + householdName: HOUSEHOLD_NAME, + timezone: TIMEZONE, + members: MEMBERS.map((member) => ({ ...member })), + children: [ + { childId: "ch_milo", name: "Milo", aliases: ["big guy"] }, + { childId: "ch_iris", name: "Iris", aliases: ["little one"] }, + ], +} + +/** Build a fail-closed principal for a known member (household path included). */ +export function memberPrincipal(memberId: string): Principal { + const member = MEMBERS.find((candidate) => candidate.memberId === memberId) + if (member === undefined) { + // Not on the roster: a principal with NO household path — every check denies. + return { kind: "member", memberId, role: "caregiver", householdIds: [] } + } + return { kind: "member", memberId, role: member.role, householdIds: [HOUSEHOLD_ID] } +} + +/** A deliberately unauthenticated principal for fail-closed demos. */ +export const anonymousPrincipal: Principal = { kind: "anonymous" } diff --git a/apps/home-a/src/fixtures/september.ts b/apps/home-a/src/fixtures/september.ts new file mode 100644 index 0000000..a275a03 --- /dev/null +++ b/apps/home-a/src/fixtures/september.ts @@ -0,0 +1,187 @@ +/** + * Synthetic month history — September 1–16, 2026 (Polanco Household). + * + * Built THROUGH the real pipeline: every entry is captured (raw transcript + * preserved verbatim), its proposals reviewed-confirmed, and published — + * exactly the flow a live caregiver drives — so seeded history is + * schema-decoded, provenance-linked, and receipted by construction. One seeded + * post-publish correction (Iris's Sep 12 nap 30 → 60 minutes) exercises + * append-only lineage. 100% synthetic; no real user data. + */ +import { JournalStore, type Audience, type EventEdit } from "../journal/store" +import { at, HOUSEHOLD_SEED, memberPrincipal } from "./household" + +interface SeedCapture { + readonly captureId: string + readonly memberId: string + readonly day: number + readonly hour: number + readonly minute: number + readonly transcript: string + readonly photoId?: string + readonly audience?: Audience +} + +/** The month's raw captures — voice-utterance style, mixed-topic, verbatim. */ +const SEED_CAPTURES: readonly SeedCapture[] = [ + // Sep 1 + { captureId: "seed_sep01_breakfast", memberId: "mem_dana", day: 1, hour: 7, minute: 55, + transcript: "Milo had oatmeal and bananas for breakfast at 7:45." }, + { captureId: "seed_sep01_diaper", memberId: "mem_dana", day: 1, hour: 8, minute: 20, + transcript: "Iris is soaked through again — third diaper change before 8, this one was a poop." }, + { captureId: "seed_sep01_bedtime", memberId: "mem_dana", day: 1, hour: 19, minute: 58, + transcript: "Milo went down at 8 after two books, and Iris finally crashed at 7:40." }, + // Sep 2 — anchor: Milo starts the new pre-K classroom (Dad) + { captureId: "seed_sep02_preschool", memberId: "mem_gilbert", day: 2, hour: 8, minute: 25, + transcript: "Milo started in the new pre-K classroom today. He was nervous at drop-off but his teacher says he settled right in by circle time." }, + { captureId: "seed_sep02_dinner", memberId: "mem_gilbert", day: 2, hour: 17, minute: 45, + transcript: "Milo told me all about his new classroom over dinner — he ate most of his pasta and refused the peas." }, + // Sep 3 — Nana Rosa afternoon-care note + { captureId: "seed_sep03_rosa", memberId: "mem_rosa", day: 3, hour: 16, minute: 50, + transcript: "Nana Rosa — Iris had applesauce and crackers around 3:30 and then napped 50 minutes. Milo had pickle and pretzels after school." }, + // Sep 4 + { captureId: "seed_sep04_potty", memberId: "mem_dana", day: 4, hour: 9, minute: 30, + transcript: "Milo pooped on the potty all by himself this morning — huge win for week two of training." }, + // Sep 5 — anchor: park trip photo (Mom) + { captureId: "seed_sep05_park", memberId: "mem_dana", day: 5, hour: 10, minute: 30, + transcript: "Park trip this morning — got a great photo of Milo and Iris on the swings.", + photoId: "photo_park_2026_09_05" }, + // Sep 6 + { captureId: "seed_sep06_nap", memberId: "mem_dana", day: 6, hour: 10, minute: 15, + transcript: "Iris napped 55 minutes this morning." }, + { captureId: "seed_sep06_tower", memberId: "mem_dana", day: 6, hour: 11, minute: 5, + transcript: "Milo built a block tower for an hour and then had a total meltdown when it fell." }, + { captureId: "seed_sep06_bite", memberId: "mem_dana", day: 6, hour: 20, minute: 10, + transcript: "Milo bit a classmate today — teacher called after pickup. Let's coordinate with the teacher before Nana Rosa hears it secondhand; don't want her worried.", + audience: "parents-only" }, + // Sep 7 + { captureId: "seed_sep07_dinner", memberId: "mem_gilbert", day: 7, hour: 18, minute: 30, + transcript: "Milo refused dinner again. Iris ate her weight in sweet potato." }, + // Sep 8 — anchor: milestone, first pedals on the balance bike (Mom) + { captureId: "seed_sep08_bike", memberId: "mem_dana", day: 8, hour: 17, minute: 40, + transcript: "Big moment — Milo pedaled the balance bike all by himself for the first time today!" }, + // Sep 9 + { captureId: "seed_sep09_nap", memberId: "mem_dana", day: 9, hour: 13, minute: 20, + transcript: "Iris napped 45 minutes. Milo is getting grumpy after skipped preschool nap days." }, + { captureId: "seed_sep09_night", memberId: "mem_gilbert", day: 9, hour: 20, minute: 5, + transcript: "Both kids down by 8. Milo woke at 6:45 ready to go — that night sleep is holding at 10 hours 45." }, + // Sep 10 — Nana Rosa afternoon-care note + { captureId: "seed_sep10_rosa", memberId: "mem_rosa", day: 10, hour: 16, minute: 55, + transcript: "Afternoon with Nana Rosa — Iris napped 60 minutes from 1:00, then snack was yogurt and berries at 3:15. Milo came home without his shoes again." }, + // Sep 11 + { captureId: "seed_sep11_checkup", memberId: "mem_dana", day: 11, hour: 17, minute: 30, + transcript: "Can you log that Iris had her checkup today? Oh and Milo refused dinner again." }, + // Sep 12 — the lineage example: logged 30, corrected to 60 + { captureId: "seed_sep12_nap", memberId: "mem_dana", day: 12, hour: 13, minute: 5, + transcript: "Iris napped 30 minutes." }, + { captureId: "seed_sep12_dinner", memberId: "mem_gilbert", day: 12, hour: 18, minute: 40, + transcript: "Silver dollar pancakes for dinner tonight — Milo ate three at 6, and Iris had mashed banana." }, + // Sep 13 + { captureId: "seed_sep13_nonap", memberId: "mem_dana", day: 13, hour: 15, minute: 10, + transcript: "Iris skipped her afternoon nap entirely and got crankier by the hour." }, + // Sep 14 + { captureId: "seed_sep14_nap", memberId: "mem_dana", day: 14, hour: 13, minute: 35, + transcript: "Iris napped 55 minutes while Milo was at school." }, + // Sep 15 — Nana Rosa afternoon-care note + { captureId: "seed_sep15_rosa", memberId: "mem_rosa", day: 15, hour: 16, minute: 45, + transcript: "Nana Rosa — potty practice before snack: Milo peed on the potty at 4:15 like a champ, then crackers and milk at 4:30." }, + // Sep 16 + { captureId: "seed_sep16_waterplay", memberId: "mem_gilbert", day: 16, hour: 8, minute: 40, + transcript: "Water play day at pre-K — Milo's teacher says he led the bucket brigade. He was soaked and delighted." }, + { captureId: "seed_sep16_bedtime", memberId: "mem_dana", day: 16, hour: 19, minute: 5, + transcript: "Iris napped 65 minutes late this afternoon, so bedtime slid to 7:45 for her; Milo still down at 8." }, +] + +/** Named facts tests and the UI pin against (stable ids from the seed walk). */ +export interface SeedFacts { + readonly entryCount: number + readonly entryIdByCaptureId: ReadonlyMap + readonly eventIdsByCaptureId: ReadonlyMap + /** The Sep 12 nap event corrected 30 → 60 (append-only lineage example). */ + readonly sep12Nap: { readonly entryId: string; readonly eventId: string } + /** The parents-only raw+event entry (Sep 6). */ + readonly parentsOnlyEntryId: string +} + +/** + * Build the seeded September store. Deterministic: fixed timestamps, the + * deterministic extraction double, fixed review confirmations. + */ +export function createSeptemberStore(): { readonly store: JournalStore; readonly facts: SeedFacts } { + const store = new JournalStore(HOUSEHOLD_SEED) + const entryIdByCaptureId = new Map() + const eventIdsByCaptureId = new Map() + + for (const seed of SEED_CAPTURES) { + const principal = memberPrincipal(seed.memberId) + const capturedAt = at(seed.day, seed.hour, seed.minute) + const outcome = store.capture(principal, { + captureId: seed.captureId, + transcript: seed.transcript, + authorId: seed.memberId, + capturedAt, + channel: "text", + ...(seed.photoId === undefined ? {} : { photoId: seed.photoId }), + }) + if (outcome.kind !== "captured") { + throw new Error(`seed capture ${seed.captureId} failed: ${JSON.stringify(outcome)}`) + } + entryIdByCaptureId.set(seed.captureId, outcome.entryId) + + // Review-confirmation: the month history was already reviewed by the + // caregiver at seed time → publish with no further edits (confidence 1). + const audience: Audience | undefined = seed.audience + const edits = new Map() + const published = store.publish(principal, { + entryId: outcome.entryId, + edits, + ...(audience === undefined ? {} : { audience }), + at: capturedAt + 60_000, + }) + if (published.kind !== "published") { + throw new Error(`seed publish ${seed.captureId} failed: ${JSON.stringify(published)}`) + } + eventIdsByCaptureId.set(seed.captureId, published.eventIds) + } + + // Lineage example: Iris's Sep 12 nap logged 30 minutes, corrected to 60 — + // append-only (the original stays preserved in the correction record). + const napEntryId = entryIdByCaptureId.get("seed_sep12_nap") + const napEventIds = eventIdsByCaptureId.get("seed_sep12_nap") + if (napEntryId === undefined || napEventIds === undefined || napEventIds.length !== 1) { + throw new Error("seed lineage capture missing its published event") + } + const napEventId = napEventIds[0] + if (napEventId === undefined) throw new Error("seed lineage event id missing") + const corrected = store.correct(memberPrincipal("mem_dana"), { + eventId: napEventId, + changes: { payload: { minutes: 60 } }, + reason: "Timer said 60 — she was out cold; logging it properly.", + authorId: "mem_dana", + at: at(12, 17, 45), + }) + if (corrected.kind !== "corrected") { + throw new Error(`seed correction failed: ${JSON.stringify(corrected)}`) + } + + // Dana last checked in the evening of Sep 9 — her catch-up demo covers + // Sep 10–16. Set through the explicit write path (receipted). + const caughtUp = store.markCaughtUp(memberPrincipal("mem_dana"), at(9, 20, 30)) + if (caughtUp.kind !== "marked") throw new Error("seed markCaughtUp failed") + + const parentsOnlyEntryId = entryIdByCaptureId.get("seed_sep06_bite") + if (napEntryId === undefined || parentsOnlyEntryId === undefined) { + throw new Error("seed facts incomplete") + } + + return { + store, + facts: { + entryCount: SEED_CAPTURES.length, + entryIdByCaptureId, + eventIdsByCaptureId, + sep12Nap: { entryId: napEntryId, eventId: napEventId }, + parentsOnlyEntryId, + }, + } +} diff --git a/apps/home-a/src/journal/access.ts b/apps/home-a/src/journal/access.ts new file mode 100644 index 0000000..50a268d --- /dev/null +++ b/apps/home-a/src/journal/access.ts @@ -0,0 +1,72 @@ +/** + * Candidate-scope authorization for the conversation-first parent home. + * + * Mirrors the repo's fail-closed policy semantics (security/access/policy.ts, + * merged PR #4): decisions are values, check order is fixed, and absent or + * malformed data NEVER opens access. Deny codes are kept compatible so the + * threat model's tests map 1:1. + * + * Candidate-scope simplification (documented in the evidence doc, final + * modeling belongs to slot 20 / feat/audience-publication): audience is + * resolved from relationship grants here, keyed by member role — never stored + * on the domain Entry. `parents-only` entries are hidden from caregiver-role + * members and from non-members entirely. + */ +import type { Entry } from "@journal/domain" + +export type MemberRole = "parent" | "caregiver" + +/** Known-member principal; anonymous principals have trust level zero. */ +export type Principal = + | { readonly kind: "member"; readonly memberId: string; readonly role: MemberRole; readonly householdIds: readonly string[] } + | { readonly kind: "anonymous" } + +export type DenyCode = + | "DENY_ANONYMOUS" + | "DENY_NO_HOUSEHOLD_PATH" + | "DENY_DRAFT_AUTHOR_ONLY" + | "DENY_ATTRIBUTION_MISMATCH" + +export type Decision = { readonly outcome: "ALLOW" } | { readonly outcome: "DENY"; readonly code: DenyCode; readonly detail: string } + +export type AccessAction = + | { readonly type: "read" } + /** Writes carry the authorId they want attributed; it is bound to the principal. */ + | { readonly type: "write"; readonly asAuthorId: string } + +export interface AccessResource { + readonly householdId: string + readonly entry?: Entry | undefined +} + +const deny = (code: DenyCode, detail: string): Decision => ({ outcome: "DENY", code, detail }) + +/** Single entry point for every household/visibility decision (fail-closed). */ +export function decide(principal: Principal, action: AccessAction, resource: AccessResource): Decision { + // 1. Authentication edge — known members only, no anonymous access. + if (principal.kind === "anonymous") { + return deny("DENY_ANONYMOUS", "unauthenticated principals have no household path (known members only)") + } + // 2. Household-membership boundary — the primary tenancy line. + if (!principal.householdIds.includes(resource.householdId)) { + return deny("DENY_NO_HOUSEHOLD_PATH", `member ${principal.memberId} is not a member of household ${resource.householdId}`) + } + // 3. Publication-state boundary — drafts (and their proposals) are author-only. + if (resource.entry !== undefined && resource.entry.visibility === "draft" && resource.entry.authorId !== principal.memberId) { + return deny("DENY_DRAFT_AUTHOR_ONLY", `entry is draft and authored by ${resource.entry.authorId}`) + } + // 4. Attribution integrity — writes may only attribute to the authenticated principal. + if (action.type === "write" && action.asAuthorId !== principal.memberId) { + return deny("DENY_ATTRIBUTION_MISMATCH", `write claims authorId=${action.asAuthorId} but principal is ${principal.memberId}`) + } + return { outcome: "ALLOW" } +} + +/** + * Does this member see an entry with the given (candidate-level) audience? + * Audience is a relationship-grant resolution: parents see everything in the + * household; caregivers see family-audience records only. + */ +export function canSeeAudience(role: MemberRole, audience: "family" | "parents-only"): boolean { + return role === "parent" || audience === "family" +} diff --git a/apps/home-a/src/journal/store.ts b/apps/home-a/src/journal/store.ts new file mode 100644 index 0000000..267b9d3 --- /dev/null +++ b/apps/home-a/src/journal/store.ts @@ -0,0 +1,835 @@ +/** + * In-memory fixture store for the conversation-first parent home — candidate + * scope. Mirrors the Convex adapter semantics without live Convex (allowed for + * the prototype) while preserving the product trust rules: + * + * - raw-before-events: the entry row (verbatim transcript) persists BEFORE any + * extraction result is applied; extraction failure never blocks capture; + * - captureId idempotency: duplicate submissions with the same captureId are + * replays — the existing entry is returned, nothing new is persisted; + * - extraction envelope: results carry { captureId, attempt }; stale results + * (superseded attempts) are discarded, never merged; applying the same + * attempt twice is a no-op; + * - authorized writes go through reviewable proposals and produce receipts; + * - post-publish corrections are append-only lineage — the original event is + * preserved, never silently mutated; + * - questions (ask/catchUp/monthView) are strictly read-only and cite sources; + * - fail-closed authorization: non-members see nothing; drafts are + * author-only; caregivers see family-audience records only. + * + * All journal data decodes/encodes through the canonical @journal/domain + * Effect schemas (EntrySchema/EventSchema/ChildSchema) — no second domain + * model. Candidate-level lifecycle state (proposals, corrections, receipts, + * audience) is deliberately kept OUT of the domain schemas; final audience + * modeling belongs to slot 20. + */ +import { Schema } from "effect" +import { ChildSchema, EntrySchema, EventSchema, CaptureId, deriveExtractionStatus, type Child, type Entry, type Event, type EventCategory, type ProducedBy } from "@journal/domain" + +import { runExtraction, type ExtractionOutcome, type UnstructuredClause } from "../capture/extraction" +import { canSeeAudience, decide, type Decision, type DenyCode, type MemberRole, type Principal } from "./access" + +export type Audience = "family" | "parents-only" +export type CaptureChannel = "text" | "voice-simulated" + +/** Lifecycle patch for a decoded Entry — applied via `withEntry` (re-decode). */ +interface EntryLifecyclePatch { + readonly extractionStatus?: Entry["extractionStatus"] + readonly visibility?: Entry["visibility"] + readonly structuredEventIds?: readonly string[] +} + +export interface Member { + readonly memberId: string + readonly displayName: string + readonly role: MemberRole + /** Caregivers arrive by explicit invitation; the alias is how they sign notes. */ + readonly alias: string | undefined + /** Set ONLY by markCaughtUp (an explicit member action) — never by answering. */ + lastCheckedAt: number | null +} + +export interface HouseholdSeed { + readonly householdId: string + readonly householdName: string + readonly timezone: string + readonly members: readonly Member[] + readonly children: readonly ChildRef[] +} + +export interface ChildRef { + readonly childId: string + readonly name: string + readonly aliases: readonly string[] +} + +/** A reviewable proposed event, editable before publish. Carries the canonical + * `producedBy` lineage from the extraction run that proposed it. */ +export interface ProposalRecord { + readonly proposalId: string + readonly entryId: string + readonly captureId: string + readonly attempt: number + category: EventCategory + childId: string + timestamp: number + payload: Readonly> | undefined + audience: Audience + readonly confidence: number + readonly sourceClause: string + readonly producedBy: ProducedBy | undefined +} + +/** Reviewer edits applied to a proposal before publish (or a correction after). */ +export interface EventEdit { + readonly category?: EventCategory + readonly childId?: string + readonly timestamp?: number + readonly payload?: Readonly> + readonly audience?: Audience +} + +/** Per-event provenance: which run produced it, from what source text. */ +export interface EventProvenance { + readonly eventId: string + readonly entryId: string + readonly captureId: string + readonly attempt: number + readonly sourceClause: string + readonly proposedCategory: EventCategory + readonly editedFields: readonly string[] +} + +/** Append-only correction lineage. `before` is preserved, never mutated. */ +export interface CorrectionRecord { + readonly correctionId: string + readonly eventId: string + readonly entryId: string + readonly before: Event + readonly after: Event + readonly reason: string + readonly authorId: string + readonly at: number +} + +export type ReceiptKind = "publish" | "correction" | "caught-up" + +export interface Receipt { + readonly receiptId: string + readonly kind: ReceiptKind + readonly at: number + readonly authorId: string + readonly summary: string + readonly entryId: string | undefined + readonly eventIds: readonly string[] +} + +export interface Citation { + readonly entryId: string + readonly eventId: string | undefined + readonly excerpt: string + readonly authorId: string + readonly createdAt: number +} + +export type Answer = + | { readonly kind: "summary"; readonly text: string; readonly citations: readonly Citation[] } + | { readonly kind: "no-matches"; readonly text: string; readonly citations: readonly Citation[] } + | { readonly kind: "denied"; readonly code: DenyCode; readonly detail: string } + +export interface CaptureInput { + readonly captureId: string + readonly transcript: string + readonly authorId: string + readonly capturedAt: number + readonly channel: CaptureChannel + readonly photoId?: string +} + +export type CaptureOutcome = + | { readonly kind: "captured"; readonly entryId: string; readonly entry: Entry; readonly proposals: readonly ProposalRecord[]; readonly unstructured: readonly UnstructuredClause[] } + | { readonly kind: "replayed"; readonly entryId: string; readonly entry: Entry; readonly proposals: readonly ProposalRecord[] } + | { readonly kind: "rejected"; readonly reason: string } + | { readonly kind: "denied"; readonly code: DenyCode; readonly detail: string } + +export interface PublishInput { + readonly entryId: string + /** One edit per proposalId; omit a field to keep the proposed value. */ + readonly edits: ReadonlyMap + readonly audience?: Audience + readonly at: number +} + +export type PublishOutcome = + | { readonly kind: "published"; readonly entry: Entry; readonly eventIds: readonly string[]; readonly receipt: Receipt } + | { readonly kind: "denied"; readonly code: DenyCode; readonly detail: string } + | { readonly kind: "failed"; readonly reason: string } + +export interface CorrectInput { + readonly eventId: string + readonly changes: EventEdit + readonly reason: string + readonly authorId: string + readonly at: number +} + +export type CorrectOutcome = + | { readonly kind: "corrected"; readonly record: CorrectionRecord; readonly receipt: Receipt } + | { readonly kind: "denied"; readonly code: DenyCode; readonly detail: string } + +export interface ApplyExtractionOutcome { + readonly applied: boolean + readonly reason: "applied" | "stale-suppressed" | "idempotent-no-op" | "unknown-capture" +} + +export interface JournalStoreState { + readonly householdId: string + readonly entries: readonly Entry[] + readonly events: readonly { readonly eventId: string; readonly event: Event; readonly audience: Audience }[] + readonly proposals: readonly ProposalRecord[] + readonly corrections: readonly CorrectionRecord[] + readonly receipts: readonly Receipt[] + /** Monotonic count of mutations — the no-write guarantee's tripwire. */ + readonly writeCount: number +} + +let sequence = 0 +const nextId = (prefix: string): string => { + sequence += 1 + return `${prefix}_${String(sequence).padStart(4, "0")}` +} + +/** Decode event values through the canonical Event schema — the only write path. */ +const decodeEvent = (value: unknown): Event => Schema.decodeUnknownSync(EventSchema)(value) + +const EXCERPT_LENGTH = 96 + +/** Pure helper: human-facing excerpt of the raw transcript for citations. */ +export function excerptOf(transcript: string): string { + const flat = transcript.replace(/\s+/g, " ").trim() + return flat.length <= EXCERPT_LENGTH ? flat : `${flat.slice(0, EXCERPT_LENGTH - 1)}…` +} + +export class UnknownRecordError extends Error {} + +export class JournalStore { + private readonly householdId: string + private readonly householdName: string + private readonly timezoneId: string + private readonly members: Map + private readonly children: readonly ChildRef[] + private readonly entries: Entry[] = [] + private readonly entryAudience: Map = new Map() + private readonly events: Map = new Map() + private readonly eventAudience: Map = new Map() + private readonly eventOrder: string[] = [] + private readonly proposals: ProposalRecord[] = [] + private readonly corrections: CorrectionRecord[] = [] + private readonly provenance: Map = new Map() + private readonly receipts: Receipt[] = [] + /** captureId → applied state (raw-before-events + envelope semantics). */ + private readonly captures: Map = new Map() + private writeCounter = 0 + + constructor(seed: HouseholdSeed) { + this.householdId = seed.householdId + this.householdName = seed.householdName + this.timezoneId = seed.timezone + this.members = new Map(seed.members.map((member) => [member.memberId, member])) + this.children = seed.children + } + + get household(): string { + return this.householdName + } + + get childrenRoster(): readonly ChildRef[] { + return this.children + } + + get timezone(): string { + return this.timezoneId + } + + get writeCount(): number { + return this.writeCounter + } + + member(memberId: string): Member | undefined { + return this.members.get(memberId) + } + + entry(entryId: string): Entry | undefined { + return this.entries.find((entry) => this.identityOf(entry) === entryId) + } + + // Entry rows are stored decoded; identity is the Convex-style `_id` field we + // attach at creation time (candidate store level — the flat model has no + // separate captures table). + private entryIds: Map = new Map() + private identityOf(entry: Entry): string { + return this.entryIds.get(entry) ?? "" + } + + /** Lifecycle transition: decode a NEW entry with the patch (canonical fields + * are readonly — mutation means re-decoding a fresh value). */ + private withEntry(entry: Entry, patch: EntryLifecyclePatch): Entry { + const entryId = this.identityOf(entry) + const next = Schema.decodeUnknownSync(EntrySchema)({ ...entry, ...patch }) + const index = this.entries.indexOf(entry) + if (index >= 0) this.entries[index] = next + this.entryIds.delete(entry) + this.entryIds.set(next, entryId) + return next + } + + event(eventId: string): Event | undefined { + return this.events.get(eventId) + } + + provenanceFor(eventId: string): EventProvenance | undefined { + return this.provenance.get(eventId) + } + + correctionHistory(eventId: string): readonly CorrectionRecord[] { + return this.corrections.filter((record) => record.eventId === eventId) + } + + proposalsFor(entryId: string): readonly ProposalRecord[] { + return this.proposals.filter((proposal) => proposal.entryId === entryId) + } + + receiptLog(): readonly Receipt[] { + return this.receipts + } + + // ---------------------------------------------------------------- capture + + /** + * The capture path for BOTH text and simulated-voice input — one pipeline. + * Raw-before-events: the entry (verbatim transcript) persists before any + * extraction runs, and extraction output never blocks capture. + */ + capture(principal: Principal, input: CaptureInput): CaptureOutcome { + const decision = decide(principal, { type: "write", asAuthorId: input.authorId }, { householdId: this.householdId }) + if (decision.outcome === "DENY") return { kind: "denied", code: decision.code, detail: decision.detail } + + // Raw-input policy: empty transcripts are refused BEFORE any persistence. + if (input.transcript.trim().length === 0) { + return { kind: "rejected", reason: "empty transcript" } + } + + // captureId idempotency: duplicate submission replays the existing capture. + // The canonical CaptureId brand (contract v0.3) validates the session id. + const brandedCaptureId = Schema.decodeUnknownSync(CaptureId)(input.captureId) + const existing = this.captures.get(input.captureId) + if (existing !== undefined) { + const entry = this.entry(existing.entryId) + if (entry === undefined) throw new UnknownRecordError(`capture ${input.captureId} points at a missing entry`) + return { kind: "replayed", entryId: existing.entryId, entry, proposals: this.proposalsFor(existing.entryId) } + } + + // Primary child: the first child named in the transcript, else the default. + // Events carry their own childId, so mixed-child utterances stay correct. + const primaryChildId = this.firstMentionedChild(input.transcript) ?? this.children[0]?.childId ?? "" + const entryValue = { + householdId: this.householdId, + childId: primaryChildId, + authorId: input.authorId, + rawTranscript: input.transcript, // verbatim — never trimmed, never normalized + structuredEventIds: [], + extractionStatus: "pending" as const, + visibility: "draft" as const, + ...(input.photoId === undefined ? {} : { photoId: input.photoId }), + createdAt: input.capturedAt, + } + const entry: Entry = Schema.decodeUnknownSync(EntrySchema)(entryValue) + + // RAW FIRST: the entry exists before any extraction result is applied. + this.entries.push(entry) + this.entryIds.set(entry, nextId("en")) + this.entryAudience.set(this.identityOf(entry), "family") + this.writeCounter += 1 + + const attemptRecordId = nextId("atn") + const outcome = runExtraction({ + captureId: brandedCaptureId, + attempt: 0, + transcript: input.transcript, + capturedAt: input.capturedAt, + householdId: this.householdId, + childIds: this.children.map((child) => child.childId), + childNames: this.children.map((child) => ({ name: child.name, aliases: child.aliases })), + defaultChildId: primaryChildId, + attemptRecordId, + }) + + const records = outcome.events.map((event, index) => ({ + proposalId: nextId("prop"), + entryId: this.identityOf(entry), + captureId: brandedCaptureId, + attempt: 0, + category: event.category, + childId: event.childId, + timestamp: event.timestamp, + payload: event.payload === undefined ? undefined : { ...event.payload }, + audience: "family" as const, + confidence: event.confidence, + sourceClause: outcome.sourceClauses[index] ?? input.transcript, + producedBy: event.producedBy, + })) + this.proposals.push(...records) + this.unstructuredByEntry.set(this.identityOf(entry), [...outcome.unstructured]) + this.captures.set(input.captureId, { entryId: this.identityOf(entry), latestAttempt: 0 }) + // Canonical derivation (contract v0.3): the latest succeeded attempt reads + // as "structured" — the entry status is the materialized read-model. + const structuredEntry = this.withEntry(entry, { extractionStatus: deriveExtractionStatus({ outcome: "succeeded" }) }) + + return { kind: "captured", entryId: this.identityOf(structuredEntry), entry: structuredEntry, proposals: records, unstructured: outcome.unstructured } + } + + /** + * Apply a late extraction result under the canonical envelope rules: stale + * results (attempt < latest) are discarded, never merged; re-applying the + * latest attempt is a no-op. Takes the full double outcome (events aligned + * with sourceClauses) so late results keep citation fidelity. + */ + applyExtractionResult(captureId: string, attempt: number, result: ExtractionOutcome): ApplyExtractionOutcome { + const applied = this.captures.get(captureId) + if (applied === undefined) return { applied: false, reason: "unknown-capture" } + if (attempt < applied.latestAttempt) return { applied: false, reason: "stale-suppressed" } + if (attempt === applied.latestAttempt) return { applied: false, reason: "idempotent-no-op" } + + this.proposals.push( + ...result.events.map((event, index) => ({ + proposalId: nextId("prop"), + entryId: applied.entryId, + captureId, + attempt, + category: event.category, + childId: event.childId, + timestamp: event.timestamp, + payload: event.payload === undefined ? undefined : { ...event.payload }, + audience: "family" as const, + confidence: event.confidence, + sourceClause: result.sourceClauses[index] ?? "", + producedBy: event.producedBy, + })), + ) + this.captures.set(captureId, { entryId: applied.entryId, latestAttempt: attempt }) + return { applied: true, reason: "applied" } + } + + // ---------------------------------------------------------------- publish + + /** Publish reviewed proposals: typed events (confidence 1, caregiver-confirmed). */ + publish(principal: Principal, input: PublishInput): PublishOutcome { + let entry = this.entry(input.entryId) + if (entry === undefined) return { kind: "failed", reason: `unknown entry ${input.entryId}` } + const decision = decide(principal, { type: "write", asAuthorId: principal.kind === "member" ? principal.memberId : "" }, { householdId: this.householdId, entry }) + if (decision.outcome === "DENY") return { kind: "denied", code: decision.code, detail: decision.detail } + if (entry.authorId !== (principal.kind === "member" ? principal.memberId : "")) { + return { kind: "denied", code: "DENY_DRAFT_AUTHOR_ONLY", detail: "only the author publishes a draft entry" } + } + + const entryId = this.identityOf(entry) + const proposals = this.proposalsFor(entryId) + if (proposals.length === 0 && entry.rawTranscript.trim().length > 0 && this.unstructuredFor(entryId).length === 0) { + // A capture with zero proposals publishes as a raw-only entry — allowed. + entry = this.withEntry(entry, { visibility: "published" }) + const receipt: Receipt = { + receiptId: nextId("rc"), + kind: "publish", + at: input.at, + authorId: entry.authorId, + summary: "Published raw-only entry (nothing to structure) — raw transcript preserved verbatim.", + entryId, + eventIds: [], + } + this.receipts.push(receipt) + this.writeCounter += 1 + return { kind: "published", entry, eventIds: [], receipt } + } + + const eventIds: string[] = [] + const defaultAudience: Audience = input.audience ?? "family" + for (const proposal of proposals) { + const edit = input.edits.get(proposal.proposalId) + const editedFields: string[] = [] + if (edit !== undefined) { + if (edit.category !== undefined && edit.category !== proposal.category) editedFields.push("type") + if (edit.childId !== undefined && edit.childId !== proposal.childId) editedFields.push("child") + if (edit.timestamp !== undefined && edit.timestamp !== proposal.timestamp) editedFields.push("time") + if (edit.payload !== undefined && JSON.stringify(edit.payload) !== JSON.stringify(proposal.payload)) editedFields.push("amount") + if (edit.audience !== undefined && edit.audience !== proposal.audience) editedFields.push("audience") + proposal.category = edit.category ?? proposal.category + proposal.childId = edit.childId ?? proposal.childId + proposal.timestamp = edit.timestamp ?? proposal.timestamp + proposal.payload = edit.payload ?? proposal.payload + proposal.audience = edit.audience ?? proposal.audience + } else { + proposal.audience = defaultAudience + } + const eventId = nextId("ev") + const event = decodeEvent({ + householdId: this.householdId, + childId: proposal.childId, + category: proposal.category, + timestamp: proposal.timestamp, + ...(proposal.payload === undefined ? {} : { payload: { ...proposal.payload } }), + confidence: 1, // caregiver-confirmed at publish + ...(proposal.producedBy === undefined ? {} : { producedBy: proposal.producedBy }), + }) + this.events.set(eventId, event) + this.eventAudience.set(eventId, proposal.audience) + this.eventOrder.push(eventId) + eventIds.push(eventId) + this.provenance.set(eventId, { + eventId, + entryId, + captureId: proposal.captureId, + attempt: proposal.attempt, + sourceClause: proposal.sourceClause, + proposedCategory: proposal.category, + editedFields, + }) + } + + entry = this.withEntry(entry, { structuredEventIds: [...eventIds], visibility: "published" }) + this.entryAudience.set(entryId, input.audience ?? "family") + const receipt: Receipt = { + receiptId: nextId("rc"), + kind: "publish", + at: input.at, + authorId: entry.authorId, + summary: `Published ${eventIds.length} event${eventIds.length === 1 ? "" : "s"} — raw transcript preserved verbatim.`, + entryId, + eventIds, + } + this.receipts.push(receipt) + this.writeCounter += 1 + return { kind: "published", entry, eventIds, receipt } + } + + private unstructuredFor(entryId: string): readonly UnstructuredClause[] { + // Unstructured clauses are re-derivable from the raw transcript; the store + // only needs to know whether extraction found any. + return this.unstructuredByEntry.get(entryId) ?? [] + } + + private readonly unstructuredByEntry: Map = new Map() + + // -------------------------------------------------------------- correcting + + /** + * Post-publish correction, conversationally requested. Append-only lineage: + * the original event is preserved inside the correction record; the store's + * current version is replaced by the corrected one, and the chain stays + * fully inspectable. + */ + correct(principal: Principal, input: CorrectInput): CorrectOutcome { + const event = this.events.get(input.eventId) + if (event === undefined) throw new UnknownRecordError(`unknown event ${input.eventId}`) + const entry = this.entry(this.provenance.get(input.eventId)?.entryId ?? "") + const decision = decide( + principal, + { type: "write", asAuthorId: input.authorId }, + { householdId: this.householdId, entry }, + ) + if (decision.outcome === "DENY") return { kind: "denied", code: decision.code, detail: decision.detail } + + // Caregiver-role members may only correct records their grants can see. + if (principal.kind === "member" && !canSeeAudience(principal.role, this.eventAudience.get(input.eventId) ?? "family")) { + return { kind: "denied", code: "DENY_NO_HOUSEHOLD_PATH", detail: "audience grant does not cover this record" } + } + + const before = event + const changes = input.changes + // Build the corrected value omitting absent keys — the canonical + // optionalKey contract rejects EXPLICIT undefined. + const payload = changes.payload === undefined ? before.payload : { ...changes.payload } + const after = decodeEvent({ + householdId: before.householdId, + childId: changes.childId ?? before.childId, + category: changes.category ?? before.category, + timestamp: changes.timestamp ?? before.timestamp, + ...(payload === undefined ? {} : { payload }), + confidence: before.confidence, + ...(before.producedBy === undefined ? {} : { producedBy: before.producedBy }), + }) + const priorChain = this.correctionHistory(input.eventId) + const record: CorrectionRecord = { + correctionId: nextId("cor"), + eventId: input.eventId, + entryId: this.provenance.get(input.eventId)?.entryId ?? "", + before, + after, + reason: input.reason, + authorId: input.authorId, + at: input.at, + } + this.corrections.push(record) + this.events.set(input.eventId, after) + const receipt: Receipt = { + receiptId: nextId("rc"), + kind: "correction", + at: input.at, + authorId: input.authorId, + summary: priorChain.length === 0 + ? `Corrected event ${input.eventId} — original preserved in lineage.` + : `Corrected event ${input.eventId} again — full lineage preserved (${priorChain.length + 1} corrections).`, + entryId: record.entryId, + eventIds: [input.eventId], + } + this.receipts.push(receipt) + this.writeCounter += 1 + return { kind: "corrected", record, receipt } + } + + // ------------------------------------------------------------- read-only + + /** Entries this principal may see (fail-closed: non-members see nothing). */ + visibleEntries(principal: Principal): readonly { readonly entryId: string; readonly entry: Entry; readonly audience: Audience }[] { + return this.entries + .filter((entry) => { + const decision = decide(principal, { type: "read" }, { householdId: this.householdId, entry }) + if (decision.outcome === "DENY") return false + const audience = this.entryAudience.get(this.identityOf(entry)) ?? "family" + return principal.kind === "member" ? canSeeAudience(principal.role, audience) : false + }) + .map((entry) => ({ entryId: this.identityOf(entry), entry, audience: this.entryAudience.get(this.identityOf(entry)) ?? "family" })) + .sort((a, b) => a.entry.createdAt - b.entry.createdAt) + } + + /** Current (latest-correction) events of an entry, filtered by audience. */ + visibleEvents(principal: Principal, entryId: string): readonly { readonly eventId: string; readonly event: Event; readonly audience: Audience }[] { + const entry = this.entry(entryId) + if (entry === undefined) return [] + const entryDecision = decide(principal, { type: "read" }, { householdId: this.householdId, entry }) + if (entryDecision.outcome === "DENY") return [] + return this.eventOrder + .filter((eventId) => this.provenance.get(eventId)?.entryId === entryId) + .map((eventId) => ({ + eventId, + event: this.events.get(eventId) as Event, + audience: this.eventAudience.get(eventId) ?? "family", + })) + .filter(({ audience }) => principal.kind === "member" ? canSeeAudience(principal.role, audience) : false) + } + + /** + * Read-only question answering. PURE over store state — this method does not + * touch any mutable field (enforced by tests via the write tripwire). + */ + ask(principal: Principal, question: string, at: number): Answer { + const decision = decide(principal, { type: "read" }, { householdId: this.householdId }) + if (decision.outcome === "DENY") return { kind: "denied", code: decision.code, detail: decision.detail } + if (principal.kind !== "member") return { kind: "denied", code: "DENY_ANONYMOUS", detail: "questions need a member principal" } + + const topic = this.parseTopic(question) + const range = this.parseRange(question, at) + const childFilter = this.parseChild(question) + + const rows: { eventId: string; event: Event; entryId: string; entry: Entry }[] = [] + for (const { entryId, entry } of this.visibleEntries(principal)) { + for (const { eventId, event } of this.visibleEvents(principal, entryId)) { + rows.push({ eventId, event, entryId, entry }) + } + } + const matches = rows + .filter(({ event }) => event.category === topic) + .filter(({ event }) => event.timestamp >= range.from && event.timestamp <= range.to) + .filter(({ event }) => childFilter === undefined || event.childId === childFilter) + .sort((a, b) => a.event.timestamp - b.event.timestamp) + + if (matches.length === 0) { + return { + kind: "no-matches", + text: `I found no ${topic} records in that window${childFilter === undefined ? "" : ` for ${this.childName(childFilter)}`} — that's an empty result, not an error.`, + citations: [], + } + } + + const citations: Citation[] = matches.map(({ eventId, event, entryId, entry }) => ({ + entryId, + eventId, + excerpt: excerptOf(this.clauseFor(entry, event)), + authorId: entry.authorId, + createdAt: entry.createdAt, + })) + + let detail: string + if (topic === "sleep" && matches.some(({ event }) => (event.payload?.["minutes"] ?? 0) > 0)) { + const durations = matches.map(({ event }) => event.payload?.["minutes"]).filter((value): value is number => value !== undefined) + const total = durations.reduce((sum, value) => sum + value, 0) + detail = `${matches.length} ${topic} records${childFilter === undefined ? "" : ` for ${this.childName(childFilter)}`} in the window — recorded durations sum to ${total} minutes.` + } else { + detail = `${matches.length} ${topic} record${matches.length === 1 ? "" : "s"}${childFilter === undefined ? "" : ` for ${this.childName(childFilter)}`} in the window.` + } + return { kind: "summary", text: detail, citations } + } + + /** + * Conversational catch-up digest — read-only. Computes from the member's + * lastCheckedAt WITHOUT updating it; marking caught up is a separate, + * explicit write (markCaughtUp). + */ + catchUp(principal: Principal, at: number): Answer { + const decision = decide(principal, { type: "read" }, { householdId: this.householdId }) + if (decision.outcome === "DENY") return { kind: "denied", code: decision.code, detail: decision.detail } + if (principal.kind !== "member") return { kind: "denied", code: "DENY_ANONYMOUS", detail: "catch-up needs a member principal" } + + const member = this.members.get(principal.memberId) + if (member === undefined) return { kind: "denied", code: "DENY_NO_HOUSEHOLD_PATH", detail: "unknown member" } + const from = member.lastCheckedAt ?? at - 30 * 86_400_000 + + const lines: string[] = [] + const citations: Citation[] = [] + for (const { entryId, entry } of this.visibleEntries(principal)) { + if (entry.createdAt <= from) continue + const events = this.visibleEvents(principal, entryId) + const rendered = events.length === 0 + ? `raw note (${excerptOf(entry.rawTranscript)})` + : events.map(({ event }) => `${this.childName(event.childId)} ${event.category}${event.payload?.["minutes"] !== undefined ? ` ${event.payload["minutes"]} min` : ""}`).join("; ") + lines.push(`Sep ${this.localDay(entry.createdAt)} — ${memberLabel(entry.authorId, this.members)}: ${rendered}`) + for (const { eventId, event } of events) { + citations.push({ entryId, eventId, excerpt: excerptOf(this.clauseFor(entry, event)), authorId: entry.authorId, createdAt: entry.createdAt }) + } + } + if (lines.length === 0) { + return { kind: "no-matches", text: "Nothing new since your last check-in.", citations: [] } + } + const sinceLabel = member.lastCheckedAt === null ? "the start of the month" : `Sep ${this.localDay(member.lastCheckedAt)}` + return { kind: "summary", text: `Here's what happened since ${sinceLabel}:\n${lines.join("\n")}`, citations } + } + + /** Month view — read-only listing of a month's visible records. */ + monthView(principal: Principal, monthKey: string): Answer { + const decision = decide(principal, { type: "read" }, { householdId: this.householdId }) + if (decision.outcome === "DENY") return { kind: "denied", code: decision.code, detail: decision.detail } + + const lines: string[] = [] + const citations: Citation[] = [] + for (const { entryId, entry } of this.visibleEntries(principal)) { + if (new Date(entry.createdAt + this.offsetMinutes() * 60_000).toISOString().slice(0, 7) !== monthKey) continue + const events = this.visibleEvents(principal, entryId) + lines.push(`Sep ${this.localDay(entry.createdAt)} — ${memberLabel(entry.authorId, this.members)}: ${excerptOf(entry.rawTranscript)}${events.length > 0 ? ` [${events.length} event${events.length === 1 ? "" : "s"}]` : ""}`) + for (const { eventId, event } of events) { + citations.push({ entryId, eventId, excerpt: excerptOf(this.clauseFor(entry, event)), authorId: entry.authorId, createdAt: entry.createdAt }) + } + } + if (lines.length === 0) return { kind: "no-matches", text: `No records for ${monthKey} (or none you can see).`, citations } + return { kind: "summary", text: `${monthKey} — ${lines.length} entries:\n${lines.join("\n")}`, citations } + } + + /** The ONLY write in the catch-up flow — explicit member action, with a receipt. */ + markCaughtUp(principal: Principal, at: number): { readonly kind: "marked"; readonly receipt: Receipt } | { readonly kind: "denied"; readonly code: DenyCode; readonly detail: string } { + const decision = decide(principal, { type: "read" }, { householdId: this.householdId }) + if (decision.outcome === "DENY" || principal.kind !== "member") { + return { kind: "denied", code: "DENY_ANONYMOUS", detail: "marking caught-up needs a member principal" } + } + const member = this.members.get(principal.memberId) + if (member === undefined) return { kind: "denied", code: "DENY_NO_HOUSEHOLD_PATH", detail: "unknown member" } + member.lastCheckedAt = at + const receipt: Receipt = { + receiptId: nextId("rc"), + kind: "caught-up", + at, + authorId: principal.memberId, + summary: `${member.displayName} is caught up through now.`, + entryId: undefined, + eventIds: [], + } + this.receipts.push(receipt) + this.writeCounter += 1 + return { kind: "marked", receipt } + } + + /** Immutable state snapshot for tests and UI rendering. */ + snapshot(): JournalStoreState { + return { + householdId: this.householdId, + entries: [...this.entries], + events: this.eventOrder.map((eventId) => ({ eventId, event: this.events.get(eventId) as Event, audience: this.eventAudience.get(eventId) ?? "family" })), + proposals: [...this.proposals], + corrections: [...this.corrections], + receipts: [...this.receipts], + writeCount: this.writeCounter, + } + } + + // --------------------------------------------------------------- helpers + + private firstMentionedChild(transcript: string): string | undefined { + for (const child of this.children) { + const names = [child.name, ...child.aliases] + if (names.some((name) => new RegExp(`\\b${escapeRegExpSource(name)}\\b`, "i").test(transcript))) { + return child.childId + } + } + return undefined + } + + private childName(childId: string): string { + return this.children.find((child) => child.childId === childId)?.name ?? childId + } + + private parseTopic(question: string): EventCategory { + if (/\b(naps?|naps|sleep|slept|bedtime)\b/i.test(question)) return "sleep" + if (/\b(meals?|ate|eating|food)\b/i.test(question)) return "meal" + if (/\b(moods?|meltdowns?|temper)\b/i.test(question)) return "mood" + if (/\b(potty|diapers?|poop|pee)\b/i.test(question)) return "potty" + if (/\b(milestones?|firsts?)\b/i.test(question)) return "milestone" + if (/\b(school|pre-?k|classroom)\b/i.test(question)) return "school" + return "meal" + } + + private parseRange(question: string, at: number): { readonly from: number; readonly to: number } { + if (/\btoday\b/i.test(question)) { + const dayStart = Math.floor((at + this.offsetMinutes() * 60_000) / 86_400_000) * 86_400_000 - this.offsetMinutes() * 60_000 + return { from: dayStart, to: dayStart + 86_400_000 - 1 } + } + if (/\bthis month\b/i.test(question)) { + const monthStart = Date.parse(`${new Date(at + this.offsetMinutes() * 60_000).toISOString().slice(0, 7)}-01T00:00:00Z`) - this.offsetMinutes() * 60_000 + return { from: monthStart, to: at } + } + // default window: the last 7 days + return { from: at - 7 * 86_400_000, to: at } + } + + private parseChild(question: string): string | undefined { + return this.firstMentionedChild(question) + } + + private clauseFor(entry: Entry, event: Event): string { + return this.provenance.get(this.eventIdOf(event))?.sourceClause ?? entry.rawTranscript + } + + private eventIdOf(event: Event): string { + for (const [eventId, stored] of this.events) { + if (stored === event) return eventId + } + return "" + } + + private offsetMinutes(): number { + // Demo horizon: the store's timezone resolves through the 2026 map. + // America/New_York (EDT, -4) covers the synthetic dataset. + return this.timezone === "America/New_York" ? -4 : 0 + } + + private localDay(instant: number): number { + return new Date(instant + this.offsetMinutes() * 60_000).getUTCDate() + } +} + +function memberLabel(authorId: string, members: Map): string { + return members.get(authorId)?.displayName ?? authorId +} + +function escapeRegExpSource(text: string): string { + return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") +} + +// Re-export for consumers building seeds. +export type { Child, Decision, DenyCode, Principal, MemberRole } diff --git a/apps/home-a/src/ui/ConversationScreen.tsx b/apps/home-a/src/ui/ConversationScreen.tsx new file mode 100644 index 0000000..83c5383 --- /dev/null +++ b/apps/home-a/src/ui/ConversationScreen.tsx @@ -0,0 +1,127 @@ +/** + * The conversation surface: capture (typed + simulated-voice chips), in-thread + * review/publish, corrections, catch-up, month view, and read-only questions + * all live in ONE scrolling thread. + */ +import { useCallback, useState, useSyncExternalStore } from "react" +import { Pressable, ScrollView, StyleSheet, Text, TextInput, View } from "react-native" + +import type { EventEdit } from "../journal/store" +import type { ConversationController } from "../conversation/controller" +import { DEMO_QUESTIONS, DEMO_UTTERANCES } from "../fixtures/demoUtterances" +import { colors, radius, spacing } from "./theme" +import { TurnRow } from "./TurnRow" + +interface Props { + readonly controller: ConversationController + readonly displayName: string + readonly onSignOut: () => void +} + +export function ConversationScreen({ controller, displayName, onSignOut }: Props) { + useSyncExternalStore(controller.subscribe, controller.getVersion) + const [draft, setDraft] = useState("") + + const send = useCallback(() => { + const text = draft.trim() + if (text.length === 0) return + controller.sendText(text) + setDraft("") + }, [controller, draft]) + + const children_ = controller.childrenRoster.map((child) => ({ childId: child.childId, name: child.name })) + const turns = controller.getTurns() + + return ( + + + + The Journal + Polanco Household · signed in as {displayName} + + + switch profile + + + + + September 2026 · synthetic history seeded + {turns.map((turn) => ( + { + const event = controller.eventFor(eventId) + if (event === undefined) return eventId + const child = children_.find((option) => option.childId === event.childId) + const minutes = event.payload?.["minutes"] + return `${child?.name ?? event.childId} · ${event.category} · ${new Date(event.timestamp).toISOString()}${minutes !== undefined ? ` · ${minutes} min` : ""}` + }} + onPublish={controller.publish} + onCorrect={controller.correct} + /> + ))} + + + + voice demo (simulated transcription → same pipeline): + + {DEMO_UTTERANCES.map((utterance) => ( + controller.sendVoiceDemo(utterance)}> + 🎙 {utterance.length > 42 ? `${utterance.slice(0, 42)}…` : utterance} + + ))} + + read-only questions (never write): + + {DEMO_QUESTIONS.map((question) => ( + controller.ask(question)}> + {question} + + ))} + controller.catchUp()}> + ✨ Catch me up since last time + + controller.monthView()}> + 📅 September view + + controller.markCaughtUp()}> + Mark caught up + + + + + + + + Send + + + + ) +} + +const styles = StyleSheet.create({ + root: { flex: 1, backgroundColor: colors.bg }, + header: { flexDirection: "row", alignItems: "center", paddingTop: spacing(14), paddingBottom: spacing(2), paddingHorizontal: spacing(3), backgroundColor: colors.card, borderBottomWidth: 1, borderBottomColor: colors.border }, + headerTitle: { fontSize: 18, fontWeight: "700", color: colors.ink }, + headerSub: { fontSize: 12, color: colors.sub, marginTop: 2 }, + signOut: { paddingHorizontal: spacing(2), paddingVertical: spacing(1) }, + thread: { flex: 1 }, + threadContent: { paddingVertical: spacing(3), paddingBottom: spacing(6) }, + dayMarker: { alignSelf: "center", color: colors.sub, fontSize: 11, marginBottom: spacing(2) }, + chipsBox: { paddingHorizontal: spacing(2), paddingTop: spacing(1), borderTopWidth: 1, borderTopColor: colors.border, backgroundColor: colors.card, gap: spacing(1) }, + chipsLabel: { fontSize: 10, color: colors.sub, textTransform: "uppercase", letterSpacing: 0.5 }, + chip: { borderRadius: 999, borderWidth: 1, borderColor: colors.border, backgroundColor: colors.chip, paddingHorizontal: spacing(2.5), paddingVertical: spacing(1.5) }, + chipText: { color: colors.ink, fontSize: 12 }, + composer: { flexDirection: "row", alignItems: "flex-end", padding: spacing(2), backgroundColor: colors.card, gap: spacing(2) }, + input: { flex: 1, borderWidth: 1, borderColor: colors.border, borderRadius: radius, paddingHorizontal: spacing(2), paddingVertical: spacing(1.5), color: colors.ink, minHeight: 40, backgroundColor: "#FFFFFF" }, + send: { backgroundColor: colors.accent, borderRadius: radius, paddingVertical: spacing(2), paddingHorizontal: spacing(3) }, +}) diff --git a/apps/home-a/src/ui/ProposalCard.tsx b/apps/home-a/src/ui/ProposalCard.tsx new file mode 100644 index 0000000..a6acb4f --- /dev/null +++ b/apps/home-a/src/ui/ProposalCard.tsx @@ -0,0 +1,146 @@ +/** + * In-thread review card for one proposed event — editable before publish + * (type, child, time, amount, audience). Edits live in the parent capture + * view and are applied at publish. + */ +import { useState } from "react" +import { Pressable, StyleSheet, Text, TextInput, View } from "react-native" + +import type { EventCategory } from "@journal/domain" +import type { EventEdit, ProposalRecord } from "../journal/store" +import { colors, radius, spacing } from "./theme" +import { formatDayTime } from "./format" + +const CATEGORIES: readonly EventCategory[] = ["meal", "sleep", "mood", "potty", "milestone", "school"] + +export interface ChildOption { + readonly childId: string + readonly name: string +} + +interface Props { + readonly proposal: ProposalRecord + readonly children_: readonly ChildOption[] + readonly edit: EventEdit | undefined + readonly onChange: (patch: EventEdit) => void +} + +/** Local EDT wall-clock parse against the proposal's day. */ +function parseLocalTime(text: string, reference: number): number | undefined { + const match = text.trim().match(/^(\d{1,2}):(\d{2})$/) + if (match === null) return undefined + const hour = Number.parseInt(match[1] ?? "", 10) + const minute = Number.parseInt(match[2] ?? "", 10) + if (Number.isNaN(hour) || Number.isNaN(minute) || hour > 23 || minute > 59) return undefined + const dayStart = reference - ((reference / 1000) % 86400) * 1000 + return dayStart + (hour + 4) * 3_600_000 + minute * 60_000 +} + +function Chip({ label, active, onPress }: { label: string; active: boolean; onPress: () => void }) { + return ( + + {label} + + ) +} + +export function ProposalCard({ proposal, children_, edit, onChange }: Props) { + const [timeDraft, setTimeDraft] = useState("") + const [amountDraft, setAmountDraft] = useState("") + + const category = edit?.category ?? proposal.category + const childId = edit?.childId ?? proposal.childId + const timestamp = edit?.timestamp ?? proposal.timestamp + const payload = edit?.payload ?? proposal.payload + const audience = edit?.audience ?? proposal.audience + + const minutes = payload?.["minutes"] + const childName = children_.find((child) => child.childId === childId)?.name ?? childId + + return ( + + + Proposed: {category} · {childName} · {formatDayTime(timestamp)} + {minutes !== undefined ? ` · ${minutes} min` : ""} + + + from “{proposal.sourceClause}” · confidence {proposal.confidence.toFixed(2)} · attempt {proposal.attempt} + {proposal.producedBy !== undefined ? ` · ${proposal.producedBy.extractorVersion}` : ""} + + + + {CATEGORIES.map((option) => ( + onChange({ category: option })} /> + ))} + + + {children_.map((child) => ( + onChange({ childId: child.childId })} /> + ))} + + + onChange({ audience: "family" })} /> + onChange({ audience: "parents-only" })} /> + + + + { + setTimeDraft(text) + const parsed = parseLocalTime(text, timestamp) + if (parsed !== undefined) onChange({ timestamp: parsed }) + }} + /> + { + setAmountDraft(text) + const parsed = Number.parseInt(text, 10) + if (!Number.isNaN(parsed) && parsed > 0) onChange({ payload: { minutes: parsed } }) + }} + /> + + + ) +} + +const styles = StyleSheet.create({ + card: { + backgroundColor: colors.card, + borderRadius: radius, + borderWidth: 1, + borderColor: colors.border, + padding: spacing(3), + marginBottom: spacing(2), + }, + title: { color: colors.ink, fontWeight: "600", marginBottom: spacing(1) }, + provenance: { color: colors.sub, fontSize: 11, marginBottom: spacing(2), fontStyle: "italic" }, + rowWrap: { flexDirection: "row", flexWrap: "wrap", gap: spacing(1), marginBottom: spacing(2) }, + row: { flexDirection: "row", gap: spacing(2) }, + chip: { + paddingHorizontal: spacing(2.5), + paddingVertical: spacing(1), + borderRadius: 999, + borderWidth: 1, + borderColor: colors.border, + backgroundColor: colors.chip, + }, + chipText: { color: colors.ink, fontSize: 12 }, + input: { + borderWidth: 1, + borderColor: colors.border, + borderRadius: radius, + paddingHorizontal: spacing(2), + paddingVertical: spacing(1), + minWidth: 110, + color: colors.ink, + }, +}) diff --git a/apps/home-a/src/ui/SignInScreen.tsx b/apps/home-a/src/ui/SignInScreen.tsx new file mode 100644 index 0000000..8db194f --- /dev/null +++ b/apps/home-a/src/ui/SignInScreen.tsx @@ -0,0 +1,47 @@ +/** Known-members-only entry: anonymous and non-member paths are demoable. */ +import { Pressable, ScrollView, StyleSheet, Text, View } from "react-native" + +import { colors, radius, spacing } from "./theme" + +export interface SignInOption { + readonly memberId: string + readonly label: string + readonly role: string + readonly note: string +} + +const OPTIONS: readonly SignInOption[] = [ + { memberId: "mem_dana", label: "Dana Polanco", role: "Mom · parent", note: "full access, parents-only visibility" }, + { memberId: "mem_gilbert", label: "Gilbert Polanco", role: "Dad · parent", note: "full access" }, + { memberId: "mem_rosa", label: "Rosa Marin", role: "Nana Rosa · caregiver", note: "invited; parents-only entries hidden" }, + { memberId: "mem_stranger", label: "Continue without signing in", role: "anonymous / non-member", note: "fail-closed: sees nothing" }, +] + +export function SignInScreen({ onSignIn }: { onSignIn: (memberId: string) => void }) { + return ( + + Shared Child Journal + Parent home — Candidate A “conversation-first” · synthetic data only + + {OPTIONS.map((option) => ( + onSignIn(option.memberId)}> + {option.label} + {option.role} + {option.note} + + ))} + + + ) +} + +const styles = StyleSheet.create({ + root: { flex: 1, backgroundColor: colors.bg, paddingTop: spacing(20), paddingHorizontal: spacing(3) }, + title: { fontSize: 24, fontWeight: "800", color: colors.ink, textAlign: "center" }, + subtitle: { fontSize: 13, color: colors.sub, textAlign: "center", marginTop: spacing(1), marginBottom: spacing(6) }, + list: { gap: spacing(2), paddingBottom: spacing(8) }, + card: { backgroundColor: colors.card, borderRadius: radius, borderWidth: 1, borderColor: colors.border, padding: spacing(3) }, + name: { fontSize: 16, fontWeight: "700", color: colors.ink }, + role: { fontSize: 12, color: colors.accent, marginTop: 2 }, + note: { fontSize: 11, color: colors.sub, marginTop: 2 }, +}) diff --git a/apps/home-a/src/ui/TurnRow.tsx b/apps/home-a/src/ui/TurnRow.tsx new file mode 100644 index 0000000..8d5856f --- /dev/null +++ b/apps/home-a/src/ui/TurnRow.tsx @@ -0,0 +1,216 @@ +/** + * Renders one conversation turn. Capture turns embed the proposal review + * cards; publish receipts embed a correction affordance (append-only). + */ +import { useState } from "react" +import { Pressable, StyleSheet, Text, TextInput, View } from "react-native" + +import type { EventEdit, ProposalRecord, Receipt, CorrectionRecord, Citation } from "../journal/store" +import type { Event } from "@journal/domain" +import type { Turn } from "../conversation/controller" +import { formatDayTime } from "./format" +import { colors, radius, spacing } from "./theme" +import { ProposalCard, type ChildOption } from "./ProposalCard" + +/** Derived summary for a decoded Event (correction before/after lines). */ +function eventSummary(event: Event, options: readonly ChildOption[]): string { + const childName = options.find((option) => option.childId === event.childId)?.name ?? event.childId + const minutes = event.payload?.["minutes"] + return `${childName} · ${event.category} · ${formatDayTime(event.timestamp)}${minutes !== undefined ? ` · ${minutes} min` : ""}` +} + +interface Props { + readonly turn: Turn + readonly children_: readonly ChildOption[] + readonly eventText: (eventId: string) => string + readonly onPublish: (entryId: string, edits: ReadonlyMap) => void + readonly onCorrect: (eventId: string, changes: EventEdit, reason: string) => void +} + +function AnswerCitations({ citations }: { citations: readonly Citation[] }) { + return ( + + {citations.map((citation, index) => ( + + · “{citation.excerpt}” — {citation.authorId}, {formatDayTime(citation.createdAt)} + + ))} + + ) +} + +function CaptureTurnView({ turn, children_, onPublish }: Pick & { turn: Extract }) { + const [edits, setEdits] = useState>(new Map()) + const proposals = turn.proposals + + return ( + + capture · raw preserved first + “{turn.rawTranscript}” + {proposals.length === 0 ? ( + No typed events interpreted — this stays a raw note. + ) : ( + proposals.map((proposal) => ( + setEdits((current) => new Map(current).set(proposal.proposalId, { ...(current.get(proposal.proposalId) ?? {}), ...patch }))} + /> + )) + )} + {turn.unstructured.length > 0 && ( + Kept as note: {turn.unstructured.map((clause) => clause.text).join(" | ")} + )} + onPublish(turn.entryId, edits)}> + Publish ({proposals.length} events + raw) + + + ) +} + +function ReceiptEventRow({ eventId, eventText, onCorrect }: { eventId: string; eventText: (id: string) => string; onCorrect: (eventId: string, changes: EventEdit, reason: string) => void }) { + const [open, setOpen] = useState(false) + const [minutes, setMinutes] = useState("") + const [reason, setReason] = useState("") + const parsed = Number.parseInt(minutes, 10) + + return ( + + {eventText(eventId)} + {open ? ( + + + + { + if (!Number.isNaN(parsed) && parsed > 0 && reason.trim().length > 0) { + onCorrect(eventId, { payload: { minutes: parsed } }, reason.trim()) + setOpen(false) + setMinutes("") + setReason("") + } + }} + > + Append correction + + + ) : ( + setOpen(true)}> + Correct (appends lineage — original stays intact) + + )} + + ) +} + +function ReceiptView({ receipt, eventIds, eventText, onCorrect }: { receipt: Receipt; eventIds: readonly string[]; eventText: (id: string) => string; onCorrect: Props["onCorrect"] }) { + return ( + + publish receipt + {receipt.summary} + {eventIds.map((eventId) => ( + + ))} + + ) +} + +export function TurnRow({ turn, children_, eventText, onPublish, onCorrect }: Props) { + switch (turn.kind) { + case "user": + return ( + + {turn.text} + {turn.channel === "voice-simulated" ? "voice (simulated transcription)" : "typed"} · {formatDayTime(turn.at)} + + ) + case "capture": + return + case "replayed": + return ( + + Duplicate capture — replayed existing draft {turn.entryId} (captureId idempotency). + + ) + case "publish-receipt": + return + case "correction": + return ( + + correction · append-only lineage + before: {eventSummary(turn.record.before, children_)} + after: {eventSummary(turn.record.after, children_)} + reason: “{turn.record.reason}” — original event preserved + + ) + case "answer": + return ( + + answer · read-only, nothing written + {turn.answer.kind === "denied" ? turn.answer.detail : turn.answer.text} + + + ) + case "catchup": + return ( + + catch-up · what happened since your last check-in + {turn.result.kind === "denied" ? turn.result.detail : turn.result.text} + + + ) + case "month-view": + return ( + + month view · {turn.monthKey} + {turn.view.kind === "denied" ? turn.view.detail : turn.view.text} + + ) + case "denied": + return ( + + denied · fail-closed + {turn.action} blocked — {turn.code}: {turn.detail} + + ) + case "system": + return ( + + {turn.text} + + ) + } +} + +const styles = StyleSheet.create({ + bubble: { + borderRadius: radius + 4, + padding: spacing(3), + marginVertical: spacing(1), + marginHorizontal: spacing(2), + maxWidth: "92%", + }, + mine: { alignSelf: "flex-end", backgroundColor: colors.accent, borderBottomRightRadius: 4 }, + theirs: { alignSelf: "flex-start", backgroundColor: colors.card, borderWidth: 1, borderColor: colors.border, borderBottomLeftRadius: 4 }, + systemBox: { alignSelf: "center", backgroundColor: "transparent", borderWidth: 0 }, + okBox: { backgroundColor: colors.okSoft, borderColor: colors.ok }, + warnBox: { backgroundColor: colors.warnSoft, borderColor: colors.warn }, + dangerBox: { backgroundColor: colors.dangerSoft, borderColor: colors.danger }, + accentBox: { backgroundColor: colors.accentSoft, borderColor: colors.accent }, + turnLabel: { fontSize: 10, color: colors.sub, textTransform: "uppercase", letterSpacing: 1, marginBottom: spacing(1) }, + raw: { color: colors.ink, fontStyle: "italic", marginBottom: spacing(2) }, + ink: { color: colors.ink }, + sub: { color: colors.sub, fontSize: 12, marginTop: spacing(1) }, + mineMeta: { color: "rgba(255,255,255,0.7)", fontSize: 10, marginTop: spacing(1) }, + citation: { color: colors.sub, fontSize: 11, marginTop: spacing(0.5), fontStyle: "italic" }, + eventLine: { color: colors.ink, fontSize: 13, marginBottom: spacing(0.5) }, + link: { color: colors.accent, fontSize: 12, marginTop: spacing(0.5) }, + correctionBox: { flexDirection: "row", flexWrap: "wrap", gap: spacing(1), marginTop: spacing(1), alignItems: "center" }, + input: { borderWidth: 1, borderColor: colors.border, borderRadius: radius, paddingHorizontal: spacing(2), paddingVertical: spacing(1), color: colors.ink, backgroundColor: "#FFFFFF", minWidth: 90 }, + button: { borderRadius: radius, paddingVertical: spacing(2), alignItems: "center", marginTop: spacing(1) }, + buttonSmall: { borderRadius: radius, paddingVertical: spacing(1.5), paddingHorizontal: spacing(2), alignItems: "center" }, + buttonText: { color: "#FFFFFF", fontWeight: "600" }, +}) diff --git a/apps/home-a/src/ui/format.ts b/apps/home-a/src/ui/format.ts new file mode 100644 index 0000000..d53118b --- /dev/null +++ b/apps/home-a/src/ui/format.ts @@ -0,0 +1,8 @@ +/** Demo-time formatting — fixed to the synthetic household timezone (EDT). */ +const TZ = "America/New_York" +const timeFmt = new Intl.DateTimeFormat("en-US", { hour: "numeric", minute: "2-digit", timeZone: TZ }) +const dayFmt = new Intl.DateTimeFormat("en-US", { weekday: "short", month: "short", day: "numeric", timeZone: TZ }) + +export const formatTime = (ms: number): string => timeFmt.format(ms) +export const formatDay = (ms: number): string => dayFmt.format(ms) +export const formatDayTime = (ms: number): string => `${dayFmt.format(ms)}, ${timeFmt.format(ms)}` diff --git a/apps/home-a/src/ui/theme.ts b/apps/home-a/src/ui/theme.ts new file mode 100644 index 0000000..4040121 --- /dev/null +++ b/apps/home-a/src/ui/theme.ts @@ -0,0 +1,20 @@ +/** Demo theme — quiet, paper-like, conversation-first. */ +export const colors = { + bg: "#F7F5F2", + card: "#FFFFFF", + ink: "#1F2937", + sub: "#6B7280", + accent: "#4F46E5", + accentSoft: "#EEF2FF", + ok: "#047857", + okSoft: "#ECFDF5", + warn: "#B45309", + warnSoft: "#FFFBEB", + danger: "#B91C1C", + dangerSoft: "#FEF2F2", + chip: "#F3F4F6", + border: "#E5E7EB", +} as const + +export const radius = 14 +export const spacing = (n: number): number => n * 4 diff --git a/apps/home-a/tests/conversation.test.ts b/apps/home-a/tests/conversation.test.ts new file mode 100644 index 0000000..aa91a2b --- /dev/null +++ b/apps/home-a/tests/conversation.test.ts @@ -0,0 +1,297 @@ +/** + * Candidate A conversation flows over the synthetic September household: + * mixed-topic capture (text + simulated voice), in-thread review/edit, + * publish with raw preservation and provenance, append-only corrections, + * strictly read-only questions/catch-up, and fail-closed authorization. + */ +import { describe, expect, it } from "vitest" + +import { ConversationController, isReadOnlyQuestion, type Turn } from "../src/conversation/controller" +import { anonymousPrincipal, at, memberPrincipal } from "../src/fixtures/household" +import { createSeptemberStore } from "../src/fixtures/september" +import { DEMO_UTTERANCES } from "../src/fixtures/demoUtterances" + +const MIXED = + "Milo ate scrambled eggs and toast at 8, then had a total meltdown when the block tower fell, and Iris napped 45 minutes." + +function newController(memberId = "mem_dana") { + const { store } = createSeptemberStore() + return { store, controller: new ConversationController(store, memberPrincipal(memberId), memberId, at(16, 20, 0)) } +} + +function lastTurn(controller: ConversationController): Turn { + const turns = controller.getTurns() + const last = turns[turns.length - 1] + if (last === undefined) throw new Error("expected a turn") + return last +} + +function captureTurns(controller: ConversationController) { + return controller.getTurns().filter((turn): turn is Extract => turn.kind === "capture") +} + +describe("mixed-topic capture (both input paths, same pipeline)", () => { + it("text path: one sitting captures meal + mood + sleep as reviewable proposals", () => { + const { store, controller } = newController() + controller.sendText(MIXED) + + const turn = lastTurn(controller) + expect(turn.kind).toBe("capture") + if (turn.kind !== "capture") return + + expect(turn.rawTranscript).toBe(MIXED) // raw preserved before any extraction + expect(turn.proposals.map((proposal) => proposal.category).sort()).toEqual(["meal", "mood", "sleep"]) + expect(store.entry(turn.entryId)?.rawTranscript).toBe(MIXED) + }) + + it("simulated-voice path lands on the same pipeline with byte-identical transcript", () => { + const { controller } = newController() + controller.sendVoiceDemo(MIXED) + + const turns = captureTurns(controller) + expect(turns.length).toBe(1) + const turn = turns[0]! + expect(turn.rawTranscript).toBe(MIXED) + expect(turn.proposals.map((proposal) => proposal.category).sort()).toEqual(["meal", "mood", "sleep"]) + }) + + it("user turn records the channel (voice-simulated vs text)", () => { + const { controller } = newController() + controller.sendVoiceDemo("Iris napped 50 minutes this afternoon.") + const turns = controller.getTurns() + expect(turns[0]?.kind).toBe("user") + expect((turns[0] as Extract).channel).toBe("voice-simulated") + + controller.sendText("typed note") + const all = controller.getTurns() + expect((all[all.length - 2] as Extract).channel).toBe("text") + }) + + it("all five scripted utterances capture with raw preserved (no throw, no invented events)", () => { + const { controller } = newController() + for (const utterance of DEMO_UTTERANCES) { + controller.sendText(utterance) + const turn = lastTurn(controller) + expect(turn.kind).toBe("capture") + if (turn.kind === "capture") expect(turn.rawTranscript).toBe(utterance) + } + }) + + it("captureId idempotency: duplicate submission replays, never duplicates", () => { + const { store } = createSeptemberStore() + const principal = memberPrincipal("mem_dana") + const input = { + captureId: "cap_test_idempotent", + transcript: "Iris napped 40 minutes.", + authorId: "mem_dana", + capturedAt: at(16, 18, 0), + channel: "text" as const, + } + const first = store.capture(principal, input) + const second = store.capture(principal, input) + expect(first.kind).toBe("captured") + expect(second.kind).toBe("replayed") + if (first.kind === "captured" && second.kind === "replayed") { + expect(second.entryId).toBe(first.entryId) + } + }) +}) + +describe("inspect and correct proposals before publish", () => { + it("edits child, time, amount, and audience on the proposal card before publish", () => { + const { store, controller } = newController() + controller.sendText("Iris napped 45 minutes.") + const turn = lastTurn(controller) + expect(turn.kind).toBe("capture") + if (turn.kind !== "capture") return + + const proposal = turn.proposals[0]! + const milo = controller.childrenRoster.find((child) => child.name === "Milo") + expect(milo).toBeDefined() + + controller.publish(turn.entryId, new Map([ + [proposal.proposalId, { + childId: milo!.childId, + timestamp: at(16, 15, 30), + payload: { minutes: 60 }, + audience: "parents-only", + }], + ])) + + const receipt = lastTurn(controller) + expect(receipt.kind).toBe("publish-receipt") + const visible = store.visibleEvents(memberPrincipal("mem_dana"), turn.entryId) + expect(visible.length).toBe(1) + const { event, audience } = visible[0]! + expect(event.childId).toBe(milo!.childId) + expect(event.timestamp).toBe(at(16, 15, 30)) + expect(event.payload?.["minutes"]).toBe(60) + expect(audience).toBe("parents-only") + }) + + it("edits the interpreted type before publish", () => { + const { store, controller } = newController() + controller.sendText("Milo pooped on the potty at 3, big win!") + const turn = lastTurn(controller) + expect(turn.kind).toBe("capture") + if (turn.kind !== "capture") return + + const proposal = turn.proposals[0]! + controller.publish(turn.entryId, new Map([[proposal.proposalId, { category: "mood" }]])) + const visible = store.visibleEvents(memberPrincipal("mem_dana"), turn.entryId) + expect(visible[0]?.event.category).toBe("mood") + }) +}) + +describe("publish → raw-preserved entry + events with provenance", () => { + it("published events carry canonical producedBy lineage and caregiver confidence", () => { + const { store, controller } = newController() + controller.sendText(MIXED) + const turn = lastTurn(controller) + if (turn.kind !== "capture") return + const entryId = turn.entryId + + controller.publish(entryId, new Map()) + expect(lastTurn(controller).kind).toBe("publish-receipt") + + const visible = store.visibleEvents(memberPrincipal("mem_dana"), entryId) + expect(visible.length).toBe(3) + for (const { event } of visible) { + expect(event.producedBy?.extractorVersion).toBe("home-a-extraction-double/0.1.0") + expect(event.confidence).toBe(1) // caregiver-confirmed at publish + } + // raw transcript still intact after publish + expect(store.entry(entryId)?.rawTranscript).toBe(MIXED) + expect(store.entry(entryId)?.visibility).toBe("published") + }) +}) + +describe("post-publish correction appends lineage (original intact)", () => { + it("correction happens conversationally; the original event is never mutated", () => { + const { store, controller } = newController() + controller.sendText("Iris napped 50 minutes this afternoon.") + const turn = lastTurn(controller) + if (turn.kind !== "capture") return + controller.publish(turn.entryId, new Map()) + const receipt = lastTurn(controller) + if (receipt.kind !== "publish-receipt") return + const eventId = receipt.eventIds[0]! + + controller.correct(eventId, { payload: { minutes: 55 } }, "miscounted the timer") + + expect(lastTurn(controller).kind).toBe("correction") + // the live event shows the corrected value (the read model); + // the ORIGINAL is preserved inside the append-only lineage record + expect(store.event(eventId)?.payload?.["minutes"]).toBe(55) + const history = store.correctionHistory(eventId) + expect(history.length).toBe(1) + expect(history[0]?.before.payload?.["minutes"]).toBe(50) + expect(history[0]?.after.payload?.["minutes"]).toBe(55) + expect(history[0]?.reason).toBe("miscounted the timer") + }) + + it("the Sep 16 bedtime capture attributes each sleep fact to the right child", () => { + const { store, facts } = createSeptemberStore() + const entryId = facts.entryIdByCaptureId.get("seed_sep16_bedtime") + expect(entryId).toBeDefined() + if (entryId === undefined) return + const events = store.visibleEvents(memberPrincipal("mem_dana"), entryId).map((row) => row.event) + const irisNap = events.find((event) => event.childId === "ch_iris" && event.category === "sleep") + const miloBedtime = events.find((event) => event.childId === "ch_milo" && event.category === "sleep") + expect(irisNap?.payload?.["minutes"]).toBe(65) + expect(miloBedtime).toBeDefined() + }) + + it("the seeded Sep 12 nap carries the 30 → 60 lineage example", () => { + const { store, facts } = createSeptemberStore() + expect(store.event(facts.sep12Nap.eventId)?.payload?.["minutes"]).toBe(60) + const lineage = store.correctionHistory(facts.sep12Nap.eventId) + expect(lineage.length).toBe(1) + expect(lineage[0]?.before.payload?.["minutes"]).toBe(30) + }) +}) + +describe("read-only catch-up and questions never write", () => { + it("answers cite sources and the write counter never moves", () => { + const { store, controller } = newController() + const before = store.writeCount + + controller.ask("How did naps go this week?") + controller.catchUp() + controller.monthView() + controller.ask("Did Iris nap today?") + + expect(store.writeCount).toBe(before) // strictly read-only + + const answerTurns = controller.getTurns().filter((turn) => turn.kind === "answer") + expect(answerTurns.length).toBe(2) + for (const turn of answerTurns) { + if (turn.kind !== "answer") continue + expect(turn.answer.kind).toBe("summary") + if (turn.answer.kind === "summary") expect(turn.answer.citations.length).toBeGreaterThan(0) + } + expect(controller.getTurns().some((turn) => turn.kind === "catchup")).toBe(true) + expect(controller.getTurns().some((turn) => turn.kind === "month-view")).toBe(true) + }) + + it("question routing: read-only questions never enter the capture pipeline", () => { + expect(isReadOnlyQuestion("How did naps go this week?")).toBe(true) + expect(isReadOnlyQuestion("Did Iris nap today?")).toBe(true) + expect(isReadOnlyQuestion("Milo ate eggs at 8")).toBe(false) + }) +}) + +describe("fail-closed authorization", () => { + it("a non-member sees nothing, captures nothing, and is denied in-thread", () => { + const { store } = createSeptemberStore() + expect(store.visibleEntries(anonymousPrincipal).length).toBe(0) + expect(store.visibleEntries(memberPrincipal("mem_stranger")).length).toBe(0) + + const controller = new ConversationController(store, anonymousPrincipal, "mem_stranger", at(16, 20, 0)) + controller.sendText(MIXED) + expect(lastTurn(controller).kind).toBe("denied") + controller.ask("How did naps go this week?") + expect(lastTurn(controller).kind).toBe("denied") + controller.catchUp() + expect(lastTurn(controller).kind).toBe("denied") + // no capture turn ever appeared + expect(captureTurns(controller).length).toBe(0) + }) + + it("parents-only entries are invisible to the invited caregiver but visible to a parent", () => { + const { store, facts } = createSeptemberStore() + const danaIds = store.visibleEntries(memberPrincipal("mem_dana")).map((row) => row.entryId) + const rosaIds = store.visibleEntries(memberPrincipal("mem_rosa")).map((row) => row.entryId) + expect(danaIds).toContain(facts.parentsOnlyEntryId) + expect(rosaIds).not.toContain(facts.parentsOnlyEntryId) + }) + + it("the caregiver's month view cites only entries she is allowed to see", () => { + const { store } = createSeptemberStore() + const rosa = new ConversationController(store, memberPrincipal("mem_rosa"), "mem_rosa", at(16, 20, 0)) + rosa.monthView() + const turn = lastTurn(rosa) + expect(turn.kind).toBe("month-view") + if (turn.kind !== "month-view" || turn.view.kind !== "summary") return + const visibleIds = store.visibleEntries(memberPrincipal("mem_rosa")).map((row) => row.entryId) + for (const citation of turn.view.citations) { + expect(visibleIds).toContain(citation.entryId) + } + }) + + it("Nana Rosa's seeded afternoon-care notes exist (Sep 3, 10, 15)", () => { + const { store } = createSeptemberStore() + const rosaAuthored = store + .visibleEntries(memberPrincipal("mem_rosa")) + .filter((row) => row.entry.authorId === "mem_rosa") + expect(rosaAuthored.length).toBeGreaterThanOrEqual(3) + }) +}) + +describe("synthetic dataset shape", () => { + it("seeds a month of history (>= 20 entries) through the real pipeline", () => { + const { store, facts } = createSeptemberStore() + expect(facts.entryCount).toBeGreaterThanOrEqual(20) + expect(store.visibleEntries(memberPrincipal("mem_dana")).length).toBe(facts.entryCount) + }) +}) diff --git a/apps/home-a/tests/pipeline.test.ts b/apps/home-a/tests/pipeline.test.ts new file mode 100644 index 0000000..8ab7aa1 --- /dev/null +++ b/apps/home-a/tests/pipeline.test.ts @@ -0,0 +1,126 @@ +/** + * Extraction-double and v0.3 envelope semantics at the store level: + * clause/event alignment, category routing, lineage, and the late-apply + * retry rules (stale suppression, idempotent no-op). + */ +import { describe, expect, it } from "vitest" + +import { runExtraction } from "../src/capture/extraction" +import { anonymousPrincipal, at, memberPrincipal } from "../src/fixtures/household" +import { createSeptemberStore } from "../src/fixtures/september" + +const { Schema, CaptureId } = (() => { + // Local helpers to brand plain capture ids for the double. + return { Schema: require("effect").Schema, CaptureId: require("@journal/domain").CaptureId } +})() + +const HOUSEHOLD_ID = "hh_polanco_household" + +function extract(captureId: string, transcript: string, capturedAt: number, defaultChildId: string) { + return runExtraction({ + captureId: Schema.decodeUnknownSync(CaptureId)(captureId), + attempt: 0, + transcript, + capturedAt, + householdId: HOUSEHOLD_ID, + childIds: ["ch_milo", "ch_iris"], + childNames: [ + { name: "Milo", aliases: ["buddy"] }, + { name: "Iris", aliases: ["sis"] }, + ], + defaultChildId, + attemptRecordId: "atn_test", + }) +} + +describe("extraction double", () => { + const MIXED = + "Milo ate scrambled eggs and toast at 8, then had a total meltdown when the block tower fell, and Iris napped 45 minutes." + + it("splits a mixed-topic utterance into aligned events and source clauses", () => { + const outcome = extract("cap_pipeline_mixed", MIXED, at(16, 8, 0), "ch_milo") + expect(outcome.events.length).toBe(3) + expect(outcome.sourceClauses.length).toBe(outcome.events.length) // parallel arrays + expect(outcome.events.map((event) => event.category).sort()).toEqual(["meal", "mood", "sleep"]) + for (const event of outcome.events) { + expect(event.producedBy?.extractorVersion).toBe("home-a-extraction-double/0.1.0") + } + // Per-clause child attribution: Milo's meal and mood, Iris's nap. + expect(outcome.events.find((event) => event.category === "meal")?.childId).toBe("ch_milo") + expect(outcome.events.find((event) => event.category === "mood")?.childId).toBe("ch_milo") + const sleep = outcome.events.find((event) => event.category === "sleep") + expect(sleep?.childId).toBe("ch_iris") // the nap clause belongs to Iris + expect(sleep?.payload?.["minutes"]).toBe(45) // count quantities are numeric + }) + + it("keeps skipped naps from becoming sleep events", () => { + const outcome = extract("cap_pipeline_skip", "Milo skipped his nap this morning.", at(16, 12, 0), "ch_milo") + expect(outcome.events.every((event) => event.category !== "sleep")).toBe(true) + }) + + it("water-play 'soaked' does not invent a potty event", () => { + const outcome = extract( + "cap_pipeline_water", + "Water play day at pre-K — Milo's teacher says he led the bucket brigade. He was soaked and delighted.", + at(16, 9, 0), + "ch_milo", + ) + expect(outcome.events.some((event) => event.category === "potty")).toBe(false) + expect(outcome.events.map((event) => event.category).sort()).toEqual(["mood", "school"]) + for (const event of outcome.events) expect(event.childId).toBe("ch_milo") + }) + + it("never invents a category for health content (stays raw)", () => { + const outcome = extract("cap_pipeline_health", "Iris had her checkup today.", at(16, 10, 0), "ch_iris") + expect(outcome.events.length).toBe(0) + expect(outcome.unstructured.length).toBeGreaterThan(0) + }) +}) + +describe("v0.3 late-apply envelope semantics", () => { + it("stale results are suppressed, latest re-apply is a no-op, unknown captures rejected", () => { + const { store } = createSeptemberStore() + const principal = memberPrincipal("mem_dana") + const first = store.capture(principal, { + captureId: "cap_late_apply", + transcript: "Iris napped 40 minutes.", + authorId: "mem_dana", + capturedAt: at(16, 18, 0), + channel: "text" as const, + }) + expect(first.kind).toBe("captured") + if (first.kind !== "captured") return + const captureId = first.proposals[0]?.captureId + expect(captureId).toBeDefined() + if (captureId === undefined) return + + const late = extract(captureId, "Iris napped 40 minutes.", at(16, 18, 0), "ch_iris") + + // attempt 0 already applied → re-applying attempt 1 lands + expect(store.applyExtractionResult(captureId, 1, late)).toEqual({ applied: true, reason: "applied" }) + // attempt 0 is now stale → suppressed, never merged + expect(store.applyExtractionResult(captureId, 0, late)).toEqual({ applied: false, reason: "stale-suppressed" }) + // attempt 1 again → idempotent no-op + expect(store.applyExtractionResult(captureId, 1, late)).toEqual({ applied: false, reason: "idempotent-no-op" }) + // unknown capture → rejected + expect(store.applyExtractionResult("cap_never_captured", 5, late)).toEqual({ applied: false, reason: "unknown-capture" }) + }) +}) + +describe("fail-closed store-level reads", () => { + it("anonymous principals get empty timelines and denied answers", () => { + const { store } = createSeptemberStore() + expect(store.visibleEntries(anonymousPrincipal)).toEqual([]) + const answer = store.ask(anonymousPrincipal, "How did naps go this week?", at(16, 20, 0)) + expect(answer.kind).toBe("denied") + }) + + it("a parent's answers never move the write counter", () => { + const { store } = createSeptemberStore() + const before = store.writeCount + store.ask(memberPrincipal("mem_dana"), "How did naps go this week?", at(16, 20, 0)) + store.catchUp(memberPrincipal("mem_gilbert"), at(16, 20, 1)) + store.monthView(memberPrincipal("mem_dana"), "2026-09") + expect(store.writeCount).toBe(before) + }) +}) diff --git a/apps/home-a/tsconfig.json b/apps/home-a/tsconfig.json new file mode 100644 index 0000000..41e8df7 --- /dev/null +++ b/apps/home-a/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "noEmit": true, + "jsx": "react-jsx", + "types": ["node"] + }, + "include": ["index.ts", "App.tsx", "src", "test"] +} diff --git a/apps/home-a/vitest.config.ts b/apps/home-a/vitest.config.ts new file mode 100644 index 0000000..23e2356 --- /dev/null +++ b/apps/home-a/vitest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "vitest/config" + +export default defineConfig({ + test: { + include: ["tests/**/*.test.ts"], + // Deterministic, device-free: no jsdom, no timers, no network. + environment: "node", + }, +}) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 421fcf7..68e3b20 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,6 +15,43 @@ importers: specifier: ~6.0.3 version: 6.0.3 + apps/home-a: + dependencies: + '@journal/domain': + specifier: workspace:* + version: link:../../packages/domain + effect: + specifier: 4.0.0-rc.115 + version: 4.0.0-rc.115 + expo: + specifier: ~57.0.23 + version: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-dom@19.2.3(react@19.2.3))(react-native-web@0.21.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) + react: + specifier: 19.2.3 + version: 19.2.3 + react-dom: + specifier: 19.2.3 + version: 19.2.3(react@19.2.3) + react-native: + specifier: 0.86.3 + version: 0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3) + react-native-web: + specifier: ^0.21.2 + version: 0.21.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + devDependencies: + '@types/node': + specifier: ^20.19.0 + version: 20.19.43 + '@types/react': + specifier: ~19.2.2 + version: 19.2.18 + typescript: + specifier: ~6.0.3 + version: 6.0.3 + vitest: + specifier: ^3.2.4 + version: 3.2.7(@types/node@20.19.43)(lightningcss@1.33.0)(terser@5.51.2)(yaml@2.9.1) + apps/mobile: dependencies: '@journal/month-history': @@ -31,7 +68,7 @@ importers: version: 4.0.0-rc.115 expo: specifier: ~57.0.23 - version: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) + version: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-dom@19.2.3(react@19.2.3))(react-native-web@0.21.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) react: specifier: 19.2.3 version: 19.2.3 @@ -854,6 +891,13 @@ packages: '@jridgewell/trace-mapping@0.3.31': resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + '@napi-rs/lzma-linux-x64-gnu@1.5.1': + resolution: {integrity: sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==} + engines: {node: ^22.20 || ^24.12 || >=25} + cpu: [x64] + os: [linux] + libc: [glibc] + '@react-native/assets-registry@0.86.3': resolution: {integrity: sha512-TDhgCZA4wjJg84d5A9swiOQYPIWSKEEVdg9IwMFZDupQzW/F3QoLUrfAJOcalgqTDA9/buTB8awhE3Whwg6u9Q==} engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0} @@ -900,6 +944,9 @@ packages: resolution: {integrity: sha512-eYIJ0es967+tePBFQDnl/gidVFxLns3fnbiK6rxscQrGodvuUO6hwxpQnfNynJ8MjbbndImXihXjcnJdc7SzJg==} engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0} + '@react-native/normalize-colors@0.74.89': + resolution: {integrity: sha512-qoMMXddVKVhZ8PA1AbUCk83trpd6N+1nF2A6k1i6LsQObyS92fELuk8kU/lQs6M7BsMHwqyLCpQJ1uFgNvIQXg==} + '@react-native/normalize-colors@0.86.3': resolution: {integrity: sha512-Cv3CDkprb67GrzuaS9BGbBJC/6G4lIw3nyKOHRKTqTTum4bn37y5+R0Z04L8mcbQN85eEohNrRwb7IOM4j6uvg==} @@ -914,6 +961,144 @@ packages: '@types/react': optional: true + '@rollup/rollup-android-arm-eabi@4.63.3': + resolution: {integrity: sha512-w3Jnvi1ocaVm/c7yVPpfB98XeSRBMyzp6njL5MVVbGyXjpmUkN+s6Hp4t0PqhGCCaI1ZHMKXt/w0lA1RCaLVcw==} + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.63.3': + resolution: {integrity: sha512-uI/ESiaIbbRYAEhzy8PCUWDp1hB0bjAqM06mW9flOoNO4Q8DQpeoREhBR5Hegfl+wpXiguyJv6XSPzEN7OxyHQ==} + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.63.3': + resolution: {integrity: sha512-oxhrd1jmXLwWZ83eQYDXxuqRdkqkzrjR3JobKeuUyfdNZo11FuQIvqEOZhyIT7OBHxXoGslDDjN0cQcM6T0TqQ==} + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.63.3': + resolution: {integrity: sha512-7/YiIMghVE8DrxKvNdorAaJVdriOFgOIpdStnPx8ppx5zfTwC3jBCSEAIzB7JD5404m65THl6H93UTTVUvypmg==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-freebsd-arm64@4.63.3': + resolution: {integrity: sha512-GXFZRRoMAytaI5z6N3Zhfw0WL18Q0M8r95D5hlC4GqE/lGk8pbSJNUBoOWDfbm6dTciqHj2nU87tI5f6XhQiOg==} + cpu: [arm64] + os: [freebsd] + + '@rollup/rollup-freebsd-x64@4.63.3': + resolution: {integrity: sha512-77W+8X3ddYgPxUpB8nZFQs2Mq+wc4HVlcSRtApXLjYBcnPMkttrSnU8VwKQjeWYhMsITHFs5cWBQ8vz1Q+5RHQ==} + cpu: [x64] + os: [freebsd] + + '@rollup/rollup-linux-arm-gnueabihf@4.63.3': + resolution: {integrity: sha512-FVkwK+iUC+mq+GipVK46rRVticfAPtvPUNlqlGXUDxdVk/UGjQiiiUVPUrEXdSpU2ufU0XxLGyTqDtBidDOVmg==} + cpu: [arm] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-arm-musleabihf@4.63.3': + resolution: {integrity: sha512-+aGU1t3398yQOVj1Bz8o3e+KtswxAPvO+mtxtNdfXYMkXIHu7XhhkCD7/DEH9q8tF8uhDnMWvfpUKI8y1sZJsg==} + cpu: [arm] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-arm64-gnu@4.63.3': + resolution: {integrity: sha512-cR0kjpRXR2KJ2oQK8E2KTPtphs+b9hZ8IhTZubNryt/RsqgdOZBQ2Zq0q5UedtiIi0rs3jVhJh55RE1ZHUVGUA==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-arm64-musl@4.63.3': + resolution: {integrity: sha512-y1RYi4Q3/9ByVWSSt9kX2ustE0B7kFYbJ6zZdVZVyqopZs3yhCTwRfrjIX4vezUJInma/Gs6BOFDJg7yZmJ0IQ==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-loong64-gnu@4.63.3': + resolution: {integrity: sha512-DNhEA5viIj3Z5bZLE4z4oV8N5ozWqDwyt7T6KG7VdLDJ0nW+rNOYlphBl4/3HQkK75qipPLsVOfStHHOwN9WSg==} + cpu: [loong64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-loong64-musl@4.63.3': + resolution: {integrity: sha512-17gQCqrIpXBX2Cmi9/TygnVOqGbzsba/iaqcYSL8FY7lNugg+7AiYNs5c5nKWD+NRQha36Sa0CqkJqH4XVHwnQ==} + cpu: [loong64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-ppc64-gnu@4.63.3': + resolution: {integrity: sha512-6LwVnZRIyINpdku/yOcI8Tm9YqLmhHK5emmlOOnW9tO0SYEm1FmKPcsSAGp0NBlqR2P04xaND4jvN6sTHqhq8A==} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-ppc64-musl@4.63.3': + resolution: {integrity: sha512-xMUqkTXlEUtI/p5AAukMwBRr1enU3efsTeF+bskeFfk8t1C9rcC8sLREcZXmTfAXEbvRdJVSonVJez3TMlbR3w==} + cpu: [ppc64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-riscv64-gnu@4.63.3': + resolution: {integrity: sha512-S3E94co9F9WRRqEaUoQZ38K1gCz6KiM+nL7/3ijq7fDGF3OznjS5TasgYITlvl27GQKtu4lOAOsr5MFwkijvOA==} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-riscv64-musl@4.63.3': + resolution: {integrity: sha512-1QtRDwG42x5BJI3s9mxu5rEjDnfbSnk20HQ9/ylTAYnSwYwxMVb+Vgu34wzzTQ7ogqBybebgQNUDAvZVQ38DbA==} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-s390x-gnu@4.63.3': + resolution: {integrity: sha512-BQhejF6ZXOpxbngiNTP12GCGQeaDVL2QXGeBVViKIYzFHM5RKxTxwUMB1fr1BeNFphFMpnRqC5QSXFSa4z6UQw==} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-x64-gnu@4.63.3': + resolution: {integrity: sha512-SXagRwnI2Wlwlitllu59UK/nGVbD1CKPcNqDplHwIC4BqJcpXFjD32d1R/RbuISa95HdQrZM3/7v4bKiowFaLA==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-x64-musl@4.63.3': + resolution: {integrity: sha512-2IPozoEALRCziGqE8O9KMK60PMu5TS1huv4fwoeCexj+WjmcwFtX9CTOVbfXCUqcELAubEwRFPYlzb/WvwY2HQ==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rollup/rollup-openbsd-x64@4.63.3': + resolution: {integrity: sha512-AoxqosUHT9IX54hFn2TiN6A7d6ZKTtE6pd2bqWtqkkNJ6HJGaU6FRouGX8L1O7R/ZwsnCnpQrHzb4pDEx+UHRQ==} + cpu: [x64] + os: [openbsd] + + '@rollup/rollup-openharmony-arm64@4.63.3': + resolution: {integrity: sha512-d+CaftKgmkFBzCwezMqqy1d0QNNYugqLCMcYVQWBy5SS2YfeMP8Q8ripkgx9O8IyBXXLHrJ+aaCV4U96usv6Yg==} + cpu: [arm64] + os: [openharmony] + + '@rollup/rollup-win32-arm64-msvc@4.63.3': + resolution: {integrity: sha512-xXlDF6nR1eOuXbdDy5Hl5fmtY7teUDevF/k0O7IPoZe4Tpmdv+lgdE5JRsnhQtt37ql9P0VF2kAN9a0OCZdo+Q==} + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.63.3': + resolution: {integrity: sha512-YtXAgLN+JP7Ay6qG3eWhc7IHMQPzLc8r3uvhAvlJIoCz/4Q32+Bl9Fmnywidh8v1GOIMmymjovfqY9ETAtysvA==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-gnu@4.63.3': + resolution: {integrity: sha512-WuWtSJRNo549vzcfZyEgfqb6zeSgn1F+UE5kQ+BCjzz0W4MGCjntUHkZVc1VRuAM7+ULaSyhiPxD1spyewFvkQ==} + cpu: [x64] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.63.3': + resolution: {integrity: sha512-+lIKX7O0+IGe7WuhATaAMMeT7B76vfhXH/l9wLQL+nvyhbw2ohYCKIdWL56JfDu75CWt5oKRP4QFH/jkMtBquA==} + cpu: [x64] + os: [win32] + '@sinclair/typebox@0.27.12': resolution: {integrity: sha512-hhyNJ+nbR6ZR7pToHvllEFun9TL0sbL+tk/ON75lo+Xas054uez98qRbsuNt7MBCyZKK4+8Yli/OAGZhmfBZ/g==} @@ -950,6 +1135,15 @@ packages: '@types/bun@1.4.2': resolution: {integrity: sha512-GimotNn7+ZV0uVArItBbriZsR1oNf0+WTzPkdcFrzShI7k2norL0uzEaJT8T33dWr7O/c9ZDuAFQrctKCi72oQ==} + '@types/chai@5.2.3': + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + + '@types/estree@1.0.9': + resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} + '@types/istanbul-lib-coverage@2.0.6': resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} @@ -974,6 +1168,35 @@ packages: '@ungap/structured-clone@1.4.0': resolution: {integrity: sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ==} + '@vitest/expect@3.2.7': + resolution: {integrity: sha512-E8eBXaKibuvH2pSZErOjdVb5vF4PbKYcrnluBTYxEk1l/VhhwZg1kZQsdtjq+CsF5CFydf2Rdkz7jDHKSisi3w==} + + '@vitest/mocker@3.2.7': + resolution: {integrity: sha512-Trr0hYO9CM3Wj6ksWHRhK9IZpIY6wTMO5u/MqXurMxT57sWBaOPEtP3Oq60ihZuh5JsiagKfz95OcxdEP6dBrA==} + peerDependencies: + msw: ^2.4.9 + vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + + '@vitest/pretty-format@3.2.7': + resolution: {integrity: sha512-KUHlwqVu0sRlhCdyPdQ/wBoTfRahjUky1MubOmYw9fWfIZy1gNoHpuaaQBPAaMaVYdQYHJLurzj8ECCj5OwTqA==} + + '@vitest/runner@3.2.7': + resolution: {integrity: sha512-sB9y4ovltoQP+WaUPwmSxO9WIg9Ig694Di5PalVPsYHklAdE027mehpWF2SQSVq+k6sFgaivbTjTJwZLSHbedA==} + + '@vitest/snapshot@3.2.7': + resolution: {integrity: sha512-7C+MwShwtBSI5Buwoyg3s/iY1eHL9PKAf+O1wVh/TdnjXUtkoL/9YQtre90i4MtNXM6edP1wJ2zOBpfCyhIS7g==} + + '@vitest/spy@3.2.7': + resolution: {integrity: sha512-Q2eQGI6d2L/hBtZ0qNuKcAGid68XK6cv1xsoaIma6PaJhHPoqcEJhYpXZ/5myCMqkNgtP6UKuBhbc0nHKnrkuQ==} + + '@vitest/utils@3.2.7': + resolution: {integrity: sha512-x6BDOd7dyo3PFLY3I9/HJ25X/6OurhGXk2/B9gOZNPF7XDVjeBK4k01lQE5uvDpbuheErh91qYuE1E2OEjK3Rw==} + '@xmldom/xmldom@0.8.15': resolution: {integrity: sha512-/5NV/vDALVFDXgLmfsy9TRCBlKwO2LNBFzpzvb9iIj+jR+eSc6DLYYvVOdivT/jm7MtU6TebYuRmzEOI7w40UA==} engines: {node: '>=10.0.0'} @@ -1044,6 +1267,10 @@ packages: asap@2.0.6: resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==} + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + babel-plugin-polyfill-corejs2@0.4.17: resolution: {integrity: sha512-aTyf30K/rqAsNwN76zYrdtx8obu0E4KoUME29B1xj+B3WxgvWkp943vYQ+z8Mv3lw9xHXMHpvSPOBxzAkIa94w==} peerDependencies: @@ -1142,6 +1369,10 @@ packages: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} engines: {node: '>= 0.8'} + cac@6.7.14: + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} + engines: {node: '>=8'} + camelcase@6.3.0: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} @@ -1149,6 +1380,10 @@ packages: caniuse-lite@1.0.30001810: resolution: {integrity: sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==} + chai@5.3.3: + resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} + engines: {node: '>=18'} + chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -1157,6 +1392,10 @@ packages: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} + check-error@2.1.3: + resolution: {integrity: sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==} + engines: {node: '>= 16'} + chrome-launcher@0.15.2: resolution: {integrity: sha512-zdLEwNo3aUVzIhKhTtXfxhdvZhUghrnmkvcAq2NoDd+LeOHKf03H5jwZ8T/STsAlzyALkBVK552iaG1fGf1xVQ==} engines: {node: '>=12.13.0'} @@ -1254,10 +1493,16 @@ packages: resolution: {integrity: sha512-XGpFGbMLHwSt74YLTKho7Ib242qi6O8MSX+sRokV4oz7iKXvQWGYZthjIhjRGMxjzVkAubBO512dKGYcefmX3Q==} engines: {node: '>=6.4.0'} + cross-fetch@3.2.0: + resolution: {integrity: sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q==} + cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} + css-in-js-utils@3.1.0: + resolution: {integrity: sha512-fJAcud6B3rRu+KHYk+Bwf+WFL2MDCJJ1XG9x137tJQ0xYxor7XziQtuGFbWNdqrvF4Tk26O3H73nfVqXt/fW1A==} + csstype@3.2.3: resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} @@ -1286,6 +1531,10 @@ packages: supports-color: optional: true + deep-eql@5.0.2: + resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} + engines: {node: '>=6'} + deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} @@ -1335,6 +1584,9 @@ packages: resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} engines: {node: '>= 0.4'} + es-module-lexer@1.7.0: + resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} + esbuild@0.27.0: resolution: {integrity: sha512-jd0f4NHbD6cALCyGElNpGAOtWxSq46l9X/sWB0Nzd5er4Kz2YTm+Vl0qKFT9KUJvD8+fiO8AvoHhFvEatfVixA==} engines: {node: '>=18'} @@ -1355,6 +1607,9 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} + estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + etag@1.8.1: resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} engines: {node: '>= 0.6'} @@ -1363,6 +1618,10 @@ packages: resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} engines: {node: '>=6'} + expect-type@1.4.0: + resolution: {integrity: sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==} + engines: {node: '>=12.0.0'} + expo-asset@57.0.17: resolution: {integrity: sha512-qSdWZBSfEg06o3GJMwcj36tw0vXkB6eYjqkQistWmyJkHxhUOKnsKJnev6OraXxLdoI+KOd1+qgp/ENx8gcqYA==} peerDependencies: @@ -1452,6 +1711,12 @@ packages: fb-watchman@2.0.2: resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} + fbjs-css-vars@1.0.2: + resolution: {integrity: sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ==} + + fbjs@3.0.5: + resolution: {integrity: sha512-ztsSx77JBtkuMrEypfhgc3cI0+0h+svqeie7xHbh1k/IKdcydnvadp/mUaGgjAOXQmQSxsqgaRhS3q9fy+1kxg==} + fdir@6.5.0: resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} engines: {node: '>=12.0.0'} @@ -1482,6 +1747,11 @@ packages: resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} engines: {node: '>= 0.6'} + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} @@ -1549,6 +1819,9 @@ packages: resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} engines: {node: '>= 14'} + hyphenate-style-name@1.1.0: + resolution: {integrity: sha512-WDC/ui2VVRrz3jOVi+XtjqkDjiVjTtFaAGiW37k6b+ohyQ5wYDOGkvCZa8+H0nx3gyvv0+BST9xuOgIyGQ00gw==} + ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} @@ -1556,6 +1829,9 @@ packages: inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + inline-style-prefixer@7.0.1: + resolution: {integrity: sha512-lhYo5qNTQp3EvSSp3sRvXMbVQTLrvGV6DycRMJ5dm2BLMiJ30wpXKdDdgX+GmJZ5uQMucwRKHamXSst3Sj/Giw==} + invariant@2.2.4: resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==} @@ -1605,6 +1881,9 @@ packages: js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + js-tokens@9.0.1: + resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} + js-yaml@4.3.2: resolution: {integrity: sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==} hasBin: true @@ -1725,6 +2004,9 @@ packages: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true + loupe@3.2.1: + resolution: {integrity: sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==} + lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} @@ -1735,6 +2017,9 @@ packages: lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + magic-string@0.30.21: + resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + makeerror@1.0.12: resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} @@ -1744,6 +2029,9 @@ packages: memoize-one@5.2.1: resolution: {integrity: sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==} + memoize-one@6.0.0: + resolution: {integrity: sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==} + merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} @@ -1931,6 +2219,15 @@ packages: resolution: {integrity: sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg==} engines: {node: '>=18'} + node-fetch@2.7.0: + resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + node-forge@1.4.0: resolution: {integrity: sha512-LarFH0+6VfriEhqMMcLX2F7SwSXeWwnEAJEsYm5QKWchiVYVvJyV9v7UDvUv+w5HO23ZpQTXDv/GxdDdMyOuoQ==} engines: {node: '>= 6.13.0'} @@ -1957,6 +2254,10 @@ packages: resolution: {integrity: sha512-+s+6zjd0X68hfAcn92NsEPXnSYOF3O7exw/Fj4UfRTB+UL+Tdjdkzu5/4WquXlzqgvNm8FWuuW6/0Yd8S2rYxw==} engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0} + object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + on-finished@2.3.0: resolution: {integrity: sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==} engines: {node: '>= 0.8'} @@ -2000,6 +2301,13 @@ packages: resolution: {integrity: sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==} engines: {node: 18 || 20 || >=22} + pathe@2.0.3: + resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + + pathval@2.0.1: + resolution: {integrity: sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==} + engines: {node: '>= 14.16'} + picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -2019,6 +2327,9 @@ packages: resolution: {integrity: sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==} engines: {node: '>=4.0.0'} + postcss-value-parser@4.2.0: + resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} + postcss@8.5.28: resolution: {integrity: sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==} engines: {node: ^10 || ^12 || >=14} @@ -2040,6 +2351,9 @@ packages: resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} engines: {node: '>=0.4.0'} + promise@7.3.1: + resolution: {integrity: sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==} + promise@8.3.0: resolution: {integrity: sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==} @@ -2054,9 +2368,20 @@ packages: react-devtools-core@6.1.5: resolution: {integrity: sha512-ePrwPfxAnB+7hgnEr8vpKxL9cmnp7F322t8oqcPshbIQQhDKgFDW4tjhF2wjVbdXF9O/nyuy3sQWd9JGpiLPvA==} + react-dom@19.2.3: + resolution: {integrity: sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==} + peerDependencies: + react: ^19.2.3 + react-is@18.3.1: resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} + react-native-web@0.21.2: + resolution: {integrity: sha512-SO2t9/17zM4iEnFvlu2DA9jqNbzNhoUP+AItkoCOyFmDMOhUnBBznBDCYN92fGdfAkfQlWzPoez6+zLxFNsZEg==} + peerDependencies: + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + react-native@0.86.3: resolution: {integrity: sha512-JR5s3bM9ezud+Mw24GlNXNfthqPIKwrQgPPJcam+L97t2sKjjEavhCzBn+fyqZZRcM5+XlhYxpTxVkK7e1n38Q==} engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0} @@ -2120,6 +2445,11 @@ packages: resolution: {integrity: sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==} engines: {node: '>=4'} + rollup@4.63.3: + resolution: {integrity: sha512-1i2XreiAoMMXuPGD6Msj2xWrMMkHojNRKivInxGQcg7/1KuPuYlfUutLyh4drnOxUTHX9cHI4wFoat8D/NKaBw==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} @@ -2156,6 +2486,9 @@ packages: resolution: {integrity: sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==} engines: {node: '>= 0.8.0'} + setimmediate@1.0.5: + resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==} + setprototypeof@1.2.0: resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} @@ -2171,6 +2504,9 @@ packages: resolution: {integrity: sha512-w1aiOKwKuRgtwAReIIj89puqg+I7GvX4IbLrvmhXbzQsj1+Zwi4VO3+fa6ZF91TWSjIxoEkKnMeHcLEODK5ZXA==} engines: {node: '>= 0.4'} + siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} @@ -2199,6 +2535,9 @@ packages: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} + stackback@0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + stackframe@1.3.4: resolution: {integrity: sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==} @@ -2214,6 +2553,9 @@ packages: resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==} engines: {node: '>= 0.8'} + std-env@3.10.0: + resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==} + stream-buffers@2.2.0: resolution: {integrity: sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==} engines: {node: '>= 0.10.0'} @@ -2230,9 +2572,15 @@ packages: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} + strip-literal@3.1.0: + resolution: {integrity: sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==} + structured-headers@0.4.1: resolution: {integrity: sha512-0MP/Cxx5SzeeZ10p/bZI0S6MpgD+yxAhi1BOQ34jgnMXsCq3j1t6tQnZu+KdlL7dvJTLT3g9xN8tl10TqgFMcg==} + styleq@0.1.3: + resolution: {integrity: sha512-3ZUifmCDCQanjeej1f6kyl/BeP/Vae5EYkQ9iJfUm/QwZvlgnZzyflqAsAWYURdtea8Vkvswu2GrC57h3qffcA==} + supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -2265,10 +2613,28 @@ packages: throat@5.0.0: resolution: {integrity: sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==} + tinybench@2.9.0: + resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} + + tinyexec@0.3.2: + resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} + tinyglobby@0.2.17: resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} engines: {node: '>=12.0.0'} + tinypool@1.1.1: + resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} + engines: {node: ^18.0.0 || >=20.0.0} + + tinyrainbow@2.0.0: + resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} + engines: {node: '>=14.0.0'} + + tinyspy@4.0.6: + resolution: {integrity: sha512-u8KszXvGfU68hVcZpRHKG28T0krMuv2G5nDhiHaMLen/gIuFEgIJhaJuO69qjnXg5paSrbPMFfx3brNuN8eVSg==} + engines: {node: '>=14.0.0'} + tmpl@1.0.5: resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} @@ -2283,6 +2649,9 @@ packages: toqr@0.1.1: resolution: {integrity: sha512-FWAPzCIHZHnrE/5/w9MPk0kK25hSQSH2IKhYh9PyjS3SG/+IEMvlwIHbhz+oF7xl54I+ueZlVnMjyzdSwLmAwA==} + tr46@0.0.3: + resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + turbo@2.10.13: resolution: {integrity: sha512-69MkPbjk+G8oyC7pC2DeBk0rPdbLz51wuH5eAT0Q4BVJkzq/b1XM4kUUidsARbmDjwIELSJwd1ezITULY9kWNw==} hasBin: true @@ -2300,6 +2669,10 @@ packages: engines: {node: '>=14.17'} hasBin: true + ua-parser-js@1.0.41: + resolution: {integrity: sha512-LbBDqdIC5s8iROCUjMbW1f5dJQTEFB1+KO9ogbvlb3nm9n4YHa5p4KTvFPWvh2Hs8gZMBuiB1/8+pdfe/tDPug==} + hasBin: true + undici-types@6.21.0: resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} @@ -2346,6 +2719,79 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} + vite-node@3.2.4: + resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + + vite@7.3.6: + resolution: {integrity: sha512-4XP60spRGjSZFf1qYH+dJIkK2znL3zQfl9KkOV9MkkRR/3Dls0dxaBsQPTloEc5BLXWPL9vsOxopxyKoMmDueg==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + jiti: '>=1.21.0' + less: ^4.0.0 + lightningcss: ^1.21.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + vitest@3.2.7: + resolution: {integrity: sha512-KrxIJ62Fd89gfysR4WotlgZABiz2dqFPgqGzX7s+CwsqLFomRH7777ZcrOD6+WVAh7khPQP41A+BKbpcJFrdEg==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@types/debug': ^4.1.12 + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + '@vitest/browser': 3.2.7 + '@vitest/ui': 3.2.7 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@types/debug': + optional: true + '@types/node': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + vlq@1.0.1: resolution: {integrity: sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==} @@ -2355,17 +2801,28 @@ packages: wcwidth@1.0.1: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} + webidl-conversions@3.0.1: + resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + whatwg-fetch@3.6.20: resolution: {integrity: sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==} whatwg-url-minimum@0.1.2: resolution: {integrity: sha512-XPEm0XFQWNVG292lII1PrRRJl3sItrs7CettZ4ncYxuDVpLyy+NwlGyut2hXI0JswcJUxeCH+CyOJK0ZzAXD6A==} + whatwg-url@5.0.0: + resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} hasBin: true + why-is-node-running@2.3.0: + resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} + engines: {node: '>=8'} + hasBin: true + wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -2979,7 +3436,7 @@ snapshots: '@esbuild/win32-x64@0.27.0': optional: true - '@expo/cli@57.0.25(@expo/dom-webview@57.0.1)(expo-constants@57.0.18(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3)))(expo-font@57.0.4(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3))(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3)': + '@expo/cli@57.0.25(@expo/dom-webview@57.0.1)(expo-constants@57.0.18(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3)))(expo-font@57.0.4(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3))(expo@57.0.23)(react-dom@19.2.3(react@19.2.3))(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3)': dependencies: '@expo/code-signing-certificates': 0.0.6 '@expo/config': 57.0.9(typescript@6.0.3) @@ -2998,7 +3455,7 @@ snapshots: '@expo/plist': 0.8.1 '@expo/prebuild-config': 57.0.16(typescript@6.0.3) '@expo/require-utils': 57.0.5(typescript@6.0.3) - '@expo/router-server': 57.0.10(expo-constants@57.0.18(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3)))(expo-font@57.0.4(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3))(expo-server@57.0.3)(expo@57.0.23)(react@19.2.3) + '@expo/router-server': 57.0.10(expo-constants@57.0.18(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3)))(expo-font@57.0.4(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3))(expo-server@57.0.3)(expo@57.0.23)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) '@expo/schema-utils': 57.0.2 '@expo/spawn-async': 1.8.0 '@expo/ws-tunnel': 2.0.0(ws@8.21.3) @@ -3015,7 +3472,7 @@ snapshots: connect: 3.7.0 debug: 4.4.3 dnssd-advertise: 1.1.6 - expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) + expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-dom@19.2.3(react@19.2.3))(react-native-web@0.21.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) expo-server: 57.0.3 fetch-nodeshim: 0.4.10 getenv: 2.0.0 @@ -3113,7 +3570,7 @@ snapshots: '@expo/dom-webview@57.0.1(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)': dependencies: - expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) + expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-dom@19.2.3(react@19.2.3))(react-native-web@0.21.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) react: 19.2.3 react-native: 0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3) @@ -3180,7 +3637,7 @@ snapshots: dependencies: '@expo/dom-webview': 57.0.1(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3) anser: 1.4.10 - expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) + expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-dom@19.2.3(react@19.2.3))(react-native-web@0.21.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) react: 19.2.3 react-native: 0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3) stacktrace-parser: 0.1.11 @@ -3211,7 +3668,7 @@ snapshots: postcss: 8.5.28 resolve-from: 5.0.0 optionalDependencies: - expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) + expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-dom@19.2.3(react@19.2.3))(react-native-web@0.21.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) transitivePeerDependencies: - bufferutil - supports-color @@ -3295,14 +3752,16 @@ snapshots: transitivePeerDependencies: - supports-color - '@expo/router-server@57.0.10(expo-constants@57.0.18(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3)))(expo-font@57.0.4(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3))(expo-server@57.0.3)(expo@57.0.23)(react@19.2.3)': + '@expo/router-server@57.0.10(expo-constants@57.0.18(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3)))(expo-font@57.0.4(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3))(expo-server@57.0.3)(expo@57.0.23)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': dependencies: debug: 4.4.3 - expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) + expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-dom@19.2.3(react@19.2.3))(react-native-web@0.21.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) expo-constants: 57.0.18(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3)) expo-font: 57.0.4(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3) expo-server: 57.0.3 react: 19.2.3 + optionalDependencies: + react-dom: 19.2.3(react@19.2.3) transitivePeerDependencies: - supports-color @@ -3365,6 +3824,9 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.6.0 + '@napi-rs/lzma-linux-x64-gnu@1.5.1': + optional: true + '@react-native/assets-registry@0.86.3': {} '@react-native/babel-plugin-codegen@0.86.3(@babel/core@7.29.7)': @@ -3432,6 +3894,8 @@ snapshots: '@react-native/js-polyfills@0.86.3': {} + '@react-native/normalize-colors@0.74.89': {} + '@react-native/normalize-colors@0.86.3': {} '@react-native/virtualized-lists@0.86.3(@types/react@19.2.18)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)': @@ -3443,6 +3907,81 @@ snapshots: optionalDependencies: '@types/react': 19.2.18 + '@rollup/rollup-android-arm-eabi@4.63.3': + optional: true + + '@rollup/rollup-android-arm64@4.63.3': + optional: true + + '@rollup/rollup-darwin-arm64@4.63.3': + optional: true + + '@rollup/rollup-darwin-x64@4.63.3': + optional: true + + '@rollup/rollup-freebsd-arm64@4.63.3': + optional: true + + '@rollup/rollup-freebsd-x64@4.63.3': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.63.3': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.63.3': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.63.3': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.63.3': + optional: true + + '@rollup/rollup-linux-loong64-gnu@4.63.3': + optional: true + + '@rollup/rollup-linux-loong64-musl@4.63.3': + optional: true + + '@rollup/rollup-linux-ppc64-gnu@4.63.3': + optional: true + + '@rollup/rollup-linux-ppc64-musl@4.63.3': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.63.3': + optional: true + + '@rollup/rollup-linux-riscv64-musl@4.63.3': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.63.3': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.63.3': + optional: true + + '@rollup/rollup-linux-x64-musl@4.63.3': + optional: true + + '@rollup/rollup-openbsd-x64@4.63.3': + optional: true + + '@rollup/rollup-openharmony-arm64@4.63.3': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.63.3': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.63.3': + optional: true + + '@rollup/rollup-win32-x64-gnu@4.63.3': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.63.3': + optional: true + '@sinclair/typebox@0.27.12': {} '@turbo/darwin-64@2.10.13': @@ -3467,6 +4006,15 @@ snapshots: dependencies: bun-types: 1.4.2 + '@types/chai@5.2.3': + dependencies: + '@types/deep-eql': 4.0.2 + assertion-error: 2.0.1 + + '@types/deep-eql@4.0.2': {} + + '@types/estree@1.0.9': {} + '@types/istanbul-lib-coverage@2.0.6': {} '@types/istanbul-lib-report@3.0.3': @@ -3493,6 +4041,48 @@ snapshots: '@ungap/structured-clone@1.4.0': {} + '@vitest/expect@3.2.7': + dependencies: + '@types/chai': 5.2.3 + '@vitest/spy': 3.2.7 + '@vitest/utils': 3.2.7 + chai: 5.3.3 + tinyrainbow: 2.0.0 + + '@vitest/mocker@3.2.7(vite@7.3.6(@types/node@20.19.43)(lightningcss@1.33.0)(terser@5.51.2)(yaml@2.9.1))': + dependencies: + '@vitest/spy': 3.2.7 + estree-walker: 3.0.3 + magic-string: 0.30.21 + optionalDependencies: + vite: 7.3.6(@types/node@20.19.43)(lightningcss@1.33.0)(terser@5.51.2)(yaml@2.9.1) + + '@vitest/pretty-format@3.2.7': + dependencies: + tinyrainbow: 2.0.0 + + '@vitest/runner@3.2.7': + dependencies: + '@vitest/utils': 3.2.7 + pathe: 2.0.3 + strip-literal: 3.1.0 + + '@vitest/snapshot@3.2.7': + dependencies: + '@vitest/pretty-format': 3.2.7 + magic-string: 0.30.21 + pathe: 2.0.3 + + '@vitest/spy@3.2.7': + dependencies: + tinyspy: 4.0.6 + + '@vitest/utils@3.2.7': + dependencies: + '@vitest/pretty-format': 3.2.7 + loupe: 3.2.1 + tinyrainbow: 2.0.0 + '@xmldom/xmldom@0.8.15': {} '@xmldom/xmldom@0.9.12': {} @@ -3543,6 +4133,8 @@ snapshots: asap@2.0.6: {} + assertion-error@2.0.1: {} + babel-plugin-polyfill-corejs2@0.4.17(@babel/core@7.29.7): dependencies: '@babel/compat-data': 7.29.7 @@ -3634,7 +4226,7 @@ snapshots: react-refresh: 0.14.2 optionalDependencies: '@babel/runtime': 7.29.7 - expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) + expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-dom@19.2.3(react@19.2.3))(react-native-web@0.21.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) transitivePeerDependencies: - '@babel/core' - supports-color @@ -3687,10 +4279,20 @@ snapshots: bytes@3.1.2: {} + cac@6.7.14: {} + camelcase@6.3.0: {} caniuse-lite@1.0.30001810: {} + chai@5.3.3: + dependencies: + assertion-error: 2.0.1 + check-error: 2.1.3 + deep-eql: 5.0.2 + loupe: 3.2.1 + pathval: 2.0.1 + chalk@2.4.2: dependencies: ansi-styles: 3.2.1 @@ -3702,6 +4304,8 @@ snapshots: ansi-styles: 4.3.0 supports-color: 7.2.0 + check-error@2.1.3: {} + chrome-launcher@0.15.2: dependencies: '@types/node': 20.19.43 @@ -3802,12 +4406,22 @@ snapshots: dependencies: browserslist: 4.29.0 + cross-fetch@3.2.0: + dependencies: + node-fetch: 2.7.0 + transitivePeerDependencies: + - encoding + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 which: 2.0.2 + css-in-js-utils@3.1.0: + dependencies: + hyphenate-style-name: 1.1.0 + csstype@3.2.3: {} debug@2.6.9: @@ -3822,6 +4436,8 @@ snapshots: dependencies: ms: 2.1.3 + deep-eql@5.0.2: {} + deepmerge@4.3.1: {} defaults@1.0.4: @@ -3854,6 +4470,8 @@ snapshots: es-errors@1.3.0: {} + es-module-lexer@1.7.0: {} + esbuild@0.27.0: optionalDependencies: '@esbuild/aix-ppc64': 0.27.0 @@ -3891,14 +4509,20 @@ snapshots: escape-string-regexp@4.0.0: {} + estree-walker@3.0.3: + dependencies: + '@types/estree': 1.0.9 + etag@1.8.1: {} event-target-shim@5.0.1: {} + expect-type@1.4.0: {} + expo-asset@57.0.17(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3): dependencies: '@expo/image-utils': 0.11.5(typescript@6.0.3) - expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) + expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-dom@19.2.3(react@19.2.3))(react-native-web@0.21.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) expo-constants: 57.0.18(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3)) react: 19.2.3 react-native: 0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3) @@ -3909,26 +4533,26 @@ snapshots: expo-constants@57.0.18(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3)): dependencies: '@expo/env': 2.4.3 - expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) + expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-dom@19.2.3(react@19.2.3))(react-native-web@0.21.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) react-native: 0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3) transitivePeerDependencies: - supports-color expo-file-system@57.0.7(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3)): dependencies: - expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) + expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-dom@19.2.3(react@19.2.3))(react-native-web@0.21.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) react-native: 0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3) expo-font@57.0.4(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3): dependencies: - expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) + expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-dom@19.2.3(react@19.2.3))(react-native-web@0.21.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) fontfaceobserver: 2.3.0 react: 19.2.3 react-native: 0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3) expo-keep-awake@57.0.2(expo@57.0.23)(react@19.2.3): dependencies: - expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) + expo: 57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-dom@19.2.3(react@19.2.3))(react-native-web@0.21.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) react: 19.2.3 expo-modules-autolinking@57.0.13(typescript@6.0.3): @@ -3955,10 +4579,10 @@ snapshots: expo-server@57.0.3: {} - expo@57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3): + expo@57.0.23(@babel/core@7.29.7)(@expo/dom-webview@57.0.1)(react-dom@19.2.3(react@19.2.3))(react-native-web@0.21.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3): dependencies: '@babel/runtime': 7.29.7 - '@expo/cli': 57.0.25(@expo/dom-webview@57.0.1)(expo-constants@57.0.18(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3)))(expo-font@57.0.4(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3))(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) + '@expo/cli': 57.0.25(@expo/dom-webview@57.0.1)(expo-constants@57.0.18(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3)))(expo-font@57.0.4(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3))(expo@57.0.23)(react-dom@19.2.3(react@19.2.3))(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3)(typescript@6.0.3) '@expo/config': 57.0.9(typescript@6.0.3) '@expo/config-plugins': 57.0.9(typescript@6.0.3) '@expo/devtools': 57.0.1(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3) @@ -3983,6 +4607,8 @@ snapshots: whatwg-url-minimum: 0.1.2 optionalDependencies: '@expo/dom-webview': 57.0.1(expo@57.0.23)(react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3))(react@19.2.3) + react-dom: 19.2.3(react@19.2.3) + react-native-web: 0.21.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3) transitivePeerDependencies: - '@babel/core' - bufferutil @@ -4002,6 +4628,20 @@ snapshots: dependencies: bser: 2.1.1 + fbjs-css-vars@1.0.2: {} + + fbjs@3.0.5: + dependencies: + cross-fetch: 3.2.0 + fbjs-css-vars: 1.0.2 + loose-envify: 1.4.0 + object-assign: 4.1.1 + promise: 7.3.1 + setimmediate: 1.0.5 + ua-parser-js: 1.0.41 + transitivePeerDependencies: + - encoding + fdir@6.5.0(picomatch@4.0.7): optionalDependencies: picomatch: 4.0.7 @@ -4030,6 +4670,9 @@ snapshots: fresh@0.5.2: {} + fsevents@2.3.3: + optional: true + function-bind@1.1.2: {} gensync@1.0.0-beta.2: {} @@ -4093,10 +4736,16 @@ snapshots: transitivePeerDependencies: - supports-color + hyphenate-style-name@1.1.0: {} + ignore@5.3.2: {} inherits@2.0.4: {} + inline-style-prefixer@7.0.1: + dependencies: + css-in-js-utils: 3.1.0 + invariant@2.2.4: dependencies: loose-envify: 1.4.0 @@ -4148,6 +4797,8 @@ snapshots: js-tokens@4.0.0: {} + js-tokens@9.0.1: {} + js-yaml@4.3.2: dependencies: argparse: 2.0.1 @@ -4232,6 +4883,8 @@ snapshots: dependencies: js-tokens: 4.0.0 + loupe@3.2.1: {} + lru-cache@10.4.3: {} lru-cache@11.5.2: {} @@ -4240,6 +4893,10 @@ snapshots: dependencies: yallist: 3.1.1 + magic-string@0.30.21: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + makeerror@1.0.12: dependencies: tmpl: 1.0.5 @@ -4248,6 +4905,8 @@ snapshots: memoize-one@5.2.1: {} + memoize-one@6.0.0: {} + merge-stream@2.0.0: {} metro-babel-transformer@0.84.5: @@ -4641,6 +5300,10 @@ snapshots: dependencies: content-type: 2.1.0 + node-fetch@2.7.0: + dependencies: + whatwg-url: 5.0.0 + node-forge@1.4.0: {} node-int64@0.4.0: {} @@ -4664,6 +5327,8 @@ snapshots: dependencies: flow-enums-runtime: 0.0.6 + object-assign@4.1.1: {} + on-finished@2.3.0: dependencies: ee-first: 1.1.1 @@ -4707,6 +5372,10 @@ snapshots: lru-cache: 11.5.2 minipass: 7.1.3 + pathe@2.0.3: {} + + pathval@2.0.1: {} + picocolors@1.1.1: {} picomatch@2.3.2: {} @@ -4721,6 +5390,8 @@ snapshots: pngjs@3.4.0: {} + postcss-value-parser@4.2.0: {} + postcss@8.5.28: dependencies: nanoid: 3.3.19 @@ -4739,6 +5410,10 @@ snapshots: progress@2.0.3: {} + promise@7.3.1: + dependencies: + asap: 2.0.6 + promise@8.3.0: dependencies: asap: 2.0.6 @@ -4758,8 +5433,28 @@ snapshots: - bufferutil - utf-8-validate + react-dom@19.2.3(react@19.2.3): + dependencies: + react: 19.2.3 + scheduler: 0.27.0 + react-is@18.3.1: {} + react-native-web@0.21.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3): + dependencies: + '@babel/runtime': 7.29.7 + '@react-native/normalize-colors': 0.74.89 + fbjs: 3.0.5 + inline-style-prefixer: 7.0.1 + memoize-one: 6.0.0 + nullthrows: 1.1.1 + postcss-value-parser: 4.2.0 + react: 19.2.3 + react-dom: 19.2.3(react@19.2.3) + styleq: 0.1.3 + transitivePeerDependencies: + - encoding + react-native@0.86.3(@babel/core@7.29.7)(@types/react@19.2.18)(react@19.2.3): dependencies: '@react-native/assets-registry': 0.86.3 @@ -4850,6 +5545,38 @@ snapshots: onetime: 2.0.1 signal-exit: 3.0.7 + rollup@4.63.3: + dependencies: + '@types/estree': 1.0.9 + optionalDependencies: + '@napi-rs/lzma-linux-x64-gnu': 1.5.1 + '@rollup/rollup-android-arm-eabi': 4.63.3 + '@rollup/rollup-android-arm64': 4.63.3 + '@rollup/rollup-darwin-arm64': 4.63.3 + '@rollup/rollup-darwin-x64': 4.63.3 + '@rollup/rollup-freebsd-arm64': 4.63.3 + '@rollup/rollup-freebsd-x64': 4.63.3 + '@rollup/rollup-linux-arm-gnueabihf': 4.63.3 + '@rollup/rollup-linux-arm-musleabihf': 4.63.3 + '@rollup/rollup-linux-arm64-gnu': 4.63.3 + '@rollup/rollup-linux-arm64-musl': 4.63.3 + '@rollup/rollup-linux-loong64-gnu': 4.63.3 + '@rollup/rollup-linux-loong64-musl': 4.63.3 + '@rollup/rollup-linux-ppc64-gnu': 4.63.3 + '@rollup/rollup-linux-ppc64-musl': 4.63.3 + '@rollup/rollup-linux-riscv64-gnu': 4.63.3 + '@rollup/rollup-linux-riscv64-musl': 4.63.3 + '@rollup/rollup-linux-s390x-gnu': 4.63.3 + '@rollup/rollup-linux-x64-gnu': 4.63.3 + '@rollup/rollup-linux-x64-musl': 4.63.3 + '@rollup/rollup-openbsd-x64': 4.63.3 + '@rollup/rollup-openharmony-arm64': 4.63.3 + '@rollup/rollup-win32-arm64-msvc': 4.63.3 + '@rollup/rollup-win32-ia32-msvc': 4.63.3 + '@rollup/rollup-win32-x64-gnu': 4.63.3 + '@rollup/rollup-win32-x64-msvc': 4.63.3 + fsevents: 2.3.3 + safe-buffer@5.2.1: {} sandbox-cli-detector@0.2.0: {} @@ -4891,6 +5618,8 @@ snapshots: transitivePeerDependencies: - supports-color + setimmediate@1.0.5: {} + setprototypeof@1.2.0: {} shebang-command@2.0.0: @@ -4901,6 +5630,8 @@ snapshots: shell-quote@1.10.0: {} + siginfo@2.0.0: {} + signal-exit@3.0.7: {} simple-plist@1.3.1: @@ -4924,6 +5655,8 @@ snapshots: source-map@0.6.1: {} + stackback@0.0.2: {} + stackframe@1.3.4: {} stacktrace-parser@0.1.11: @@ -4934,6 +5667,8 @@ snapshots: statuses@2.0.2: {} + std-env@3.10.0: {} + stream-buffers@2.2.0: {} string-width@4.2.3: @@ -4950,8 +5685,14 @@ snapshots: dependencies: ansi-regex: 5.0.1 + strip-literal@3.1.0: + dependencies: + js-tokens: 9.0.1 + structured-headers@0.4.1: {} + styleq@0.1.3: {} + supports-color@5.5.0: dependencies: has-flag: 3.0.0 @@ -4985,11 +5726,21 @@ snapshots: throat@5.0.0: {} + tinybench@2.9.0: {} + + tinyexec@0.3.2: {} + tinyglobby@0.2.17: dependencies: fdir: 6.5.0(picomatch@4.0.7) picomatch: 4.0.7 + tinypool@1.1.1: {} + + tinyrainbow@2.0.0: {} + + tinyspy@4.0.6: {} + tmpl@1.0.5: {} to-regex-range@5.0.1: @@ -5000,6 +5751,8 @@ snapshots: toqr@0.1.1: {} + tr46@0.0.3: {} + turbo@2.10.13: optionalDependencies: '@turbo/darwin-64': 2.10.13 @@ -5015,6 +5768,8 @@ snapshots: typescript@6.0.3: {} + ua-parser-js@1.0.41: {} + undici-types@6.21.0: {} unicode-canonical-property-names-ecmascript@2.0.1: {} @@ -5044,6 +5799,83 @@ snapshots: vary@1.1.2: {} + vite-node@3.2.4(@types/node@20.19.43)(lightningcss@1.33.0)(terser@5.51.2)(yaml@2.9.1): + dependencies: + cac: 6.7.14 + debug: 4.4.3 + es-module-lexer: 1.7.0 + pathe: 2.0.3 + vite: 7.3.6(@types/node@20.19.43)(lightningcss@1.33.0)(terser@5.51.2)(yaml@2.9.1) + transitivePeerDependencies: + - '@types/node' + - jiti + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + + vite@7.3.6(@types/node@20.19.43)(lightningcss@1.33.0)(terser@5.51.2)(yaml@2.9.1): + dependencies: + esbuild: 0.27.0 + fdir: 6.5.0(picomatch@4.0.7) + picomatch: 4.0.7 + postcss: 8.5.28 + rollup: 4.63.3 + tinyglobby: 0.2.17 + optionalDependencies: + '@types/node': 20.19.43 + fsevents: 2.3.3 + lightningcss: 1.33.0 + terser: 5.51.2 + yaml: 2.9.1 + + vitest@3.2.7(@types/node@20.19.43)(lightningcss@1.33.0)(terser@5.51.2)(yaml@2.9.1): + dependencies: + '@types/chai': 5.2.3 + '@vitest/expect': 3.2.7 + '@vitest/mocker': 3.2.7(vite@7.3.6(@types/node@20.19.43)(lightningcss@1.33.0)(terser@5.51.2)(yaml@2.9.1)) + '@vitest/pretty-format': 3.2.7 + '@vitest/runner': 3.2.7 + '@vitest/snapshot': 3.2.7 + '@vitest/spy': 3.2.7 + '@vitest/utils': 3.2.7 + chai: 5.3.3 + debug: 4.4.3 + expect-type: 1.4.0 + magic-string: 0.30.21 + pathe: 2.0.3 + picomatch: 4.0.7 + std-env: 3.10.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinyglobby: 0.2.17 + tinypool: 1.1.1 + tinyrainbow: 2.0.0 + vite: 7.3.6(@types/node@20.19.43)(lightningcss@1.33.0)(terser@5.51.2)(yaml@2.9.1) + vite-node: 3.2.4(@types/node@20.19.43)(lightningcss@1.33.0)(terser@5.51.2)(yaml@2.9.1) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 20.19.43 + transitivePeerDependencies: + - jiti + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + vlq@1.0.1: {} walker@1.0.8: @@ -5054,14 +5886,26 @@ snapshots: dependencies: defaults: 1.0.4 + webidl-conversions@3.0.1: {} + whatwg-fetch@3.6.20: {} whatwg-url-minimum@0.1.2: {} + whatwg-url@5.0.0: + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + which@2.0.2: dependencies: isexe: 2.0.0 + why-is-node-running@2.3.0: + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 + wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0