@spunto/brand-kit 0.0.0-stage → 0.4.0

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.
Files changed (73) hide show
  1. package/README.md +53 -2
  2. package/package.json +109 -4
  3. package/src/brand-mark.tsx +13 -0
  4. package/src/canvas.tsx +42 -0
  5. package/src/coherence.ts +62 -0
  6. package/src/count.ts +14 -0
  7. package/src/emphasis.tsx +18 -0
  8. package/src/facts.ts +244 -0
  9. package/src/formats.ts +22 -0
  10. package/src/hero/hero.tsx +102 -0
  11. package/src/hero/index.ts +3 -0
  12. package/src/home/check.ts +201 -0
  13. package/src/home/editable.tsx +72 -0
  14. package/src/home/editions/ci.json +371 -0
  15. package/src/home/editions/cloud.json +1263 -0
  16. package/src/home/editions/cms.json +372 -0
  17. package/src/home/editions/desktop.json +360 -0
  18. package/src/home/editions/ds.json +340 -0
  19. package/src/home/editions/foyer.json +323 -0
  20. package/src/home/editions/lite.json +818 -0
  21. package/src/home/editions/search.json +330 -0
  22. package/src/home/editions.ts +56 -0
  23. package/src/home/facts-index.ts +9 -0
  24. package/src/home/guide.ts +99 -0
  25. package/src/home/home.tsx +1255 -0
  26. package/src/home/index.ts +8 -0
  27. package/src/home/products/ci.ts +75 -0
  28. package/src/home/products/cms.ts +53 -0
  29. package/src/home/products/desktop.ts +51 -0
  30. package/src/home/products/ds.ts +57 -0
  31. package/src/home/products/foyer.ts +40 -0
  32. package/src/home/products/index.ts +12 -0
  33. package/src/home/products/lite.ts +17 -0
  34. package/src/home/products/search.ts +28 -0
  35. package/src/home/types.ts +208 -0
  36. package/src/illustrations/catalog.ts +16 -0
  37. package/src/illustrations/illustrations.tsx +197 -0
  38. package/src/illustrations/index.tsx +31 -0
  39. package/src/illustrations/paint.ts +21 -0
  40. package/src/index.ts +25 -0
  41. package/src/logo/index.ts +9 -0
  42. package/src/marks.ts +69 -0
  43. package/src/paints.ts +279 -0
  44. package/src/products.ts +304 -0
  45. package/src/social/index.ts +3 -0
  46. package/src/social/social-card.tsx +169 -0
  47. package/src/story/clock.ts +58 -0
  48. package/src/story/components.tsx +428 -0
  49. package/src/story/guide.ts +259 -0
  50. package/src/story/index.ts +10 -0
  51. package/src/story/mount.tsx +150 -0
  52. package/src/story/story.tsx +652 -0
  53. package/src/theme.ts +39 -0
  54. package/src/three/catalog.ts +280 -0
  55. package/src/three/index.ts +6 -0
  56. package/src/three/modules/blob.ts +116 -0
  57. package/src/three/modules/blocks.ts +73 -0
  58. package/src/three/modules/diorama.ts +472 -0
  59. package/src/three/modules/dither.ts +100 -0
  60. package/src/three/modules/fleet.ts +161 -0
  61. package/src/three/modules/galaxy.ts +107 -0
  62. package/src/three/modules/kit.ts +210 -0
  63. package/src/three/modules/layers.ts +79 -0
  64. package/src/three/modules/orbits.ts +281 -0
  65. package/src/three/modules/prism.ts +87 -0
  66. package/src/three/modules/swarm.ts +120 -0
  67. package/src/three/modules/terrain.ts +79 -0
  68. package/src/three/modules/tunnel.ts +116 -0
  69. package/src/three/types.ts +37 -0
  70. package/src/three/view.tsx +247 -0
  71. package/src/video/index.ts +3 -0
  72. package/src/video/video.tsx +230 -0
  73. package/src/voice.ts +50 -0
