mattrguerra/meridian-ops-boardmainPrivate on GitHub, published here in full

briefings.ts

Language TypeScript1.9 KB48 lines

apps/dashboard/src/briefings.ts

  1. /**
  2. * The shape of the model-written briefings. Type only, runtime-neutral.
  3. *
  4. * Split from briefings-file.ts because the Cloudflare Worker imports the
  5. * renderer, the renderer needs this type, and a file containing a static
  6. * `node:fs` import fails the Worker typecheck even when only its type is
  7. * imported (rule 7). See also history-file.ts.
  8. */
  9. /**
  10. * Two `generatedAt` fields, on types one letter apart, with opposite
  11. * requirements:
  12. *
  13. * Briefings.generatedAt (here) a raw UTC ISO string, written by
  14. * analysis/brief.py. Must be formatted before
  15. * a reader sees it.
  16. * Briefing.generatedAt (view-model.ts) already formatted in MERIDIAN_TZ.
  17. * Rendering it again would be wrong.
  18. *
  19. * Slicing this one raw shows a Chicago reader a UTC clock time. Anything
  20. * reading this field goes through localStamp/localClock; anything reading the
  21. * view-model's does not.
  22. */
  23. export interface Briefings {
  24. generatedAt: string
  25. day: string | null
  26. model: string
  27. /** The sync these were written from. Used to detect a stale pairing. */
  28. payloadGeneratedAt: string | null
  29. mode: 'live' | 'fixtures' | null
  30. /**
  31. * Keyed by 'company', 'exec', or a person's roster name. Absent keys simply
  32. * mean that briefing has not been generated today.
  33. */
  34. briefings: Record<string, string>
  35. /**
  36. * Which of the above were cut off at the model's output limit.
  37. *
  38. * The page needs to know: a truncated briefing is still worth reading (it is
  39. * most of a briefing), but rendered unlabelled it is indistinguishable from a
  40. * finished one. Same rule as everywhere else here: broken must not look like
  41. * fine.
  42. *
  43. * Optional because an older briefings.json has no such list, and an absent list means "nothing known to be truncated", not
  44. * that the question was never asked.
  45. */
  46. truncated?: string[]
  47. }