@fifthbell/brokaw 0.1.63 → 0.1.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -3
- package/dist/components/live-program/LiveProgram.d.ts +1 -1
- package/dist/components/live-program/LiveProgram.js +56 -48
- package/dist/components/live-program/hooks/useSSE.d.ts +4 -2
- package/dist/components/live-program/hooks/useSSE.js +12 -4
- package/dist/components/live-program/program-contract.d.ts +50 -0
- package/dist/components/live-program/program-contract.js +140 -0
- package/dist/cronkite-manifest.d.ts +80 -0
- package/dist/cronkite-manifest.js +124 -0
- package/dist/cronkite-manifest.json +139 -0
- package/dist/json-schema-formats.d.ts +2 -0
- package/dist/json-schema-formats.js +19 -0
- package/dist/layouts.d.ts +13 -0
- package/dist/layouts.js +12 -0
- package/dist/live-program/main.d.ts +8 -0
- package/dist/live-program/main.js +5 -1
- package/dist/live-program-page/fifthbell/fonts/LDIcapOFNxEwR-Bd1O9uYNmnUQomAgE25imKSbHhROjLsZBWTSrQGD_jZtU.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/LDIcapOFNxEwR-Bd1O9uYNmnUQomAgE25imKSbHhROjLsZBWTSrQGFPjZtU.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/LDIcapOFNxEwR-Bd1O9uYNmnUQomAgE25imKSbHhROjLsZBWTSrQGGHiZtU.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/LDIcapOFNxEwR-Bd1O9uYNmnUQomAgE25imKSbHhROjLsZBWTSrQGGHjZtU.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/LDIcapOFNxEwR-Bd1O9uYNmnUQomAgE25imKSbHhROjLsZBWTSrQGIbkZtU.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/LDIcapOFNxEwR-Bd1O9uYNmnUQomAgE25imKSbHhROjLsZBWTSrQGL_kZtU.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/LDIcapOFNxEwR-Bd1O9uYNmnUQomAgE25imKSbHhROjLsZBWTSrQGMjkZtU.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/LDIcapOFNxEwR-Bd1O9uYNmnUQomAgE25imKSbHhROjLsZBWTSrQGOHjZtU.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/LDIcapOFNxEwR-Bd1O9uYNmnUQomAgE25imKSbHhROjLsZBWTSrQGOHkZtU.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/SlGDmQSNjdsmc35JDF1K5E55YMjF_7DPuGi-2fRUAw.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/SlGDmQSNjdsmc35JDF1K5E55YMjF_7DPuGi-6_RUAw.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/SlGDmQSNjdsmc35JDF1K5E55YMjF_7DPuGi-DPNUAw.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/SlGDmQSNjdsmc35JDF1K5E55YMjF_7DPuGi-NfNUAw.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/SlGDmQSNjdsmc35JDF1K5E55YMjF_7DPuGi-a_NUAw.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/SlGFmQSNjdsmc35JDF1K5GRwUjcdlttVFm-rI7c8R496.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/SlGFmQSNjdsmc35JDF1K5GRwUjcdlttVFm-rI7dbR496.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/SlGFmQSNjdsmc35JDF1K5GRwUjcdlttVFm-rI7diR496.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/SlGFmQSNjdsmc35JDF1K5GRwUjcdlttVFm-rI7e8QI96.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/SlGFmQSNjdsmc35JDF1K5GRwUjcdlttVFm-rI7eOQI96.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/TK3_WkUHHAIjg75cFRf3bXL8LICs13FvgUE.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/TK3_WkUHHAIjg75cFRf3bXL8LICs169vgUE.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/TK3_WkUHHAIjg75cFRf3bXL8LICs18NvgUE.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/TK3_WkUHHAIjg75cFRf3bXL8LICs1_FvgUE.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/TK3_WkUHHAIjg75cFRf3bXL8LICs1xZogUE.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/TK3_WkUHHAIjg75cFRf3bXL8LICs1y9ogUE.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/j8_16_LD37rqfuwxyIuaZhE6cRXOLtm2gfTGgQ.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/j8_46_LD37rqfuwxyIuaZhE6cRXOLtm2gfT-BYipBw.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/j8_46_LD37rqfuwxyIuaZhE6cRXOLtm2gfT-IYmpBw.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/j8_46_LD37rqfuwxyIuaZhE6cRXOLtm2gfT-PYqpBw.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/j8_46_LD37rqfuwxyIuaZhE6cRXOLtm2gfT-WYupBw.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/jizMREVItHgc8qDIbSTKq4XkRiUawTk7f45UM9y05oYiRNDM.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/jizMREVItHgc8qDIbSTKq4XkRiUawTk7f45UM9y05oZ8RNDM.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/jizMREVItHgc8qDIbSTKq4XkRiUawTk7f45UM9y05oZ8RdDM.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/jizMREVItHgc8qDIbSTKq4XkRiUawTk7f45UM9y05oZORNDM.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/jizMREVItHgc8qDIbSTKq4XkRiUawTk7f45UM9y05oabQ9DM.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/jizMREVItHgc8qDIbSTKq4XkRiUawTk7f45UM9y05oaiQ9DM.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/jizMREVItHgc8qDIbSTKq4XkRiUawTk7f45UM9y05ob8Q9DM.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/jizMREVItHgc8qDIbSTKq4XkRiUawTk7f45UM9y05ob8RNDM.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/jizMREVItHgc8qDIbSTKq4XkRiUawTk7f45UM9y05obVQ9DM.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/jizOREVItHgc8qDIbSTKq4XkRg8T88bjFuXOnduh8MKUBw.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/jizOREVItHgc8qDIbSTKq4XkRg8T88bjFuXOnduhHMWUBw.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/jizOREVItHgc8qDIbSTKq4XkRg8T88bjFuXOnduhLsSUBw.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/jizOREVItHgc8qDIbSTKq4XkRg8T88bjFuXOnduhLsWUBw.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/jizOREVItHgc8qDIbSTKq4XkRg8T88bjFuXOnduhcMWUBw.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/jizOREVItHgc8qDIbSTKq4XkRg8T88bjFuXOnduhh8KUBw.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/jizOREVItHgc8qDIbSTKq4XkRg8T88bjFuXOnduhrsKUBw.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/jizOREVItHgc8qDIbSTKq4XkRg8T88bjFuXOnduhrsWUBw.ttf +0 -0
- package/dist/live-program-page/fifthbell/fonts/jizOREVItHgc8qDIbSTKq4XkRg8T88bjFuXOnduhycKUBw.ttf +0 -0
- package/dist/live-program-page/index.html +2 -5
- package/dist/live-program-page/live-program-manifest.json +408 -0
- package/dist/live-program-page/live-program.v0.1.66.css +3 -0
- package/dist/live-program-page/live-program.v0.1.66.js +76 -0
- package/dist/live-program-release.d.ts +3 -0
- package/dist/live-program-release.js +76 -0
- package/dist/manifest-validation.d.ts +10 -0
- package/dist/manifest-validation.js +27 -0
- package/dist/program-template-manifest.d.ts +22 -0
- package/dist/program-template-manifest.js +49 -0
- package/dist/renderer.browser.js +5 -1
- package/dist/renderer.core.d.ts +2 -1
- package/dist/renderer.core.js +4 -1
- package/dist/renderer.d.ts +6 -0
- package/dist/renderer.js +3 -0
- package/dist/renderer.node.js +16 -14
- package/dist/rum.d.ts +18 -0
- package/dist/rum.js +113 -0
- package/dist/schemas/canonical-document.schema.json +1071 -0
- package/dist/schemas/cronkite-manifest.schema.json +501 -0
- package/dist/schemas/feed-renderable-input.schema.json +16 -0
- package/dist/schemas/live-program-release-input.schema.json +34 -0
- package/dist/types/canonical-article.d.ts +8 -254
- package/dist/types/canonical-article.js +21 -242
- package/dist/types/canonical-document-schema.generated.d.ts +1634 -0
- package/dist/types/canonical-document-schema.generated.js +1730 -0
- package/dist/types/canonical-document.generated.d.ts +541 -0
- package/dist/types/canonical-document.generated.js +3 -0
- package/dist/types/cronkite-manifest.generated.d.ts +339 -0
- package/dist/types/cronkite-manifest.generated.js +3 -0
- package/dist/types/live-program-release-input.generated.d.ts +5 -0
- package/dist/types/live-program-release-input.generated.js +3 -0
- package/dist/video/Root.d.ts +1 -0
- package/dist/video/Root.js +40 -0
- package/dist/video/ShortVideo.d.ts +3 -0
- package/dist/video/ShortVideo.js +92 -0
- package/dist/video/index.d.ts +2 -0
- package/dist/video/index.js +4 -0
- package/dist/video/types.d.ts +37 -0
- package/dist/video/types.js +1 -0
- package/package.json +19 -4
- package/src/styles/compiled.css +1 -1
- package/src/templates/layouts/standalone-page.hbs +5 -0
- package/src/templates/partials/components/standalone-main.hbs +28 -0
- package/src/templates/partials/shell/doc-start-404.hbs +1 -14
- package/src/templates/partials/shell/doc-start-standard.hbs +1 -14
- package/dist/live-program-page/live-program.css +0 -3
- package/dist/live-program-page/live-program.js +0 -76
package/README.md
CHANGED
|
@@ -5,8 +5,12 @@ Server-side renderer and Handlebars template bundle for fifthbell pages.
|
|
|
5
5
|
## What it does
|
|
6
6
|
|
|
7
7
|
- Renders canonical content documents into HTML
|
|
8
|
-
- Supports
|
|
8
|
+
- Supports every layout declared by the packaged Cronkite manifest, including
|
|
9
|
+
article, homepage, category, search, 404, live-story, link-in-bio, media, and
|
|
10
|
+
standalone pages
|
|
9
11
|
- Ships reusable Handlebars templates, partial dependency metadata, and compiled CSS
|
|
12
|
+
- Ships the complete Fifthbell live-program page, renderer media, local fonts, and a versioned integrity manifest
|
|
13
|
+
- Ships a CLS-owned social-image renderable and provider-neutral Remotion short-video renderable
|
|
10
14
|
|
|
11
15
|
## Installation
|
|
12
16
|
|
|
@@ -17,18 +21,73 @@ npm install @fifthbell/brokaw
|
|
|
17
21
|
## Basic usage
|
|
18
22
|
|
|
19
23
|
```ts
|
|
20
|
-
import { render } from
|
|
24
|
+
import { render } from "@fifthbell/brokaw";
|
|
21
25
|
|
|
22
26
|
const html = render(doc);
|
|
23
27
|
```
|
|
24
28
|
|
|
25
|
-
`doc` must match the canonical schema
|
|
29
|
+
`doc` must match the normative canonical schema in
|
|
30
|
+
[src/schemas/canonical-document.schema.json](src/schemas/canonical-document.schema.json).
|
|
31
|
+
TypeScript declarations are generated from that schema; runtime rendering validates
|
|
32
|
+
against the same artifact.
|
|
33
|
+
|
|
34
|
+
### Optional real user monitoring
|
|
35
|
+
|
|
36
|
+
Public pages render without monitoring unless a complete `rumConfig` is supplied. The contract requires the public app monitor ID, application version, AWS region, Cognito identity pool ID, and guest role ARN. Brokaw validates the complete configuration and does not embed tenant deployment identifiers in the package.
|
|
37
|
+
|
|
38
|
+
When enabled, the shared standard and 404 shells collect only performance and filtered JavaScript-error telemetry. Page IDs use `window.location.pathname`; cookies, HTTP telemetry, resource URLs, X-Ray, and replay are disabled. Loader failures are isolated from page rendering and navigation.
|
|
26
39
|
|
|
27
40
|
## Exports
|
|
28
41
|
|
|
29
42
|
- `@fifthbell/brokaw` -> renderer entrypoint
|
|
43
|
+
- `@fifthbell/brokaw/cronkite-manifest.json` -> data-only CLS capability manifest
|
|
44
|
+
- `@fifthbell/brokaw/video` -> bundleable Remotion short-video entrypoint
|
|
45
|
+
- `@fifthbell/brokaw/schemas/canonical-document.schema.json` -> canonical input contract
|
|
46
|
+
- `@fifthbell/brokaw/schemas/cronkite-manifest.schema.json` -> CLS manifest contract
|
|
47
|
+
- `@fifthbell/brokaw/schemas/feed-renderable-input.schema.json` -> CMS-owned feed renderable input boundary
|
|
48
|
+
- `@fifthbell/brokaw/schemas/live-program-release-input.schema.json` -> generic live-program release input
|
|
30
49
|
- `@fifthbell/brokaw/partial-deps.json` -> partial-to-layout dependency map
|
|
31
50
|
|
|
51
|
+
The root module also exports `cronkiteManifest`, `outletConfig`, `version`,
|
|
52
|
+
`render`, `fontFiles`, `buildInstagramImageHtml`, and
|
|
53
|
+
`liveProgramReleaseFiles`. See [docs/cronkite-compatibility.md](docs/cronkite-compatibility.md)
|
|
54
|
+
for ownership, validation, system-page, asset, and release-ordering details.
|
|
55
|
+
|
|
56
|
+
## Fifthbell live-program bundle
|
|
57
|
+
|
|
58
|
+
`liveProgramPageFiles()` returns the deployable bundle as deterministic `{ key, body, contentType }` entries. It includes `index.html`, versioned JavaScript and CSS, every image/audio/font dependency, and `live-program-manifest.json`. The manifest records the Brokaw package version, renderer schema version, file byte sizes, content types, and SHA-256 digests. It is also an `alcantara.program-template` contract: it declares the renderer entrypoint, supported capabilities, accepted signals, and the runtime parameters Alcantara supplies. A publisher such as Cronkite must upload every returned key under the same public prefix; the relative URLs then work at any Cronkite-owned path.
|
|
59
|
+
|
|
60
|
+
`liveProgramReleaseFiles({ programId, apiBaseUrl })` is the manifest-declared
|
|
61
|
+
request renderable. It preserves the raw bundle export, emits versioned release
|
|
62
|
+
objects, and places the configured `html/program.html` commit point last.
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
import { liveProgramPageFiles } from "@fifthbell/brokaw";
|
|
66
|
+
|
|
67
|
+
for (const file of liveProgramPageFiles()) {
|
|
68
|
+
await publish({
|
|
69
|
+
key: file.key,
|
|
70
|
+
body: file.body,
|
|
71
|
+
contentType: file.contentType,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The standalone renderer uses Alcantara's public, program-scoped contract:
|
|
77
|
+
|
|
78
|
+
- initial snapshot: `GET /program/:programId/state`
|
|
79
|
+
- updates: `GET /program/:programId/events` as server-sent events
|
|
80
|
+
- state ordering: the non-negative integer `version` supplied by Alcantara
|
|
81
|
+
- renderer schema: `schemaVersion: 1` when present; absent schema versions remain compatible with Alcantara's current v1 payload
|
|
82
|
+
|
|
83
|
+
Alcantara registers the versioned public URL of `live-program-manifest.json`, resolves the relative `entrypoint`, and uses the declared `capabilities` to expose only applicable controls. The `control.signals` allowlist is the complete set of SSE signal types this renderer accepts; adding renderer behavior requires updating that contract in the same release.
|
|
84
|
+
|
|
85
|
+
Cronkite can configure a published bundle at runtime by defining `window.__FIFTHBELL_LIVE_PROGRAM_CONFIG__ = { programId, apiBaseUrl }` before the module script runs, or by supplying `programId` and `apiBaseUrl` query parameters. Build-time `VITE_PROGRAM_ID` (default `fifthbell`) and `VITE_API_BASE_URL` are fallbacks. The API base can be an Alcantara origin, an origin ending in `/program`, or the complete `/program/:programId` endpoint; the complete endpoint form remains compatible with existing builds.
|
|
86
|
+
|
|
87
|
+
The renderer keeps its last valid state while SSE is unavailable, reconnects automatically, and fetches a fresh snapshot before consuming each new stream. Newer snapshots reconcile missed events; malformed, cross-program, incompatible-schema, stale, and out-of-order updates are ignored with a diagnostic console warning.
|
|
88
|
+
|
|
89
|
+
All presentation files are owned and packaged by Brokaw. Alcantara supplies state and events only; it is not an asset origin.
|
|
90
|
+
|
|
32
91
|
## Development
|
|
33
92
|
|
|
34
93
|
```bash
|
|
@@ -36,6 +95,8 @@ npm install
|
|
|
36
95
|
npm run typecheck
|
|
37
96
|
npm run test:unit
|
|
38
97
|
npm run build
|
|
98
|
+
npm run verify:packed-remotion
|
|
99
|
+
npm pack --dry-run
|
|
39
100
|
npm run storybook
|
|
40
101
|
```
|
|
41
102
|
|
|
@@ -5,5 +5,5 @@ interface LiveProgramProps {
|
|
|
5
5
|
activeComponents?: string[];
|
|
6
6
|
apiBaseUrl?: string;
|
|
7
7
|
}
|
|
8
|
-
export default function LiveProgram({ embedded, sceneMetadata, activeComponents, apiBaseUrl }: LiveProgramProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default function LiveProgram({ programId, embedded, sceneMetadata, activeComponents, apiBaseUrl }: LiveProgramProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { BellRing } from 'lucide-react';
|
|
4
4
|
import { useSSE } from './hooks/useSSE.js';
|
|
5
|
+
import { isProgramStateEvent, parseProgramEvent, reconcileProgramEvent, reconcileProgramSnapshot, resolveProgramEndpoint, } from './program-contract.js';
|
|
5
6
|
import { FIFTHBELL_ASSETS } from './assets.js';
|
|
6
7
|
import { MarqueeCurtain } from './components/MarqueeCurtain.js';
|
|
7
8
|
import Marquee from './components/Marquee.js';
|
|
@@ -235,8 +236,10 @@ function normalizeLaunchDate(rawDate) {
|
|
|
235
236
|
}
|
|
236
237
|
return parsed;
|
|
237
238
|
}
|
|
238
|
-
export default function LiveProgram({ embedded = false, sceneMetadata, activeComponents, apiBaseUrl }) {
|
|
239
|
+
export default function LiveProgram({ programId = 'fifthbell', embedded = false, sceneMetadata, activeComponents, apiBaseUrl }) {
|
|
239
240
|
const [state, setState] = useState(null);
|
|
241
|
+
const stateRef = useRef(null);
|
|
242
|
+
const snapshotRequestRef = useRef(0);
|
|
240
243
|
const [showLogoSlide, setShowLogoSlide] = useState(false);
|
|
241
244
|
const [callsignTime, setCallsignTime] = useState(new Date());
|
|
242
245
|
const audioRef = useRef(null);
|
|
@@ -270,13 +273,37 @@ export default function LiveProgram({ embedded = false, sceneMetadata, activeCom
|
|
|
270
273
|
const layerAvailability = useMemo(() => resolveFifthBellLayerAvailability(activeComponents), [activeComponents]);
|
|
271
274
|
const languageRotation = config.languageRotation;
|
|
272
275
|
const currentLanguage = languageRotation[languageIndex] ?? languageRotation[0] ?? 'en';
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
return
|
|
279
|
-
}
|
|
276
|
+
const normalizedProgramId = programId.trim() || 'fifthbell';
|
|
277
|
+
const programEndpoint = resolveProgramEndpoint(apiBaseUrl, normalizedProgramId);
|
|
278
|
+
const reportProgramDiagnostic = useCallback((diagnostic, payload) => {
|
|
279
|
+
if (typeof diagnostic === 'string') {
|
|
280
|
+
console.warn(`[live-program] ${diagnostic}`, payload);
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
console.warn(`[live-program:${diagnostic.code}] ${diagnostic.message}`, diagnostic.payload);
|
|
284
|
+
}, []);
|
|
285
|
+
const refreshProgramState = useCallback(async () => {
|
|
286
|
+
const requestId = ++snapshotRequestRef.current;
|
|
287
|
+
try {
|
|
288
|
+
const response = await fetch(`${programEndpoint}/state`, { cache: 'no-store' });
|
|
289
|
+
if (!response.ok)
|
|
290
|
+
throw new Error(`Program snapshot failed: ${response.status}`);
|
|
291
|
+
const payload = await response.json();
|
|
292
|
+
if (requestId !== snapshotRequestRef.current)
|
|
293
|
+
return;
|
|
294
|
+
const result = reconcileProgramSnapshot(stateRef.current, payload, normalizedProgramId);
|
|
295
|
+
if (result.accepted && result.state) {
|
|
296
|
+
stateRef.current = result.state;
|
|
297
|
+
setState(result.state);
|
|
298
|
+
}
|
|
299
|
+
else if (result.diagnostic) {
|
|
300
|
+
reportProgramDiagnostic(result.diagnostic);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
catch (error) {
|
|
304
|
+
console.error('[live-program] Failed to fetch program snapshot:', error);
|
|
305
|
+
}
|
|
306
|
+
}, [normalizedProgramId, programEndpoint, reportProgramDiagnostic]);
|
|
280
307
|
useEffect(() => {
|
|
281
308
|
if (languageIndex >= languageRotation.length) {
|
|
282
309
|
setLanguageIndex(0);
|
|
@@ -289,11 +316,8 @@ export default function LiveProgram({ embedded = false, sceneMetadata, activeCom
|
|
|
289
316
|
if (controlledBySceneRenderer) {
|
|
290
317
|
return;
|
|
291
318
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
.then((data) => setState(data))
|
|
295
|
-
.catch((err) => console.error('Failed to fetch FifthBell program state:', err));
|
|
296
|
-
}, [controlledBySceneRenderer, resolvedApiBaseUrl]);
|
|
319
|
+
void refreshProgramState();
|
|
320
|
+
}, [controlledBySceneRenderer, refreshProgramState]);
|
|
297
321
|
const refreshAllData = useCallback(async () => {
|
|
298
322
|
const [articlesData, weatherDataResult, earthquakesData, marketsData, liveEventData] = await Promise.all([
|
|
299
323
|
fetchArticles(currentLanguage),
|
|
@@ -358,45 +382,29 @@ export default function LiveProgram({ embedded = false, sceneMetadata, activeCom
|
|
|
358
382
|
activeInstantAudioRef.current = null;
|
|
359
383
|
}, []);
|
|
360
384
|
useSSE({
|
|
361
|
-
url: `${
|
|
385
|
+
url: `${programEndpoint}/events`,
|
|
362
386
|
enabled: !controlledBySceneRenderer,
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
stagedScene: data.scene && typeof data.scene === 'object' ? data.scene : null,
|
|
372
|
-
};
|
|
373
|
-
});
|
|
387
|
+
onOpen: refreshProgramState,
|
|
388
|
+
onDiagnostic: reportProgramDiagnostic,
|
|
389
|
+
onMessage: (payload) => {
|
|
390
|
+
const parsed = parseProgramEvent(payload, normalizedProgramId);
|
|
391
|
+
if (!parsed.event) {
|
|
392
|
+
if (parsed.diagnostic)
|
|
393
|
+
reportProgramDiagnostic(parsed.diagnostic);
|
|
394
|
+
return;
|
|
374
395
|
}
|
|
375
|
-
|
|
376
|
-
|
|
396
|
+
const data = parsed.event;
|
|
397
|
+
const stateResult = reconcileProgramEvent(stateRef.current, parsed.event);
|
|
398
|
+
if (stateResult.accepted && stateResult.state !== stateRef.current) {
|
|
399
|
+
stateRef.current = stateResult.state;
|
|
400
|
+
setState(stateResult.state);
|
|
377
401
|
}
|
|
378
|
-
else if (
|
|
379
|
-
|
|
380
|
-
if (!prev)
|
|
381
|
-
return prev;
|
|
382
|
-
return {
|
|
383
|
-
...prev,
|
|
384
|
-
activeScene: data.scene ?? prev.activeScene
|
|
385
|
-
};
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
else if (data.type === 'scene_cleared') {
|
|
389
|
-
setState((prev) => {
|
|
390
|
-
if (!prev)
|
|
391
|
-
return prev;
|
|
392
|
-
return {
|
|
393
|
-
...prev,
|
|
394
|
-
activeSceneId: null,
|
|
395
|
-
activeScene: null
|
|
396
|
-
};
|
|
397
|
-
});
|
|
402
|
+
else if (stateResult.diagnostic) {
|
|
403
|
+
reportProgramDiagnostic(stateResult.diagnostic);
|
|
398
404
|
}
|
|
399
|
-
|
|
405
|
+
if (isProgramStateEvent(parsed.event))
|
|
406
|
+
return;
|
|
407
|
+
if (data.type === 'broadcast_settings_update') {
|
|
400
408
|
// broadcast settings stored for overlay display
|
|
401
409
|
}
|
|
402
410
|
else if (data.type === 'scene_instant_take' && data.instant?.audioUrl) {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
interface UseSSEOptions {
|
|
2
2
|
url: string;
|
|
3
|
-
onMessage?: (data:
|
|
3
|
+
onMessage?: (data: unknown) => void;
|
|
4
|
+
onOpen?: () => void | Promise<void>;
|
|
5
|
+
onDiagnostic?: (message: string, payload?: unknown) => void;
|
|
4
6
|
reconnectInterval?: number;
|
|
5
7
|
enabled?: boolean;
|
|
6
8
|
}
|
|
7
|
-
export declare function useSSE({ url, onMessage, reconnectInterval, enabled }: UseSSEOptions): {
|
|
9
|
+
export declare function useSSE({ url, onMessage, onOpen, onDiagnostic, reconnectInterval, enabled }: UseSSEOptions): {
|
|
8
10
|
isConnected: boolean;
|
|
9
11
|
error: Error | null;
|
|
10
12
|
};
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
export function useSSE({ url, onMessage, reconnectInterval = 3000, enabled = true }) {
|
|
2
|
+
export function useSSE({ url, onMessage, onOpen, onDiagnostic, reconnectInterval = 3000, enabled = true }) {
|
|
3
3
|
const [isConnected, setIsConnected] = useState(false);
|
|
4
4
|
const [error, setError] = useState(null);
|
|
5
5
|
const onMessageRef = useRef(onMessage);
|
|
6
|
+
const onOpenRef = useRef(onOpen);
|
|
7
|
+
const onDiagnosticRef = useRef(onDiagnostic);
|
|
6
8
|
const bufferRef = useRef('');
|
|
7
9
|
useEffect(() => {
|
|
8
10
|
onMessageRef.current = onMessage;
|
|
9
|
-
|
|
11
|
+
onOpenRef.current = onOpen;
|
|
12
|
+
onDiagnosticRef.current = onDiagnostic;
|
|
13
|
+
}, [onMessage, onOpen, onDiagnostic]);
|
|
10
14
|
useEffect(() => {
|
|
11
15
|
if (!enabled) {
|
|
12
16
|
setIsConnected(false);
|
|
@@ -27,8 +31,8 @@ export function useSSE({ url, onMessage, reconnectInterval = 3000, enabled = tru
|
|
|
27
31
|
console.log('[SSE] message:', data.type);
|
|
28
32
|
onMessageRef.current?.(data);
|
|
29
33
|
}
|
|
30
|
-
catch {
|
|
31
|
-
|
|
34
|
+
catch (parseError) {
|
|
35
|
+
onDiagnosticRef.current?.('Ignored malformed SSE JSON payload', { data: dataStr, error: parseError });
|
|
32
36
|
}
|
|
33
37
|
}
|
|
34
38
|
};
|
|
@@ -47,6 +51,7 @@ export function useSSE({ url, onMessage, reconnectInterval = 3000, enabled = tru
|
|
|
47
51
|
return;
|
|
48
52
|
try {
|
|
49
53
|
abortController = new AbortController();
|
|
54
|
+
bufferRef.current = '';
|
|
50
55
|
const response = await fetch(url, {
|
|
51
56
|
signal: abortController.signal,
|
|
52
57
|
cache: 'no-store',
|
|
@@ -60,6 +65,7 @@ export function useSSE({ url, onMessage, reconnectInterval = 3000, enabled = tru
|
|
|
60
65
|
console.log('[SSE] connected to', url);
|
|
61
66
|
setIsConnected(true);
|
|
62
67
|
setError(null);
|
|
68
|
+
await onOpenRef.current?.();
|
|
63
69
|
reader = response.body.getReader();
|
|
64
70
|
const decoder = new TextDecoder();
|
|
65
71
|
while (!disposed) {
|
|
@@ -79,6 +85,8 @@ export function useSSE({ url, onMessage, reconnectInterval = 3000, enabled = tru
|
|
|
79
85
|
setError(err instanceof Error ? err : new Error(String(err)));
|
|
80
86
|
}
|
|
81
87
|
finally {
|
|
88
|
+
if (!disposed)
|
|
89
|
+
setIsConnected(false);
|
|
82
90
|
reader = null;
|
|
83
91
|
abortController = null;
|
|
84
92
|
if (!disposed) {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare const LIVE_PROGRAM_SCHEMA_VERSION = 1;
|
|
2
|
+
export interface Layout {
|
|
3
|
+
id: number;
|
|
4
|
+
name: string;
|
|
5
|
+
componentType: string;
|
|
6
|
+
settings: string;
|
|
7
|
+
}
|
|
8
|
+
export interface Scene {
|
|
9
|
+
id: number;
|
|
10
|
+
name: string;
|
|
11
|
+
layoutId: number;
|
|
12
|
+
layout: Layout;
|
|
13
|
+
chyronText: string | null;
|
|
14
|
+
metadata: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface ProgramState {
|
|
17
|
+
id: number;
|
|
18
|
+
programId?: string;
|
|
19
|
+
activeSceneId: number | null;
|
|
20
|
+
activeScene: Scene | null;
|
|
21
|
+
stagedSceneId?: number | null;
|
|
22
|
+
stagedScene?: Scene | null;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
version: number;
|
|
25
|
+
}
|
|
26
|
+
export interface ProgramEvent extends Record<string, unknown> {
|
|
27
|
+
type: string;
|
|
28
|
+
programId?: string;
|
|
29
|
+
schemaVersion?: number;
|
|
30
|
+
version?: number;
|
|
31
|
+
}
|
|
32
|
+
export type ProgramDiagnostic = {
|
|
33
|
+
code: 'incompatible-schema' | 'malformed-event' | 'malformed-snapshot' | 'program-mismatch' | 'stale-update';
|
|
34
|
+
message: string;
|
|
35
|
+
payload?: unknown;
|
|
36
|
+
};
|
|
37
|
+
export type ProgramStateResult = {
|
|
38
|
+
state: ProgramState | null;
|
|
39
|
+
accepted: boolean;
|
|
40
|
+
diagnostic?: ProgramDiagnostic;
|
|
41
|
+
};
|
|
42
|
+
export declare function isProgramStateEvent(event: ProgramEvent): boolean;
|
|
43
|
+
export declare function resolveProgramEndpoint(apiBaseUrl: string | undefined, programId: string): string;
|
|
44
|
+
export declare function parseProgramSnapshot(payload: unknown, expectedProgramId: string): ProgramStateResult;
|
|
45
|
+
export declare function parseProgramEvent(payload: unknown, expectedProgramId: string): {
|
|
46
|
+
event: ProgramEvent | null;
|
|
47
|
+
diagnostic?: ProgramDiagnostic;
|
|
48
|
+
};
|
|
49
|
+
export declare function reconcileProgramSnapshot(current: ProgramState | null, payload: unknown, expectedProgramId: string): ProgramStateResult;
|
|
50
|
+
export declare function reconcileProgramEvent(current: ProgramState | null, event: ProgramEvent): ProgramStateResult;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
export const LIVE_PROGRAM_SCHEMA_VERSION = 1;
|
|
2
|
+
const STATE_EVENT_TYPES = new Set([
|
|
3
|
+
'scene_change',
|
|
4
|
+
'scene_staged',
|
|
5
|
+
'scene_update',
|
|
6
|
+
'scene_cleared',
|
|
7
|
+
'program_scenes_changed',
|
|
8
|
+
'program_media_groups_changed',
|
|
9
|
+
'program_stingers_changed',
|
|
10
|
+
]);
|
|
11
|
+
export function isProgramStateEvent(event) {
|
|
12
|
+
return STATE_EVENT_TYPES.has(event.type);
|
|
13
|
+
}
|
|
14
|
+
function isRecord(value) {
|
|
15
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
16
|
+
}
|
|
17
|
+
function isVersion(value) {
|
|
18
|
+
return typeof value === 'number' && Number.isSafeInteger(value) && value >= 0;
|
|
19
|
+
}
|
|
20
|
+
function isScene(value) {
|
|
21
|
+
if (!isRecord(value) || !isRecord(value.layout))
|
|
22
|
+
return false;
|
|
23
|
+
return (typeof value.id === 'number' &&
|
|
24
|
+
typeof value.name === 'string' &&
|
|
25
|
+
typeof value.layoutId === 'number' &&
|
|
26
|
+
typeof value.layout.id === 'number' &&
|
|
27
|
+
typeof value.layout.name === 'string' &&
|
|
28
|
+
typeof value.layout.componentType === 'string' &&
|
|
29
|
+
typeof value.layout.settings === 'string' &&
|
|
30
|
+
(value.chyronText === null || typeof value.chyronText === 'string') &&
|
|
31
|
+
(value.metadata === null || typeof value.metadata === 'string'));
|
|
32
|
+
}
|
|
33
|
+
function schemaDiagnostic(payload) {
|
|
34
|
+
if (payload.schemaVersion === undefined || payload.schemaVersion === LIVE_PROGRAM_SCHEMA_VERSION) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
code: 'incompatible-schema',
|
|
39
|
+
message: `Expected live-program schema ${LIVE_PROGRAM_SCHEMA_VERSION}, received ${String(payload.schemaVersion)}`,
|
|
40
|
+
payload,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export function resolveProgramEndpoint(apiBaseUrl, programId) {
|
|
44
|
+
const normalizedProgramId = programId.trim() || 'fifthbell';
|
|
45
|
+
const fallback = (() => {
|
|
46
|
+
if (typeof window === 'undefined')
|
|
47
|
+
return 'http://127.0.0.1:3000';
|
|
48
|
+
const hostname = window.location.hostname;
|
|
49
|
+
return `http://${hostname.includes(':') ? `[${hostname}]` : hostname}:3000`;
|
|
50
|
+
})();
|
|
51
|
+
const base = (apiBaseUrl?.trim() || fallback).replace(/\/+$/, '');
|
|
52
|
+
const encodedProgramId = encodeURIComponent(normalizedProgramId);
|
|
53
|
+
if (/\/program\/[^/]+$/.test(base))
|
|
54
|
+
return base;
|
|
55
|
+
if (base.endsWith('/program'))
|
|
56
|
+
return `${base}/${encodedProgramId}`;
|
|
57
|
+
return `${base}/program/${encodedProgramId}`;
|
|
58
|
+
}
|
|
59
|
+
export function parseProgramSnapshot(payload, expectedProgramId) {
|
|
60
|
+
if (!isRecord(payload)) {
|
|
61
|
+
return { state: null, accepted: false, diagnostic: { code: 'malformed-snapshot', message: 'Program snapshot must be an object', payload } };
|
|
62
|
+
}
|
|
63
|
+
const incompatible = schemaDiagnostic(payload);
|
|
64
|
+
if (incompatible)
|
|
65
|
+
return { state: null, accepted: false, diagnostic: incompatible };
|
|
66
|
+
if (typeof payload.programId === 'string' && payload.programId !== expectedProgramId) {
|
|
67
|
+
return { state: null, accepted: false, diagnostic: { code: 'program-mismatch', message: `Expected program ${expectedProgramId}, received ${payload.programId}`, payload } };
|
|
68
|
+
}
|
|
69
|
+
if (typeof payload.id !== 'number' ||
|
|
70
|
+
!isVersion(payload.version) ||
|
|
71
|
+
typeof payload.updatedAt !== 'string' ||
|
|
72
|
+
!(payload.activeSceneId === null || typeof payload.activeSceneId === 'number') ||
|
|
73
|
+
!(payload.activeScene === null || isScene(payload.activeScene)) ||
|
|
74
|
+
!(payload.stagedScene === undefined || payload.stagedScene === null || isScene(payload.stagedScene))) {
|
|
75
|
+
return { state: null, accepted: false, diagnostic: { code: 'malformed-snapshot', message: 'Program snapshot is missing required state fields or a valid version', payload } };
|
|
76
|
+
}
|
|
77
|
+
return { state: payload, accepted: true };
|
|
78
|
+
}
|
|
79
|
+
export function parseProgramEvent(payload, expectedProgramId) {
|
|
80
|
+
if (!isRecord(payload) || typeof payload.type !== 'string' || !payload.type.trim()) {
|
|
81
|
+
return { event: null, diagnostic: { code: 'malformed-event', message: 'Program event must contain a non-empty type', payload } };
|
|
82
|
+
}
|
|
83
|
+
const incompatible = schemaDiagnostic(payload);
|
|
84
|
+
if (incompatible)
|
|
85
|
+
return { event: null, diagnostic: incompatible };
|
|
86
|
+
if (typeof payload.programId === 'string' && payload.programId !== expectedProgramId) {
|
|
87
|
+
return { event: null, diagnostic: { code: 'program-mismatch', message: `Expected program ${expectedProgramId}, received ${payload.programId}`, payload } };
|
|
88
|
+
}
|
|
89
|
+
if (STATE_EVENT_TYPES.has(payload.type) && !isVersion(payload.version)) {
|
|
90
|
+
return { event: null, diagnostic: { code: 'malformed-event', message: `State event ${payload.type} requires a non-negative integer version`, payload } };
|
|
91
|
+
}
|
|
92
|
+
return { event: payload };
|
|
93
|
+
}
|
|
94
|
+
export function reconcileProgramSnapshot(current, payload, expectedProgramId) {
|
|
95
|
+
const parsed = parseProgramSnapshot(payload, expectedProgramId);
|
|
96
|
+
if (!parsed.accepted || !parsed.state)
|
|
97
|
+
return parsed;
|
|
98
|
+
if (current && parsed.state.version === current.version) {
|
|
99
|
+
return { state: current, accepted: false, diagnostic: { code: 'stale-update', message: `Ignored snapshot version ${parsed.state.version}; current version is ${current.version}`, payload } };
|
|
100
|
+
}
|
|
101
|
+
if (current && parsed.state.version < current.version) {
|
|
102
|
+
const currentUpdatedAt = Date.parse(current.updatedAt);
|
|
103
|
+
const candidateUpdatedAt = Date.parse(parsed.state.updatedAt);
|
|
104
|
+
if (!Number.isFinite(candidateUpdatedAt) || candidateUpdatedAt < currentUpdatedAt) {
|
|
105
|
+
return { state: current, accepted: false, diagnostic: { code: 'stale-update', message: `Ignored snapshot version ${parsed.state.version}; current version is ${current.version}`, payload } };
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return parsed;
|
|
109
|
+
}
|
|
110
|
+
export function reconcileProgramEvent(current, event) {
|
|
111
|
+
if (!STATE_EVENT_TYPES.has(event.type))
|
|
112
|
+
return { state: current, accepted: true };
|
|
113
|
+
const version = event.version;
|
|
114
|
+
if (current && version <= current.version) {
|
|
115
|
+
return { state: current, accepted: false, diagnostic: { code: 'stale-update', message: `Ignored ${event.type} version ${version}; current version is ${current.version}`, payload: event } };
|
|
116
|
+
}
|
|
117
|
+
if ((event.type === 'scene_change' || event.type === 'program_scenes_changed' || event.type === 'program_media_groups_changed' || event.type === 'program_stingers_changed') && isRecord(event.state)) {
|
|
118
|
+
const next = { ...event.state, version };
|
|
119
|
+
const parsed = parseProgramSnapshot(next, event.programId ?? current?.programId ?? String(next.programId ?? ''));
|
|
120
|
+
if (parsed.accepted)
|
|
121
|
+
return parsed;
|
|
122
|
+
return parsed;
|
|
123
|
+
}
|
|
124
|
+
if (!current) {
|
|
125
|
+
return { state: null, accepted: false, diagnostic: { code: 'malformed-event', message: `Cannot apply ${event.type} before a valid snapshot`, payload: event } };
|
|
126
|
+
}
|
|
127
|
+
if (event.type === 'scene_staged') {
|
|
128
|
+
if (!(event.scene === null || isScene(event.scene))) {
|
|
129
|
+
return { state: current, accepted: false, diagnostic: { code: 'malformed-event', message: 'scene_staged contains an invalid scene', payload: event } };
|
|
130
|
+
}
|
|
131
|
+
return { state: { ...current, stagedSceneId: typeof event.stagedSceneId === 'number' ? event.stagedSceneId : null, stagedScene: event.scene ?? null, version }, accepted: true };
|
|
132
|
+
}
|
|
133
|
+
if (event.type === 'scene_update' && isScene(event.scene)) {
|
|
134
|
+
return { state: { ...current, activeScene: event.scene, version }, accepted: true };
|
|
135
|
+
}
|
|
136
|
+
if (event.type === 'scene_cleared') {
|
|
137
|
+
return { state: { ...current, activeSceneId: null, activeScene: null, version }, accepted: true };
|
|
138
|
+
}
|
|
139
|
+
return { state: current, accepted: false, diagnostic: { code: 'malformed-event', message: `State event ${event.type} does not contain the required payload`, payload: event } };
|
|
140
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export declare const cronkiteManifest: {
|
|
2
|
+
readonly contract: "cronkite.cls";
|
|
3
|
+
readonly contractVersion: 1;
|
|
4
|
+
readonly package: "@fifthbell/brokaw";
|
|
5
|
+
readonly version: string;
|
|
6
|
+
readonly layouts: ["article-page" | "homepage" | "category-page" | "search-page" | "404" | "live-story" | "link-in-bio" | "media-page" | "standalone-page", ...("article-page" | "homepage" | "category-page" | "search-page" | "404" | "live-story" | "link-in-bio" | "media-page" | "standalone-page")[]];
|
|
7
|
+
readonly languages: ["en", "es", "it"];
|
|
8
|
+
readonly collections: {
|
|
9
|
+
readonly "article-page": "json/articles";
|
|
10
|
+
readonly "standalone-page": "json/pages";
|
|
11
|
+
readonly "media-page": "json/media";
|
|
12
|
+
};
|
|
13
|
+
readonly systemPages: import("./types/cronkite-manifest.generated.js").SystemPage[];
|
|
14
|
+
readonly renderables: {
|
|
15
|
+
readonly homepage: {
|
|
16
|
+
readonly engine: "handlebars";
|
|
17
|
+
readonly export: "render";
|
|
18
|
+
readonly contentType: "text/html; charset=utf-8";
|
|
19
|
+
readonly inputSchema: "dist/schemas/feed-renderable-input.schema.json";
|
|
20
|
+
};
|
|
21
|
+
readonly "category-page": {
|
|
22
|
+
readonly engine: "handlebars";
|
|
23
|
+
readonly export: "render";
|
|
24
|
+
readonly contentType: "text/html; charset=utf-8";
|
|
25
|
+
readonly inputSchema: "dist/schemas/feed-renderable-input.schema.json";
|
|
26
|
+
};
|
|
27
|
+
readonly "search-page": {
|
|
28
|
+
readonly engine: "handlebars";
|
|
29
|
+
readonly export: "render";
|
|
30
|
+
readonly contentType: "text/html; charset=utf-8";
|
|
31
|
+
readonly inputSchema: "dist/schemas/feed-renderable-input.schema.json";
|
|
32
|
+
};
|
|
33
|
+
readonly "live-story": {
|
|
34
|
+
readonly engine: "handlebars";
|
|
35
|
+
readonly export: "render";
|
|
36
|
+
readonly contentType: "text/html; charset=utf-8";
|
|
37
|
+
readonly inputSchema: "dist/schemas/feed-renderable-input.schema.json";
|
|
38
|
+
};
|
|
39
|
+
readonly "link-in-bio": {
|
|
40
|
+
readonly engine: "handlebars";
|
|
41
|
+
readonly export: "render";
|
|
42
|
+
readonly contentType: "text/html; charset=utf-8";
|
|
43
|
+
readonly inputSchema: "dist/schemas/feed-renderable-input.schema.json";
|
|
44
|
+
};
|
|
45
|
+
readonly "social-image": {
|
|
46
|
+
readonly engine: "html-raster";
|
|
47
|
+
readonly export: "buildInstagramImageHtml";
|
|
48
|
+
readonly contentType: "image/jpeg";
|
|
49
|
+
readonly width: 1080;
|
|
50
|
+
readonly height: 1350;
|
|
51
|
+
};
|
|
52
|
+
readonly "short-video": {
|
|
53
|
+
readonly engine: "remotion";
|
|
54
|
+
readonly entry: "dist/video/index.js";
|
|
55
|
+
readonly compositionId: "BrokawShort";
|
|
56
|
+
readonly contentType: "video/mp4";
|
|
57
|
+
};
|
|
58
|
+
readonly "live-program": {
|
|
59
|
+
readonly engine: "handlebars";
|
|
60
|
+
readonly export: "liveProgramReleaseFiles";
|
|
61
|
+
readonly outputMode: "files";
|
|
62
|
+
readonly lifecycle: "request";
|
|
63
|
+
readonly inputSchema: "dist/schemas/live-program-release-input.schema.json";
|
|
64
|
+
readonly contract: {
|
|
65
|
+
readonly kind: "alcantara.program-template";
|
|
66
|
+
readonly version: 1;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
readonly capabilities: {
|
|
71
|
+
readonly fonts: {
|
|
72
|
+
readonly export: "fontFiles";
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
readonly writeOrdering: {
|
|
76
|
+
readonly "live-program": {
|
|
77
|
+
readonly last: ["html/program.html"];
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|