package/README.md CHANGED
@@ -1,3 +1,54 @@
1
- # Temporary Holding Version
1
+ # @spunto/brand-kit
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The centre of Spunto's brand: what every product is called and says (in English and French), the
4
+ colours it wears (the design system's `data-product` tokens are generated from them), the figures we
5
+ may quote (each with its source), **every product's home page as data**, 3D modules, illustrations,
6
+ heroes, and the templates — social cards, video scenes, stories — that **Brand Studio** fills in.
7
+
8
+ ## A product's home page, imported
9
+
10
+ Each product's landing page is composed in the kit (an *edition*: sections, words in both languages,
11
+ figures quoted from sourced facts) and published by one line (`PUBLISHED` in `src/home/editions.ts`).
12
+ The product's site renders it:
13
+
14
+ ```bash
15
+ npm i @spunto/brand-kit three # three: the 3D modules, loaded only when one comes on screen
16
+ ```
17
+
18
+ ```tsx
19
+ import { ProductHome } from "@spunto/brand-kit/home"
20
+
21
+ <ProductHome product="lite" locale="fr" />
22
+ ```
23
+
24
+ - Renders nothing while the product has no published edition — import it first, publish later.
25
+ - Internal links stay on your site and take its French prefix (`/fr`), so every prop is serialisable:
26
+ in Astro, `<ProductHome product="lite" locale="en" client:visible />` (hydrated, so the 3D plays).
27
+ - Buttons only your site can fill are **slots**: `slots={{ install: { label, href } }}` (CI's GitHub
28
+ app), `access` (Desktop's form). A slot you don't fill falls back to the edition's link, or is left out.
29
+ - Next: add `"@spunto/brand-kit"` to `transpilePackages` (the package ships TypeScript source, like
30
+ `@spunto/design-system`, which it builds on — peer `>= 0.67`).
31
+ - The page is drawn with inline styles and hex colours: it doesn't depend on your Tailwind build, only
32
+ on the design system's fonts (Young Serif, Geist, JetBrains Mono) being loaded.
33
+
34
+ ## Everything else
35
+
36
+ ```tsx
37
+ import { BRAND_PRODUCTS, ScaledFrame } from "@spunto/brand-kit"
38
+ import { SocialCard, defaultSocialCard } from "@spunto/brand-kit/social"
39
+ import { Module3DView } from "@spunto/brand-kit/three"
40
+
41
+ <ScaledFrame width={1200} height={630}>
42
+ <SocialCard {...defaultSocialCard({ product: "lite", title: "Spunto *Lite*" })} />
43
+ </ScaledFrame>
44
+
45
+ <Module3DView module="swarm" product="cms" theme="night" />
46
+ ```
47
+
48
+ Entries: `.` (products, paints, voice, formats, surfaces), `/products`, `/paints`, `/facts`, `/home`,
49
+ `/coherence`, `/three`, `/logo`, `/illustrations`, `/hero`, `/social`, `/video`, `/story`.
50
+
51
+ Interface pieces (tokens, buttons, dialogs) stay in `@spunto/design-system` — itself an adaptation of
52
+ [shadcn/ui](https://ui.shadcn.com) (MIT).
53
+
54
+ Docs: `docs/brand-kit.md` in the Spunto repository. Rationale: RFC 0054, RFC 0061. MIT.
package/package.json CHANGED
@@ -1,6 +1,111 @@
1
1
  {
2
2
  "name": "@spunto/brand-kit",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.4.0",
4
+ "description": "Spunto's brand kit — the centre of the brand: the product family and its paints (the colours the design system renders), the voice, the sourced figures, the home editions, the illustrations and the templates (social cards, video scenes, stories) everything we say about Spunto is made from.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/coderhammer/spunto.git",
10
+ "directory": "packages/brand-kit"
11
+ },
12
+ "keywords": [
13
+ "brand",
14
+ "spunto",
15
+ "react",
16
+ "illustrations"
17
+ ],
18
+ "publishConfig": {
19
+ "registry": "https://registry.npmjs.org/",
20
+ "access": "public"
21
+ },
22
+ "sideEffects": false,
23
+ "exports": {
24
+ ".": {
25
+ "types": "./src/index.ts",
26
+ "import": "./src/index.ts"
27
+ },
28
+ "./products": {
29
+ "types": "./src/products.ts",
30
+ "import": "./src/products.ts"
31
+ },
32
+ "./logo": {
33
+ "types": "./src/logo/index.ts",
34
+ "import": "./src/logo/index.ts"
35
+ },
36
+ "./illustrations": {
37
+ "types": "./src/illustrations/index.tsx",
38
+ "import": "./src/illustrations/index.tsx"
39
+ },
40
+ "./hero": {
41
+ "types": "./src/hero/index.ts",
42
+ "import": "./src/hero/index.ts"
43
+ },
44
+ "./social": {
45
+ "types": "./src/social/index.ts",
46
+ "import": "./src/social/index.ts"
47
+ },
48
+ "./video": {
49
+ "types": "./src/video/index.ts",
50
+ "import": "./src/video/index.ts"
51
+ },
52
+ "./story": {
53
+ "types": "./src/story/index.ts",
54
+ "import": "./src/story/index.ts"
55
+ },
56
+ "./paints": {
57
+ "types": "./src/paints.ts",
58
+ "import": "./src/paints.ts"
59
+ },
60
+ "./facts": {
61
+ "types": "./src/facts.ts",
62
+ "import": "./src/facts.ts"
63
+ },
64
+ "./home": {
65
+ "types": "./src/home/index.ts",
66
+ "import": "./src/home/index.ts"
67
+ },
68
+ "./coherence": {
69
+ "types": "./src/coherence.ts",
70
+ "import": "./src/coherence.ts"
71
+ },
72
+ "./three": {
73
+ "types": "./src/three/index.ts",
74
+ "import": "./src/three/index.ts"
75
+ }
76
+ },
77
+ "files": [
78
+ "src",
79
+ "!src/**/*.test.ts",
80
+ "!src/**/*.test.tsx",
81
+ "README.md"
82
+ ],
83
+ "scripts": {
84
+ "typecheck": "tsc --noEmit",
85
+ "test": "vitest run",
86
+ "paint": "PAINT_WRITE=1 vitest run src/paints.test.ts"
87
+ },
88
+ "peerDependencies": {
89
+ "@spunto/design-system": ">=0.67.0",
90
+ "react": ">=19",
91
+ "react-dom": ">=19",
92
+ "three": ">=0.170.0"
93
+ },
94
+ "devDependencies": {
95
+ "@testing-library/react": "^16.3.0",
96
+ "@types/node": "^26.6.6",
97
+ "@types/react": "^19",
98
+ "@types/react-dom": "^19",
99
+ "@types/three": "^0.180.0",
100
+ "@vitejs/plugin-react": "^5.0.4",
101
+ "jsdom": "^28.0.0",
102
+ "three": "^0.180.0",
103
+ "typescript": "^5",
104
+ "vitest": "^4.1.11"
105
+ },
106
+ "peerDependenciesMeta": {
107
+ "three": {
108
+ "optional": true
109
+ }
110
+ }
111
+ }
@@ -0,0 +1,13 @@
1
+ import { SpuntoLogo } from "@spunto/design-system/brand"
2
+ import { brandProduct, type BrandProductId } from "./products"
3
+ import { FONT, type Surface } from "./theme"
4
+
5
+ /** The logo and the product's name, side by side, painted for a surface. `unit` scales both. */
6
+ export function BrandMark({ product, s, unit, showName = true }: { product: BrandProductId; s: Surface; unit: number; showName?: boolean }) {
7
+ return (
8
+ <div style={{ display: "flex", alignItems: "center", gap: unit * 0.55 }}>
9
+ <SpuntoLogo size={Math.round(unit * 2)} paint={{ tile: s.accent, ink: s.bg }} />
10
+ {showName && <span style={{ fontFamily: FONT.display, fontSize: Math.round(unit * 1.05), letterSpacing: "-0.01em", color: s.fg }}>{brandProduct(product).name}</span>}
11
+ </div>
12
+ )
13
+ }
package/src/canvas.tsx ADDED
@@ -0,0 +1,42 @@
1
+ import { useLayoutEffect, useRef, useState, type CSSProperties, type ReactNode } from "react"
2
+
3
+ /* A fixed-size canvas, scaled to whatever box it is put in.
4
+
5
+ Every template in the kit is drawn at the real pixel size of its format
6
+ (1200 × 630 for an OG card, 1920 × 1080 for a slide) so the preview *is* the
7
+ export. `ScaledFrame` measures its parent and applies one CSS transform; the
8
+ inner node keeps its true size, which is what an exporter photographs. */
9
+
10
+ export function ScaledFrame({ width, height, children, className, style, innerRef }: {
11
+ width: number
12
+ height: number
13
+ children: ReactNode
14
+ className?: string
15
+ style?: CSSProperties
16
+ /** The unscaled node — hand it to an exporter. */
17
+ innerRef?: React.Ref<HTMLDivElement>
18
+ }) {
19
+ const outer = useRef<HTMLDivElement>(null)
20
+ const [scale, setScale] = useState(0)
21
+ useLayoutEffect(() => {
22
+ const el = outer.current
23
+ if (!el) return
24
+ const fit = () => setScale(el.clientWidth / width)
25
+ fit()
26
+ const ro = new ResizeObserver(fit)
27
+ ro.observe(el)
28
+ return () => ro.disconnect()
29
+ }, [width])
30
+ return (
31
+ <div ref={outer} className={className} style={{ position: "relative", width: "100%", aspectRatio: `${width} / ${height}`, overflow: "hidden", ...style }}>
32
+ <div style={{ position: "absolute", top: 0, left: 0, width, height, transform: `scale(${scale})`, transformOrigin: "0 0", visibility: scale ? "visible" : "hidden" }}>
33
+ <div ref={innerRef} style={{ width, height }}>
34
+ {children}
35
+ </div>
36
+ </div>
37
+ </div>
38
+ )
39
+ }
40
+
41
+ // `Emphasis` lives in emphasis.tsx (no hooks, so a server component can draw it).
42
+ export { Emphasis } from "./emphasis"
@@ -0,0 +1,62 @@
1
+ // The family, checked. One list of everything that makes the brand hold together — the paints
2
+ // read, every product speaks both languages, every figure has a source, every home edition is
3
+ // publishable — computed from the kit's own data. The test fails on an error
4
+ // (coherence.test.ts); the studio's Coherence page shows errors and warnings alike. Pure.
5
+
6
+ import { ALL_FACTS as FACTS } from "./home/facts-index"
7
+ import { HOME_EDITIONS, HOME_EDITION_BY_ID, PUBLISHED } from "./home/editions"
8
+ import { checkEdition } from "./home/check"
9
+ import { PAINTS, PAINT_BY_ID, paintContrast } from "./paints"
10
+ import { BRAND_PRODUCTS, type BrandText } from "./products"
11
+
12
+ export type CoherenceIssue = { level: "error" | "warning"; scope: string; message: string }
13
+
14
+ const TEXT_KEYS: (keyof BrandText)[] = ["kind", "promise", "blurb", "status", "claim"]
15
+
16
+ export function coherence(): CoherenceIssue[] {
17
+ const out: CoherenceIssue[] = []
18
+ const add = (level: CoherenceIssue["level"], scope: string, message: string) => out.push({ level, scope, message })
19
+
20
+ for (const p of PAINTS) {
21
+ const c = paintContrast(p)
22
+ if (c.signalOnField < 7) add("error", `paint ${p.id}`, `signal on field is ${c.signalOnField.toFixed(1)}:1 — a night band needs 7:1`)
23
+ if (c.onPrimary < 4.5) add("warning", `paint ${p.id}`, `button text on the light primary is ${c.onPrimary.toFixed(1)}:1 (under 4.5:1)`)
24
+ if (p.shelf && !BRAND_PRODUCTS.some((x) => x.paint === p.id)) add("warning", `paint ${p.id}`, "on the shelf, but no product wears it")
25
+ }
26
+
27
+ const promises = new Map<string, string>()
28
+ for (const p of BRAND_PRODUCTS) {
29
+ if (!PAINT_BY_ID[p.paint]) add("error", p.name, `wears an unknown paint "${p.paint}"`)
30
+ for (const l of ["en", "fr"] as const)
31
+ for (const k of TEXT_KEYS) {
32
+ const v = p[l][k]
33
+ if (!v?.trim()) add("error", p.name, `no ${l} ${k}`)
34
+ else if ((v.match(/\*/g) ?? []).length % 2) add("error", p.name, `${l} ${k} has an odd number of *`)
35
+ }
36
+ const seen = promises.get(p.en.promise)
37
+ if (seen) add("warning", p.name, `same promise as ${seen}`)
38
+ promises.set(p.en.promise, p.name)
39
+ if (p.en.claim === p.fr.claim) add("warning", p.name, "the French claim is the English one")
40
+ }
41
+
42
+ const seenFacts = new Set<string>()
43
+ for (const f of FACTS) {
44
+ if (seenFacts.has(f.id)) add("error", `fact ${f.id}`, "two facts share this id")
45
+ seenFacts.add(f.id)
46
+ if (!f.source.trim()) add("error", `fact ${f.id}`, "no source")
47
+ if (!f.value.en || !f.value.fr || !f.label.en || !f.label.fr) add("error", `fact ${f.id}`, "missing a language")
48
+ }
49
+
50
+ for (const e of HOME_EDITIONS)
51
+ for (const i of checkEdition(e)) add(i.level, `edition ${e.id}${i.section ? ` · ${i.section}` : ""}`, i.message)
52
+ for (const [product, id] of Object.entries(PUBLISHED)) {
53
+ if (!id) continue
54
+ const e = HOME_EDITION_BY_ID[id]
55
+ if (!e) add("error", `home of ${product}`, `PUBLISHED.${product} is "${id}", which is not an edition`)
56
+ else if (e.product !== product) add("error", `home of ${product}`, `PUBLISHED.${product} is "${id}", an edition of ${e.product}`)
57
+ }
58
+ for (const p of BRAND_PRODUCTS)
59
+ if (!HOME_EDITIONS.some((e) => e.product === p.id)) add("warning", p.name, "no home edition yet")
60
+
61
+ return out
62
+ }
package/src/count.ts ADDED
@@ -0,0 +1,14 @@
1
+ // Pure, shared by the video scenes and the stories.
2
+
3
+ const clamp01 = (x: number) => Math.min(1, Math.max(0, x))
4
+
5
+ /** "0.38 s" at k = 0.5 → "0.19 s": digits interpolate, the rest is kept. */
6
+ export function countTo(target: string, k: number): string {
7
+ const m = target.match(/\d+(?:[.,]\d+)?/)
8
+ if (!m) return target
9
+ const sep = m[0].includes(",") ? "," : "."
10
+ const [, dec = ""] = m[0].split(sep)
11
+ const v = parseFloat(m[0].replace(",", ".")) * clamp01(k)
12
+ return target.replace(m[0], v.toFixed(dec.length).replace(".", sep))
13
+ }
14
+
@@ -0,0 +1,18 @@
1
+ /** Splits `text` on `*marked*` runs and paints them — the one word that matters, in the signal colour. */
2
+ export function Emphasis({ text, color }: { text: string; color: string }) {
3
+ const parts = text.split(/(\*[^*]+\*)/g)
4
+ return (
5
+ <>
6
+ {parts.map((p, i) =>
7
+ p.startsWith("*") && p.endsWith("*") && p.length > 2 ? (
8
+ // `data-em`: an editor reading the text back (home/editable.tsx) puts the stars back around it.
9
+ <span key={i} data-em="" style={{ color }}>
10
+ {p.slice(1, -1)}
11
+ </span>
12
+ ) : (
13
+ <span key={i}>{p}</span>
14
+ ),
15
+ )}
16
+ </>
17
+ )
18
+ }
package/src/facts.ts ADDED
@@ -0,0 +1,244 @@
1
+ /* ─── What the brand is allowed to claim ──────────────────────────────────
2
+ Every figure a Spunto surface quotes lives here, with where it comes from,
3
+ so a claim that goes stale has one place to be fixed — and a figure nobody
4
+ can source has nowhere to hide. Moved from apps/next on 2026-11-08 (RFC
5
+ 0059): the site re-exports this module, the studio's starters and the home
6
+ editions (`FACTS`, at the end) read it too.
7
+
8
+ The pull-request counts are the page's central proof ("we work in it"), so
9
+ they are counted, not estimated. An agent branch is one a Spunto worker
10
+ opened: `task/…` (native tasks) or `notion/…` (the idea→prod pipeline that
11
+ preceded them, which also ran its agents on Spunto workers). Refresh with:
12
+
13
+ for r in coderhammer/spunto spuntodotnet/search spuntodotnet/spunto-cms spuntodotnet/spunto-lite; do
14
+ gh pr list -R $r --state merged --limit 1000 --json headRefName \
15
+ -q "[length, ([.[]|select(.headRefName|test(\"^(notion|task)/\"))]|length)]"
16
+ done
17
+
18
+ and bump `PROOF_AS_OF` with them. */
19
+
20
+ export const PROOF_AS_OF = "September 24, 2026"
21
+
22
+ export type RepoProof = {
23
+ name: string
24
+ /** What the thing is, in one line — this row is also where the ecosystem
25
+ * gets its meaning: every one of these was built the way the page sells. */
26
+ what: string
27
+ agent: number
28
+ merged: number
29
+ href?: string
30
+ }
31
+
32
+ export const REPO_PROOF: RepoProof[] = [
33
+ {
34
+ name: "Spunto Cloud",
35
+ what: "this platform — API, dashboard, node agent, this page",
36
+ agent: 117,
37
+ merged: 247,
38
+ },
39
+ {
40
+ name: "Spunto Search",
41
+ what: "an Elasticsearch-compatible engine in Rust",
42
+ agent: 44,
43
+ merged: 57,
44
+ href: "/spunto-search",
45
+ },
46
+ {
47
+ name: "Spunto CMS",
48
+ what: "a Notion-style workspace, live at cms.spunto.net",
49
+ agent: 27,
50
+ merged: 35,
51
+ href: "/spunto-cms",
52
+ },
53
+ {
54
+ name: "Spunto Lite",
55
+ what: "the self-hosted, one-container edition",
56
+ agent: 23,
57
+ merged: 43,
58
+ href: "https://lite.spunto.net",
59
+ },
60
+ ]
61
+
62
+ export const PROOF_TOTAL = REPO_PROOF.reduce(
63
+ (acc, r) => ({ agent: acc.agent + r.agent, merged: acc.merged + r.merged }),
64
+ { agent: 0, merged: 0 }
65
+ )
66
+
67
+ /* Measured, not promised. `READY_WARM` is a sampled spawn with the project
68
+ image already on the node (rfc/0027, "t+2.9s state=ready"); a cold image
69
+ build takes minutes, and the page says "warm" wherever it quotes this. */
70
+ export const READY_WARM = "2.9 s"
71
+
72
+ /* Counted from the code: operations in apps/api/openapi.yaml (method keys
73
+ under `paths`), tools in modules/mcp/mcp.tools.ts (`server.registerTool(`),
74
+ scopes in modules/api-keys/api-keys.types.ts. Bump `API_COUNTED_AS_OF` with
75
+ them — the page prints it next to the figures. */
76
+ export const API_COUNTED_AS_OF = "October 17, 2026"
77
+ export const API_OPERATIONS = 228
78
+ export const MCP_TOOLS = 20
79
+ export const KEY_SCOPES = 15
80
+
81
+ /* ─── The microVMs (since the 2026-10-17 pivot) ───────────────────────────
82
+ Every timing below is quoted from RFC 0039 as written, and every one was
83
+ measured on the same machine — a 2012 Xeon E3-1245 v2 with a SATA SSD,
84
+ outside Firecracker's tested list, which the RFC calls pessimistic. The
85
+ page prints `MEASURED_ON` wherever it quotes one of them. */
86
+ export const MEASURED_ON = "a 2012 Xeon E3-1245 v2"
87
+
88
+ /** Pause → resume until the agent is back online, 7 cycles (RFC 0039 § 5). */
89
+ export const RESUME = { low: "0.34 s", high: "0.43 s", cycles: 7 }
90
+ /** The fork API call, pause of the source included (RFC 0039 § 5). */
91
+ export const FORK_CALL = "602 ms"
92
+ /** The copy's agent online after the fork call (RFC 0039 § 5). */
93
+ export const FORK_ONLINE = "2.9 s"
94
+ /** A box from a ready build, daemon side (RFC 0039 § 5). */
95
+ export const FROM_BUILD = "0.58–0.68 s"
96
+ /** …and until its agent is online (RFC 0039 § 5). */
97
+ export const FROM_BUILD_ONLINE = "~3 s"
98
+ /** Growing a disk on a running box (RFC 0039 § 4.12). */
99
+ export const GROW = "919 ms"
100
+ /** Fair network sharing, two boxes on a full uplink (docs/sandboxes.md, RFC 0039 § 22). */
101
+ export const NET_SHARE = { before: "85 / 11 Mbit/s", after: "48 / 47 Mbit/s", cap: "200 Mbit/s" }
102
+ /** Sizes, from apps/runtime-apps/src/providers/firecracker.ts. */
103
+ export const SIZES = ["1 vCPU · 2 GB", "2 vCPU · 4 GB", "4 vCPU · 8 GB", "8 vCPU · 16 GB"]
104
+ /* ─── The price (RFC 0044, apps/api/src/modules/billing/) ─────────────────
105
+ In euros, like the dashboard. A running box pays for its RAM, per started
106
+ minute; paused, stopped, building and disks are free; vCPU is not priced
107
+ apart. `rates.ts` holds the rate, `plans.ts` the subscription and its cap. */
108
+ /** MILLIS_PER_GB_HOUR = 10 thousandths of a euro → one cent per GB·hour (re-priced 2026-10-28).
109
+ * The home film (#demo, docs/videos.md) ends on this rate and on €0.013: change it, remake the film. */
110
+ export const EUR_PER_GB_HOUR = 0.01
111
+
112
+ /** A month of hours, for "24/7 for a month" (365 × 24 / 12). */
113
+ export const HOURS_PER_MONTH = 730
114
+
115
+ const WORDS = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen"]
116
+
117
+ /** "two cents", "€0.25" — a price in words while it is a small whole number of cents. */
118
+ export function centsInWords(eur: number): string {
119
+ const cents = Math.round(eur * 100)
120
+ if (Math.abs(eur * 100 - cents) < 1e-9 && cents < WORDS.length) return `${WORDS[cents]} cent${cents === 1 ? "" : "s"}`
121
+ return `€${eur.toFixed(2)}`
122
+ }
123
+
124
+ /** The rate in the middle of a sentence: "one cent per GB-hour". */
125
+ export const RATE_WORDS_INLINE = `${centsInWords(EUR_PER_GB_HOUR)} per GB-hour`
126
+
127
+ /** The rate, said the way the pages headline it: "One cent per GB-hour". */
128
+ export const RATE_WORDS = `${RATE_WORDS_INLINE.charAt(0).toUpperCase()}${RATE_WORDS_INLINE.slice(1)}`
129
+ export const RATES: { size: string; spec: string; gb: number }[] = [
130
+ { size: "small", spec: "1 vCPU · 2 GB", gb: 2 },
131
+ { size: "default", spec: "2 vCPU · 4 GB", gb: 4 },
132
+ { size: "large", spec: "4 vCPU · 8 GB", gb: 8 },
133
+ { size: "xlarge", spec: "8 vCPU · 16 GB", gb: 16 },
134
+ ]
135
+ /** `STRIPE_PLAN` — each paid invoice credits the same amount to the workspace. */
136
+ export const SUBSCRIPTION_EUR = 20
137
+ /** `TOPUP_AMOUNTS`, subscribers only; top-ups never expire. */
138
+ export const TOPUPS_EUR = [10, 20, 50]
139
+ /** `starter` plan cap on running RAM (`plans.ts`, `runningMemMib: 16 * 1024`). */
140
+ export const PAID_RUNNING_RAM_GB = 16
141
+ export const PAID_RUNNING_RAM = `${PAID_RUNNING_RAM_GB} GB`
142
+ /** The trial of RFC 0044 § 6 (`plans.ts`): the first `TRIAL_DAYS` days of the
143
+ * subscription, card taken at Checkout, with `TRIAL_CREDIT_MILLIS` of credit;
144
+ * one `small` box (1 vCPU, 2 GB) at a time, paused after an hour of running. */
145
+ export const TRIAL_EUR = 2
146
+ export const TRIAL_DAYS = 7
147
+ /** Said wherever the trial is: the card is taken, nothing is charged before it ends. */
148
+ export const TRIAL_TERMS = `card required, nothing charged for ${TRIAL_DAYS} days, cancel anytime`
149
+ /** Flip to false to stop offering the trial (`TRIAL_CREDIT_MILLIS=0`): the hero
150
+ * line, the price row, the FAQ sentence and the closing headline all follow it. */
151
+ export const TRIAL_LIVE = true
152
+
153
+ /* ─── The catalogue: a figure, said in both languages, with its source ────
154
+ What a home edition (home/) or a studio template quotes by id — `{ fact:
155
+ "resume" }` — rather than by typing a number. A fact is built from the
156
+ constants above, so bumping one updates every edition that quotes it, and an
157
+ edition can't print a figure that isn't here (home/check.ts). */
158
+
159
+ export type Words = { en: string; fr: string }
160
+
161
+ export type Fact = {
162
+ id: string
163
+ /** The figure itself, as printed: "0.34 s". */
164
+ value: Words
165
+ /** What it measures, one line under it. */
166
+ label: Words
167
+ /** Where it comes from — an RFC section, a file, a command. Never empty. */
168
+ source: string
169
+ }
170
+
171
+ /** "0.34 s" → "0,34 s": a decimal point between two digits, in French. */
172
+ export const frNumber = (s: string) => s.replace(/(\d)\.(\d)/g, "$1,$2")
173
+ const same = (v: string): Words => ({ en: v, fr: frNumber(v) })
174
+ const eur = (n: number, digits = 0): Words => ({ en: `€${n.toFixed(digits)}`, fr: `${n.toFixed(digits).replace(".", ",")}\u00a0€` })
175
+
176
+ /** Spunto Cloud's and the company's facts. Each product's own are in home/products/<id>.ts; all of them: `ALL_FACTS` (home/facts-index.ts). */
177
+ export const FACTS: Fact[] = [
178
+ {
179
+ id: "resume",
180
+ value: same(`${RESUME.low}`),
181
+ label: { en: "from pause to an agent back online", fr: "de la pause à l’agent de nouveau en ligne" },
182
+ source: `RFC 0039 § 5, ${RESUME.cycles} cycles, on ${MEASURED_ON}`,
183
+ },
184
+ {
185
+ id: "fork",
186
+ value: same(FORK_CALL),
187
+ label: { en: "to fork a box while it runs", fr: "pour forker une sandbox qui tourne" },
188
+ source: `RFC 0039 § 5, on ${MEASURED_ON}`,
189
+ },
190
+ {
191
+ id: "from-build",
192
+ value: same(FROM_BUILD),
193
+ label: { en: "a new box from a ready build", fr: "une sandbox neuve depuis un build prêt" },
194
+ source: `RFC 0039 § 5, daemon side, on ${MEASURED_ON}`,
195
+ },
196
+ {
197
+ id: "grow",
198
+ value: same(GROW),
199
+ label: { en: "to grow a disk on a running box", fr: "pour agrandir le disque d’une sandbox qui tourne" },
200
+ source: `RFC 0039 § 4.12, on ${MEASURED_ON}`,
201
+ },
202
+ {
203
+ id: "rate",
204
+ value: eur(EUR_PER_GB_HOUR, 2),
205
+ label: { en: "per GB of RAM per hour, by the minute — nothing while paused", fr: "par Go de RAM et par heure, à la minute — rien pendant la pause" },
206
+ source: "apps/api/src/modules/billing/rates.ts (MILLIS_PER_GB_HOUR)",
207
+ },
208
+ {
209
+ id: "small-hour",
210
+ value: eur(RATES[0].gb * EUR_PER_GB_HOUR, 2),
211
+ label: { en: `an hour of a small box (${RATES[0].spec})`, fr: `l’heure d’une petite sandbox (${RATES[0].spec.replace("GB", "Go")})` },
212
+ source: "rates.ts × the small size of runtime-apps/src/providers/firecracker.ts",
213
+ },
214
+ {
215
+ id: "trial",
216
+ value: eur(TRIAL_EUR),
217
+ label: { en: `of credit to try, ${TRIAL_DAYS} days`, fr: `de crédit pour essayer, ${TRIAL_DAYS} jours` },
218
+ source: "apps/api/src/modules/billing/plans.ts (TRIAL_CREDIT_MILLIS), RFC 0044 § 6",
219
+ },
220
+ {
221
+ id: "subscription",
222
+ value: eur(SUBSCRIPTION_EUR),
223
+ label: { en: "a month, credited in full to usage", fr: "par mois, intégralement crédités sur la consommation" },
224
+ source: "apps/api/src/modules/billing/plans.ts (STRIPE_PLAN)",
225
+ },
226
+ {
227
+ id: "agent-prs",
228
+ value: same(String(PROOF_TOTAL.agent)),
229
+ label: { en: `pull requests merged from agent branches, out of ${PROOF_TOTAL.merged}`, fr: `pull requests fusionnées depuis des branches d’agent, sur ${PROOF_TOTAL.merged}` },
230
+ source: `gh pr list on ${REPO_PROOF.length} repos, as of ${PROOF_AS_OF} (command above)`,
231
+ },
232
+ {
233
+ id: "api-operations",
234
+ value: same(String(API_OPERATIONS)),
235
+ label: { en: "operations in the REST API — every one an agent can call", fr: "opérations dans l’API REST — toutes appelables par un agent" },
236
+ source: `apps/api/openapi.yaml, counted ${API_COUNTED_AS_OF}`,
237
+ },
238
+ {
239
+ id: "sizes",
240
+ value: same(String(SIZES.length)),
241
+ label: { en: `sizes, from ${SIZES[0]} to ${SIZES[SIZES.length - 1]}`, fr: `tailles, de ${SIZES[0].replace("GB", "Go")} à ${SIZES[SIZES.length - 1].replace("GB", "Go")}` },
242
+ source: "apps/runtime-apps/src/providers/firecracker.ts",
243
+ },
244
+ ]
package/src/formats.ts ADDED
@@ -0,0 +1,22 @@
1
+ // The canvases we publish on.
2
+ //
3
+ // A template is drawn at its format's real pixel size and scaled to fit a
4
+ // preview — so what you see in the studio is exactly the exported file, not a
5
+ // responsive approximation of it.
6
+
7
+ export type FormatId = "og" | "square" | "portrait" | "story" | "linkedin-banner" | "x-header" | "video" | "video-vertical"
8
+
9
+ export type BrandFormat = { id: FormatId; label: string; width: number; height: number; use: string }
10
+
11
+ export const FORMATS: Record<FormatId, BrandFormat> = {
12
+ og: { id: "og", label: "Open Graph", width: 1200, height: 630, use: "Link previews, blog covers, X/LinkedIn link cards" },
13
+ square: { id: "square", label: "Square post", width: 1080, height: 1080, use: "Instagram, LinkedIn, Mastodon" },
14
+ portrait: { id: "portrait", label: "Portrait post", width: 1080, height: 1350, use: "Instagram / LinkedIn feed, 4:5" },
15
+ story: { id: "story", label: "Story", width: 1080, height: 1920, use: "Stories, Shorts covers" },
16
+ "linkedin-banner": { id: "linkedin-banner", label: "LinkedIn banner", width: 1584, height: 396, use: "Profile and company page header" },
17
+ "x-header": { id: "x-header", label: "X header", width: 1500, height: 500, use: "Profile header on X" },
18
+ video: { id: "video", label: "Video 16:9", width: 1920, height: 1080, use: "YouTube, site, demos" },
19
+ "video-vertical": { id: "video-vertical", label: "Video 9:16", width: 1080, height: 1920, use: "Reels, Shorts, TikTok" },
20
+ }
21
+
22
+ export const SOCIAL_FORMATS: FormatId[] = ["og", "square", "portrait", "story", "linkedin-banner", "x-header"]