@continuous-excellence/ze-great-dashboard-aws 0.1.23 → 0.1.25
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 +7 -5
- package/client/.vite/manifest.json +2 -2
- package/client/assets/index-DOvxvZo2.js +3 -0
- package/client/assets/index-DOvxvZo2.js.map +1 -0
- package/client/assets/index-r7iEInfY.css +1 -0
- package/client/index.html +2 -2
- package/dist/cli.js +22 -5
- package/dist/index.d.ts +8 -0
- package/dist/index.js +12 -5
- package/dist/lambda.mjs +38 -5
- package/package.json +1 -1
- package/template.yml +9 -1
- package/client/assets/index-3-dS42M8.css +0 -1
- package/client/assets/index-BddJ8Qxp.js +0 -3
- package/client/assets/index-BddJ8Qxp.js.map +0 -1
package/README.md
CHANGED
|
@@ -14,8 +14,8 @@ opinion about your process. Every panel is a live read of a system that already
|
|
|
14
14
|
Design doc: `ze-great-idea-pit/tool-ideas/trust-dashboard.md`. How this repo came to be shaped the
|
|
15
15
|
way it is, including the quirks that look like bugs: `docs/initialization-log.md`.
|
|
16
16
|
|
|
17
|
-
**Status:
|
|
18
|
-
|
|
17
|
+
**Status: MVP in active use.** GitHub Actions `pipeline-status` and source-agnostic `http-value`
|
|
18
|
+
panels work end to end. Azure DevOps remains to be built.
|
|
19
19
|
|
|
20
20
|
## Quickstart
|
|
21
21
|
|
|
@@ -116,12 +116,14 @@ Server environment variables are documented in `.env.example`. The one that matt
|
|
|
116
116
|
## Deploying
|
|
117
117
|
|
|
118
118
|
Push to `main`. CI checks, versions with [Tagger](https://github.com/robertfmurdock/tagger), publishes
|
|
119
|
-
the client
|
|
119
|
+
the immutable client assets, then deploys the exact npm tarball to the repository-owned consumer
|
|
120
|
+
reference before publishing that same tarball.
|
|
120
121
|
|
|
121
122
|
Infrastructure is a CloudFormation stack under `infra/`. On `main`, CI deploys the stack before it
|
|
122
|
-
publishes assets and updates the Lambda.
|
|
123
|
+
publishes assets and updates the Lambda. The public client origin is
|
|
124
|
+
`https://public-assets.zegreatrob.com`. Other branches receive no AWS credentials. CloudFormation
|
|
123
125
|
keeps the infrastructure state in AWS; `infra/README.md` documents the one-time GitHub OIDC role
|
|
124
|
-
|
|
126
|
+
bootstraps, including the consumer reference.
|
|
125
127
|
|
|
126
128
|
For a consumer-managed deployment with the published AWS package, see [`docs/aws-setup.md`](docs/aws-setup.md).
|
|
127
129
|
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{z as e}from"zod";import{StrictMode as t,useEffect as n,useState as r}from"react";import{createRoot as i}from"react-dom/client";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var c=/^(\d+)(ms|s|m|h)$/,l={ms:1,s:1e3,m:6e4,h:36e5};function u(e){let t=c.exec(e);if(!t)return null;let[,n,r]=t;if(n===void 0||r===void 0)return null;let i=Number(n);return i<=0?null:i*l[r]}var d=e.string().refine(e=>u(e)!==null,{message:`must be a positive duration like "30s", "5m", or "1h"`}).brand(),f=e.object({x:e.number().int().min(0),y:e.number().int().min(0),w:e.number().int().min(1).max(12),h:e.number().int().min(1)}),p=e.looseObject({id:e.string().min(1),type:e.string().min(1),source:e.string().min(1).optional(),position:f.optional(),refresh:d.optional(),link:e.url().optional(),url:e.url().optional(),json_path:e.string().regex(/^\$(?:\.[A-Za-z_][A-Za-z0-9_]*|\[\d+\])*$/,`must be a simple JSON path`).optional()}),m=e.looseObject({type:e.string().min(1),token_env:e.string().min(1).optional()}),h=e.object({refresh:d.optional(),panels:e.array(p).min(1).superRefine((e,t)=>{let n=new Map;e.forEach((e,r)=>{let i=n.get(e.id);if(i===void 0){n.set(e.id,r);return}t.addIssue({code:`custom`,path:[r,`id`],message:`duplicate panel id "${e.id}" (already used by panel at index ${i})`})})})}),g=e.object({issuer:e.url(),client_id:e.string().min(1).optional(),allow:e.object({groups:e.array(e.string().min(1)).optional(),subjects:e.array(e.string().min(1)).optional()}).optional()});e.object({sources:e.record(e.string().min(1),m).default({}),boards:e.record(e.string().min(1),h),auth:g.optional()});function _(e){let t=e.panelOverrideMillis??e.boardDefaultMillis;return Math.max(t,e.adapterFloorMillis)}var v=e.object({assetPath:e.string().min(1),proxyPath:e.string().min(1),board:e.string().min(1),clientVersion:e.string().min(1),auth:e.object({issuer:e.string().min(1),clientId:e.string().min(1).optional()}).optional()});function y(t=globalThis.window?.env){let n=v.safeParse(t);if(!n.success)throw Error(`window.env is missing or invalid \u2014 the server did not inject usable configuration.
|
|
2
|
+
${e.prettifyError(n.error)}`);return n.data}var b=e.enum([`unreachable`,`unauthorized`,`not-found`,`no-runs`,`upstream-error`]),x=e.object({kind:b,message:e.string()}),S=e.discriminatedUnion(`state`,[e.object({panelId:e.string().min(1),state:e.literal(`ok`),observedAt:e.iso.datetime(),link:e.url().nullable(),signal:e.unknown()}),e.object({panelId:e.string().min(1),state:e.literal(`error`),observedAt:e.iso.datetime(),link:e.url().nullable(),error:x})]),C=e.object({type:e.literal(`pipeline-status`),status:e.enum([`passed`,`failed`,`running`,`cancelled`,`unknown`]),rawStatus:e.string(),name:e.string().min(1),branch:e.string().min(1).optional(),durationMs:e.number().int().nonnegative().optional()}),w=e.object({type:e.literal(`http-value`),value:e.union([e.string(),e.number(),e.boolean()])});function T({value:e}){let t=new Date(e),n=t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),r=Date.now()-t.getTime(),i=r>3e5,a=E(r);return s(`p`,{className:`panel__hint panel__observed${i?` panel__observed--stale`:``}`,children:[o(`span`,{"aria-hidden":`true`,children:`◷`}),` As of `,n,` · `,a]})}function E(e){if(e<6e4)return`just now`;let t=Math.floor(e/6e4);return t<60?`${t}m ago`:`${Math.floor(t/60)}h ${t%60}m ago`}function D(e){let t=e.position;if(t)return{"--panel-column":`${t.x+1} / span ${t.w}`,"--panel-row":`${t.y+1} / span ${t.h}`}}function O({panel:e,data:t}){if(!t)return s(`section`,{className:`panel`,style:D(e),"aria-busy":`true`,children:[o(`h2`,{className:`panel__label`,children:e.id}),o(`p`,{className:`panel__hint`,children:`Loading…`})]});if(t.state===`error`)return s(`section`,{className:`panel panel--error`,style:D(e),children:[o(`h2`,{className:`panel__label`,children:e.id}),o(`p`,{className:`panel__status`,children:`⚠ Unable to read`}),o(`p`,{className:`panel__hint`,children:t.error.message}),o(T,{value:t.observedAt})]});let n=w.safeParse(t.signal);if(!n.success)return s(`section`,{className:`panel panel--error`,style:D(e),children:[o(`h2`,{className:`panel__label`,children:e.id}),o(`p`,{className:`panel__status`,children:`⚠ Invalid value`}),o(T,{value:t.observedAt})]});let r=s(a,{children:[o(`p`,{className:`panel__status`,children:String(n.data.value)}),o(T,{value:t.observedAt})]});return s(`section`,{className:`panel`,style:D(e),children:[o(`h2`,{className:`panel__label`,children:e.id}),t.link?o(`a`,{className:`panel__link`,href:t.link,children:r}):r]})}function k({label:e,hint:t,wide:n=!1}){return s(`section`,{className:n?`panel panel--wide`:`panel`,children:[o(`h2`,{className:`panel__label`,children:e}),o(`p`,{className:`panel__hint`,children:t})]})}function A({panel:e,data:t}){if(!t)return s(`section`,{className:`panel`,style:D(e),"aria-busy":`true`,children:[o(`h2`,{className:`panel__label`,children:e.id}),o(`p`,{className:`panel__hint`,children:`Loading…`})]});if(t.state===`error`)return s(`section`,{className:`panel panel--error`,style:D(e),children:[o(`h2`,{className:`panel__label`,children:e.id}),s(`p`,{className:`panel__status`,children:[`⚠ `,t.error.kind===`no-runs`?`No workflow runs`:`Unable to read`]}),o(`p`,{className:`panel__hint`,children:t.error.message}),o(T,{value:t.observedAt})]});let n=C.safeParse(t.signal);if(!n.success)return s(`section`,{className:`panel panel--error`,style:D(e),children:[o(`h2`,{className:`panel__label`,children:e.id}),o(`p`,{className:`panel__status`,children:`⚠ Invalid signal`}),o(T,{value:t.observedAt})]});let r=M(n.data.status),i=s(a,{children:[s(`p`,{className:`panel__status panel__status--${n.data.status}`,children:[r.glyph,` `,r.label]}),s(`p`,{className:`panel__hint`,children:[n.data.name,` · `,n.data.rawStatus,n.data.branch&&s(`span`,{className:`panel__branch`,title:`Branch: ${n.data.branch}`,children:[o(`span`,{"aria-hidden":`true`,children:` · ⎇ `}),o(`span`,{className:`screen-reader-only`,children:`Branch: `}),n.data.branch]})]}),n.data.status!==`running`&&n.data.durationMs!==void 0&&s(`p`,{className:`panel__hint`,children:[`Took `,j(n.data.durationMs)]}),o(T,{value:t.observedAt})]});return s(`section`,{className:`panel`,style:D(e),children:[o(`h2`,{className:`panel__label`,children:e.id}),t.link?o(`a`,{className:`panel__link`,href:t.link,children:i}):i]})}function j(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${i}s`:`${i}s`}function M(e){switch(e){case`passed`:return{glyph:`✓`,label:`Passed`};case`failed`:return{glyph:`✕`,label:`Failed`};case`running`:return{glyph:`↻`,label:`Running`};case`cancelled`:return{glyph:`⊘`,label:`Cancelled`};case`unknown`:return{glyph:`?`,label:`Unknown`}}}function N(e){let t=S.safeParse(e);return t.success?t.data:void 0}function P({env:e}){let[t,i]=r(),[a,c]=r(),[l,d]=r({});return n(()=>{let t=!1;return i(void 0),c(void 0),d({}),fetch(`${e.proxyPath}/boards/${encodeURIComponent(e.board)}`).then(e=>e.ok?e.json():Promise.reject(Error(`Board configuration returned ${e.status}`))).then(n=>{t||(i(n),c(e.board))}).catch(()=>{t||(i({panels:[]}),c(e.board))}),()=>{t=!0}},[e.board,e.proxyPath]),n(()=>{if(!t||a!==e.board)return;let n=!1,r=[];for(let i of t.panels){if(i.type!==`pipeline-status`&&i.type!==`http-value`)continue;let a=!1,o=_({boardDefaultMillis:u(t.refresh??`60s`)??6e4,panelOverrideMillis:i.refresh?u(i.refresh)??void 0:void 0,adapterFloorMillis:0}),s=()=>{n||a||(a=!0,fetch(`${e.proxyPath}/panel/${encodeURIComponent(e.board)}/${encodeURIComponent(i.id)}`).then(e=>e.status===304?void 0:e.json()).then(e=>{let t=N(e);!n&&t&&d(e=>({...e,[i.id]:t}))}).catch(()=>void 0).finally(()=>{a=!1}))};s(),r.push(window.setInterval(s,o))}return()=>{n=!0;for(let e of r)window.clearInterval(e)}},[t,e.board,e.proxyPath,a]),s(`div`,{className:`board`,children:[s(`header`,{className:`board__header`,children:[o(`h1`,{className:`board__title`,children:e.board}),s(`dl`,{className:`board__meta`,children:[s(`div`,{children:[o(`dt`,{children:`client`}),o(`dd`,{children:e.clientVersion})]}),s(`div`,{children:[o(`dt`,{children:`assets`}),o(`dd`,{children:e.assetPath})]})]})]}),s(`main`,{className:`board__grid`,children:[!t&&o(k,{label:`board`,hint:`Loading configuration…`,wide:!0}),t?.panels.map(e=>e.type===`pipeline-status`?o(A,{panel:e,data:l[e.id]},e.id):e.type===`http-value`?o(O,{panel:e,data:l[e.id]},e.id):o(k,{label:e.type,hint:`Not wired yet`,wide:!0},e.id))]}),o(`footer`,{className:`board__footer`,children:`Signals are read live from their configured authorities.`})]})}function F({message:e}){return s(`div`,{className:`config-error`,role:`alert`,children:[o(`h1`,{children:`⚠️ Dashboard misconfigured`}),o(`p`,{children:`The page loaded, but the server did not hand it usable configuration.`}),o(`pre`,{children:e})]})}var I=document.getElementById(`root`);if(!I)throw Error(`No #root element in the document — the template is not the one we expect.`);var L=i(I);try{L.render(o(t,{children:o(P,{env:y()})}))}catch(e){L.render(o(F,{message:e instanceof Error?e.message:String(e)}))}
|
|
3
|
+
//# sourceMappingURL=index-DOvxvZo2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DOvxvZo2.js","names":[],"sources":["../../../shared/dist/index.js","../../src/ObservedAt.tsx","../../src/panel-layout.ts","../../src/HttpValuePanel.tsx","../../src/PanelPlaceholder.tsx","../../src/PipelinePanel.tsx","../../src/App.tsx","../../src/ConfigError.tsx","../../src/main.tsx"],"sourcesContent":["// packages/shared/src/board-config.ts\nimport { z as z2 } from \"zod\";\n\n// packages/shared/src/duration.ts\nimport { z } from \"zod\";\nvar DURATION_PATTERN = /^(\\d+)(ms|s|m|h)$/;\nvar UNIT_MILLIS = {\n ms: 1,\n s: 1e3,\n m: 6e4,\n h: 36e5\n};\nfunction parseDuration(value) {\n const match = DURATION_PATTERN.exec(value);\n if (!match) return null;\n const [, rawAmount, rawUnit] = match;\n if (rawAmount === void 0 || rawUnit === void 0) return null;\n const amount = Number(rawAmount);\n if (amount <= 0) return null;\n return amount * UNIT_MILLIS[rawUnit];\n}\nvar durationSchema = z.string().refine((value) => parseDuration(value) !== null, {\n message: 'must be a positive duration like \"30s\", \"5m\", or \"1h\"'\n}).brand();\n\n// packages/shared/src/board-config.ts\nvar positionSchema = z2.object({\n x: z2.number().int().min(0),\n y: z2.number().int().min(0),\n w: z2.number().int().min(1).max(12),\n h: z2.number().int().min(1)\n});\nvar panelSchema = z2.looseObject({\n id: z2.string().min(1),\n type: z2.string().min(1),\n source: z2.string().min(1).optional(),\n /** Advisory in v1 — a panel without a position renders in config order rather than not at all. */\n position: positionSchema.optional(),\n refresh: durationSchema.optional(),\n /** A deliberate override only. Adapters derive links; hand-written ones drift. */\n link: z2.url().optional(),\n /** Source-agnostic endpoint used by the http-value signal. */\n url: z2.url().optional(),\n /** Small, deliberate JSON path subset: $.version, $.deployment.version, or $.response.docs[0].latestVersion. */\n json_path: z2.string().regex(/^\\$(?:\\.[A-Za-z_][A-Za-z0-9_]*|\\[\\d+\\])*$/, \"must be a simple JSON path\").optional()\n});\nvar sourceSchema = z2.looseObject({\n type: z2.string().min(1),\n /** Credentials are never in the config — only the name of the env var holding one. */\n token_env: z2.string().min(1).optional()\n});\nvar boardSchema = z2.object({\n refresh: durationSchema.optional(),\n panels: z2.array(panelSchema).min(1).superRefine((panels, ctx) => {\n const seen = /* @__PURE__ */ new Map();\n panels.forEach((panel, index) => {\n const firstIndex = seen.get(panel.id);\n if (firstIndex === void 0) {\n seen.set(panel.id, index);\n return;\n }\n ctx.addIssue({\n code: \"custom\",\n path: [index, \"id\"],\n message: `duplicate panel id \"${panel.id}\" (already used by panel at index ${firstIndex})`\n });\n });\n })\n});\nvar authSchema = z2.object({\n issuer: z2.url(),\n /** Absent in gateway mode — the gateway does the flow, the proxy still validates. */\n client_id: z2.string().min(1).optional(),\n allow: z2.object({\n groups: z2.array(z2.string().min(1)).optional(),\n subjects: z2.array(z2.string().min(1)).optional()\n }).optional()\n});\nvar boardConfigSchema = z2.object({\n sources: z2.record(z2.string().min(1), sourceSchema).default({}),\n boards: z2.record(z2.string().min(1), boardSchema),\n auth: authSchema.optional()\n});\nfunction resolveRefreshMillis(args) {\n const requested = args.panelOverrideMillis ?? args.boardDefaultMillis;\n return Math.max(requested, args.adapterFloorMillis);\n}\n\n// packages/shared/src/client-env.ts\nimport { z as z3 } from \"zod\";\nvar clientEnvSchema = z3.object({\n /** Where the immutable client assets live. The one variable that repoints the whole client. */\n assetPath: z3.string().min(1),\n /** Same-origin path the proxy is mounted at, so there is no CORS and no cookie problem. */\n proxyPath: z3.string().min(1),\n /** Which board this is, resolved server-side so the client parses no URLs. */\n board: z3.string().min(1),\n /** The client version being served, so two published versions are visibly distinguishable. */\n clientVersion: z3.string().min(1),\n /** Omitted entirely when unauthenticated — presence is what turns auth on. */\n auth: z3.object({\n issuer: z3.string().min(1),\n clientId: z3.string().min(1).optional()\n }).optional()\n});\nfunction readClientEnv(source = globalThis.window?.env) {\n const result = clientEnvSchema.safeParse(source);\n if (!result.success) {\n throw new Error(\n `window.env is missing or invalid \\u2014 the server did not inject usable configuration.\n${z3.prettifyError(result.error)}`\n );\n }\n return result.data;\n}\n\n// packages/shared/src/envelope.ts\nimport { z as z4 } from \"zod\";\nvar errorKindSchema = z4.enum([\n \"unreachable\",\n \"unauthorized\",\n \"not-found\",\n \"no-runs\",\n \"upstream-error\"\n]);\nvar envelopeErrorSchema = z4.object({\n kind: errorKindSchema,\n message: z4.string()\n});\nvar envelopeSchema = z4.discriminatedUnion(\"state\", [\n z4.object({\n panelId: z4.string().min(1),\n state: z4.literal(\"ok\"),\n /** From the upstream response `Date`. A cached value must never be shown without its age. */\n observedAt: z4.iso.datetime(),\n /** Adapter-derived. The authority for this panel; the dashboard itself asserts nothing. */\n link: z4.url().nullable(),\n signal: z4.unknown()\n }),\n z4.object({\n panelId: z4.string().min(1),\n state: z4.literal(\"error\"),\n /**\n * Populated even on error: knowing *when* a failure was observed is the difference between\n * \"broken just now\" and \"broken all morning\", and a panel that can't reach its source is\n * exactly when a viewer most wants to click through.\n */\n observedAt: z4.iso.datetime(),\n link: z4.url().nullable(),\n error: envelopeErrorSchema\n })\n]);\nvar pipelineStatusSchema = z4.object({\n type: z4.literal(\"pipeline-status\"),\n status: z4.enum([\"passed\", \"failed\", \"running\", \"cancelled\", \"unknown\"]),\n /** The source's unmodified status/result vocabulary, for an honest display. */\n rawStatus: z4.string(),\n name: z4.string().min(1),\n /** The branch represented by this status, when the upstream supplies or filters by one. */\n branch: z4.string().min(1).optional(),\n /** Elapsed execution time, supplied only after the upstream run has completed. */\n durationMs: z4.number().int().nonnegative().optional()\n});\nvar httpValueSchema = z4.object({\n type: z4.literal(\"http-value\"),\n value: z4.union([z4.string(), z4.number(), z4.boolean()])\n});\nexport {\n authSchema,\n boardConfigSchema,\n boardSchema,\n clientEnvSchema,\n durationSchema,\n envelopeSchema,\n errorKindSchema,\n httpValueSchema,\n panelSchema,\n parseDuration,\n pipelineStatusSchema,\n positionSchema,\n readClientEnv,\n resolveRefreshMillis,\n sourceSchema\n};\n","export function ObservedAt({ value }: { value: string }) {\n const observed = new Date(value)\n const formatted = observed.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })\n const age = Date.now() - observed.getTime()\n const stale = age > 5 * 60 * 1000\n const ageText = formatAge(age)\n return (\n <p className={`panel__hint panel__observed${stale ? ' panel__observed--stale' : ''}`}>\n <span aria-hidden=\"true\">◷</span> As of {formatted} · {ageText}\n </p>\n )\n}\n\nfunction formatAge(milliseconds: number) {\n if (milliseconds < 60_000) return 'just now'\n const minutes = Math.floor(milliseconds / 60_000)\n if (minutes < 60) return `${minutes}m ago`\n const hours = Math.floor(minutes / 60)\n return `${hours}h ${minutes % 60}m ago`\n}\n","import type { Panel } from '@ze-great-dashboard/shared'\nimport type { CSSProperties } from 'react'\n\n/** Convert the advisory board position into CSS grid placement. */\nexport function panelLayout(panel: Panel): CSSProperties | undefined {\n const position = panel.position\n if (!position) return undefined\n\n return {\n '--panel-column': `${position.x + 1} / span ${position.w}`,\n '--panel-row': `${position.y + 1} / span ${position.h}`,\n } as CSSProperties\n}\n","import type { Panel } from '@ze-great-dashboard/shared'\nimport { type Envelope, httpValueSchema } from '@ze-great-dashboard/shared'\nimport { ObservedAt } from './ObservedAt.tsx'\nimport { panelLayout } from './panel-layout.ts'\n\nexport function HttpValuePanel({ panel, data }: { panel: Panel; data: Envelope | undefined }) {\n if (!data)\n return (\n <section className=\"panel\" style={panelLayout(panel)} aria-busy=\"true\">\n <h2 className=\"panel__label\">{panel.id}</h2>\n <p className=\"panel__hint\">Loading…</p>\n </section>\n )\n if (data.state === 'error')\n return (\n <section className=\"panel panel--error\" style={panelLayout(panel)}>\n <h2 className=\"panel__label\">{panel.id}</h2>\n <p className=\"panel__status\">⚠ Unable to read</p>\n <p className=\"panel__hint\">{data.error.message}</p>\n <ObservedAt value={data.observedAt} />\n </section>\n )\n const signal = httpValueSchema.safeParse(data.signal)\n if (!signal.success)\n return (\n <section className=\"panel panel--error\" style={panelLayout(panel)}>\n <h2 className=\"panel__label\">{panel.id}</h2>\n <p className=\"panel__status\">⚠ Invalid value</p>\n <ObservedAt value={data.observedAt} />\n </section>\n )\n const content = (\n <>\n <p className=\"panel__status\">{String(signal.data.value)}</p>\n <ObservedAt value={data.observedAt} />\n </>\n )\n return (\n <section className=\"panel\" style={panelLayout(panel)}>\n <h2 className=\"panel__label\">{panel.id}</h2>\n {data.link ? (\n <a className=\"panel__link\" href={data.link}>\n {content}\n </a>\n ) : (\n content\n )}\n </section>\n )\n}\n","/**\n * A panel-shaped hole, so the grid can be looked at and argued with before any signal exists.\n * Replaced by real panels in Stage 2 — nothing here is meant to survive.\n */\nexport function PanelPlaceholder({\n label,\n hint,\n wide = false,\n}: {\n label: string\n hint: string\n wide?: boolean\n}) {\n return (\n <section className={wide ? 'panel panel--wide' : 'panel'}>\n <h2 className=\"panel__label\">{label}</h2>\n <p className=\"panel__hint\">{hint}</p>\n </section>\n )\n}\n","import {\n type Envelope,\n envelopeSchema,\n type Panel,\n pipelineStatusSchema,\n} from '@ze-great-dashboard/shared'\nimport { ObservedAt } from './ObservedAt.tsx'\nimport { panelLayout } from './panel-layout.ts'\n\nexport function PipelinePanel({ panel, data }: { panel: Panel; data: Envelope | undefined }) {\n if (!data)\n return (\n <section className=\"panel\" style={panelLayout(panel)} aria-busy=\"true\">\n <h2 className=\"panel__label\">{panel.id}</h2>\n <p className=\"panel__hint\">Loading…</p>\n </section>\n )\n if (data.state === 'error') {\n return (\n <section className=\"panel panel--error\" style={panelLayout(panel)}>\n <h2 className=\"panel__label\">{panel.id}</h2>\n <p className=\"panel__status\">\n ⚠ {data.error.kind === 'no-runs' ? 'No workflow runs' : 'Unable to read'}\n </p>\n <p className=\"panel__hint\">{data.error.message}</p>\n <ObservedAt value={data.observedAt} />\n </section>\n )\n }\n\n const signal = pipelineStatusSchema.safeParse(data.signal)\n if (!signal.success)\n return (\n <section className=\"panel panel--error\" style={panelLayout(panel)}>\n <h2 className=\"panel__label\">{panel.id}</h2>\n <p className=\"panel__status\">⚠ Invalid signal</p>\n <ObservedAt value={data.observedAt} />\n </section>\n )\n const presentation = statusPresentation(signal.data.status)\n const content = (\n <>\n <p className={`panel__status panel__status--${signal.data.status}`}>\n {presentation.glyph} {presentation.label}\n </p>\n <p className=\"panel__hint\">\n {signal.data.name} · {signal.data.rawStatus}\n {signal.data.branch && (\n <span className=\"panel__branch\" title={`Branch: ${signal.data.branch}`}>\n <span aria-hidden=\"true\"> · ⎇ </span>\n <span className=\"screen-reader-only\">Branch: </span>\n {signal.data.branch}\n </span>\n )}\n </p>\n {signal.data.status !== 'running' && signal.data.durationMs !== undefined && (\n <p className=\"panel__hint\">Took {formatDuration(signal.data.durationMs)}</p>\n )}\n <ObservedAt value={data.observedAt} />\n </>\n )\n return (\n <section className=\"panel\" style={panelLayout(panel)}>\n <h2 className=\"panel__label\">{panel.id}</h2>\n {data.link ? (\n <a className=\"panel__link\" href={data.link}>\n {content}\n </a>\n ) : (\n content\n )}\n </section>\n )\n}\n\nfunction formatDuration(durationMs: number) {\n const totalSeconds = Math.floor(durationMs / 1_000)\n const hours = Math.floor(totalSeconds / 3_600)\n const minutes = Math.floor((totalSeconds % 3_600) / 60)\n const seconds = totalSeconds % 60\n\n if (hours > 0) return `${hours}h ${minutes}m`\n if (minutes > 0) return `${minutes}m ${seconds}s`\n return `${seconds}s`\n}\n\nfunction statusPresentation(status: 'passed' | 'failed' | 'running' | 'cancelled' | 'unknown') {\n switch (status) {\n case 'passed':\n return { glyph: '✓', label: 'Passed' }\n case 'failed':\n return { glyph: '✕', label: 'Failed' }\n case 'running':\n return { glyph: '↻', label: 'Running' }\n case 'cancelled':\n return { glyph: '⊘', label: 'Cancelled' }\n case 'unknown':\n return { glyph: '?', label: 'Unknown' }\n }\n}\n\nexport function parseEnvelope(value: unknown): Envelope | undefined {\n const result = envelopeSchema.safeParse(value)\n return result.success ? result.data : undefined\n}\n","import {\n type Board,\n type ClientEnv,\n type Envelope,\n parseDuration,\n resolveRefreshMillis,\n} from '@ze-great-dashboard/shared'\nimport { useEffect, useState } from 'react'\nimport { HttpValuePanel } from './HttpValuePanel.tsx'\nimport { PanelPlaceholder } from './PanelPlaceholder.tsx'\nimport { PipelinePanel, parseEnvelope } from './PipelinePanel.tsx'\n\n/**\n * The board shell.\n *\n * Stage 1 has no data: there is no proxy endpoint to poll yet. What this proves is the plumbing —\n * that the client was handed its configuration by the server and knows which version of itself it\n * is. The version readout is what makes two published versions visibly different, which is the\n * whole point of the Stage 1 exit criterion.\n */\nexport function App({ env }: { env: ClientEnv }) {\n const [board, setBoard] = useState<Board>()\n const [loadedBoardName, setLoadedBoardName] = useState<string>()\n const [signals, setSignals] = useState<Record<string, Envelope | undefined>>({})\n\n useEffect(() => {\n let cancelled = false\n setBoard(undefined)\n setLoadedBoardName(undefined)\n setSignals({})\n fetch(`${env.proxyPath}/boards/${encodeURIComponent(env.board)}`)\n .then((response) =>\n response.ok\n ? response.json()\n : Promise.reject(new Error(`Board configuration returned ${response.status}`)),\n )\n .then((value: unknown) => {\n if (!cancelled) {\n setBoard(value as Board)\n setLoadedBoardName(env.board)\n }\n })\n .catch(() => {\n if (!cancelled) {\n setBoard({ panels: [] })\n setLoadedBoardName(env.board)\n }\n })\n return () => {\n cancelled = true\n }\n }, [env.board, env.proxyPath])\n\n useEffect(() => {\n if (!board || loadedBoardName !== env.board) return\n let cancelled = false\n const timers: number[] = []\n\n for (const panel of board.panels) {\n if (panel.type !== 'pipeline-status' && panel.type !== 'http-value') continue\n\n let inFlight = false\n const refreshMillis = resolveRefreshMillis({\n boardDefaultMillis: parseDuration(board.refresh ?? '60s') ?? 60_000,\n panelOverrideMillis: panel.refresh\n ? (parseDuration(panel.refresh) ?? undefined)\n : undefined,\n adapterFloorMillis: 0,\n })\n\n const refresh = () => {\n if (cancelled || inFlight) return\n inFlight = true\n fetch(\n `${env.proxyPath}/panel/${encodeURIComponent(env.board)}/${encodeURIComponent(panel.id)}`,\n )\n .then((response) => (response.status === 304 ? undefined : response.json()))\n .then((value: unknown) => {\n const envelope = parseEnvelope(value)\n if (!cancelled && envelope)\n setSignals((current) => ({ ...current, [panel.id]: envelope }))\n })\n .catch(() => undefined)\n .finally(() => {\n inFlight = false\n })\n }\n\n refresh()\n timers.push(window.setInterval(refresh, refreshMillis))\n }\n return () => {\n cancelled = true\n for (const timer of timers) window.clearInterval(timer)\n }\n }, [board, env.board, env.proxyPath, loadedBoardName])\n\n return (\n <div className=\"board\">\n <header className=\"board__header\">\n <h1 className=\"board__title\">{env.board}</h1>\n <dl className=\"board__meta\">\n <div>\n <dt>client</dt>\n <dd>{env.clientVersion}</dd>\n </div>\n <div>\n <dt>assets</dt>\n <dd>{env.assetPath}</dd>\n </div>\n </dl>\n </header>\n\n <main className=\"board__grid\">\n {!board && <PanelPlaceholder label=\"board\" hint=\"Loading configuration…\" wide />}\n {board?.panels.map((panel) =>\n panel.type === 'pipeline-status' ? (\n <PipelinePanel key={panel.id} panel={panel} data={signals[panel.id]} />\n ) : panel.type === 'http-value' ? (\n <HttpValuePanel key={panel.id} panel={panel} data={signals[panel.id]} />\n ) : (\n <PanelPlaceholder key={panel.id} label={panel.type} hint=\"Not wired yet\" wide />\n ),\n )}\n </main>\n\n <footer className=\"board__footer\">\n Signals are read live from their configured authorities.\n </footer>\n </div>\n )\n}\n","export function ConfigError({ message }: { message: string }) {\n return (\n <div className=\"config-error\" role=\"alert\">\n <h1>⚠️ Dashboard misconfigured</h1>\n <p>The page loaded, but the server did not hand it usable configuration.</p>\n <pre>{message}</pre>\n </div>\n )\n}\n","import { readClientEnv } from '@ze-great-dashboard/shared'\nimport { StrictMode } from 'react'\nimport { createRoot } from 'react-dom/client'\nimport { App } from './App.tsx'\nimport { ConfigError } from './ConfigError.tsx'\nimport './styles.css'\n\nconst container = document.getElementById('root')\nif (!container) {\n throw new Error('No #root element in the document — the template is not the one we expect.')\n}\n\nconst root = createRoot(container)\n\ntry {\n root.render(\n <StrictMode>\n <App env={readClientEnv()} />\n </StrictMode>,\n )\n} catch (error) {\n // A radiator that fails silently is worse than one that says what's wrong. If configuration\n // never arrived, say so on screen rather than rendering an empty board.\n root.render(<ConfigError message={error instanceof Error ? error.message : String(error)} />)\n}\n"],"mappings":"o2BAKA,IAAI,EAAmB,oBACnB,EAAc,CAChB,GAAI,EACJ,EAAG,IACH,EAAG,IACH,EAAG,IACL,EACA,SAAS,EAAc,EAAO,CAC5B,IAAM,EAAQ,EAAiB,KAAK,CAAK,EACzC,GAAI,CAAC,EAAO,OAAO,KACnB,GAAM,EAAG,EAAW,GAAW,EAC/B,GAAI,IAAc,IAAK,IAAK,IAAY,IAAK,GAAG,OAAO,KACvD,IAAM,EAAS,OAAO,CAAS,EAE/B,OADI,GAAU,EAAU,KACjB,EAAS,EAAY,EAC9B,CACA,IAAI,EAAiB,EAAE,OAAO,CAAC,CAAC,OAAQ,GAAU,EAAc,CAAK,IAAM,KAAM,CAC/E,QAAS,uDACX,CAAC,CAAC,CAAC,MAAM,EAGL,EAAiB,EAAG,OAAO,CAC7B,EAAG,EAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAC1B,EAAG,EAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAC1B,EAAG,EAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,EAClC,EAAG,EAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAC5B,CAAC,EACG,EAAc,EAAG,YAAY,CAC/B,GAAI,EAAG,OAAO,CAAC,CAAC,IAAI,CAAC,EACrB,KAAM,EAAG,OAAO,CAAC,CAAC,IAAI,CAAC,EACvB,OAAQ,EAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAEpC,SAAU,EAAe,SAAS,EAClC,QAAS,EAAe,SAAS,EAEjC,KAAM,EAAG,IAAI,CAAC,CAAC,SAAS,EAExB,I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EAA2E,EAG7F,IAAM,EAAO,EAAW,CAAS,EAEjC,GAAI,CACF,EAAK,OACH,EAAC,EAAD,CAAA,SACE,EAAC,EAAD,CAAK,IAAK,EAAc,CAAI,CAAA,CAClB,CAAA,CACd,CACF,OAAS,EAAO,CAGd,EAAK,OAAO,EAAC,EAAD,CAAa,QAAS,aAAiB,MAAQ,EAAM,QAAU,OAAO,CAAK,CAAI,CAAA,CAAC,CAC9F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--surface:#12140f;--surface-raised:#1a1a19;--ink-primary:#fff;--ink-secondary:#c3c2b7;--ink-muted:#898781;--edge:#2f312b;--status-good:#0ca30c;--status-warning:#fab219;--status-serious:#ec835a;--status-critical:#d03b3b;--gap:1rem;--radius:.5rem;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}*{box-sizing:border-box}.screen-reader-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}html,body{height:100%;margin:0}body{background:var(--surface);color:var(--ink-primary);font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Helvetica,Arial,sans-serif;font-size:clamp(16px,1.1vw + .5rem,28px);line-height:1.4}.board{gap:var(--gap);min-height:100%;padding:var(--gap);flex-direction:column;display:flex}.board__header{justify-content:space-between;align-items:baseline;gap:var(--gap);border-bottom:1px solid var(--edge);padding-bottom:var(--gap);flex-wrap:wrap;display:flex}.board__title{letter-spacing:-.01em;margin:0;font-size:1.75em;font-weight:650}.board__meta{gap:calc(var(--gap) * 1.5);flex-wrap:wrap;margin:0;font-size:.7em;display:flex}.board__meta div{flex-direction:column;display:flex}.board__meta dt{color:var(--ink-muted);text-transform:uppercase;letter-spacing:.08em;font-size:.8em}.board__meta dd{color:var(--ink-secondary);overflow-wrap:anywhere;margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.board__grid{gap:var(--gap);flex:1;grid-template-columns:repeat(12,1fr);align-content:start;display:grid}.panel{grid-column:var(--panel-column,span 6);grid-row:var(--panel-row,auto);min-height:6em;padding:var(--gap);border:1px solid var(--edge);border-radius:var(--radius);background:var(--surface-raised);flex-direction:column;justify-content:center;gap:.25em;display:flex;overflow:hidden}.panel--wide{grid-column:span 12}.panel__label{color:var(--ink-secondary);margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:1em;font-weight:600}.panel__hint{color:var(--ink-muted);margin:0;font-size:.75em}.panel__branch{white-space:nowrap;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.panel__observed{align-items:center;gap:.35em;display:flex}.panel__observed--stale{color:var(--status-warning)}.panel__status{margin:0;font-size:1.35em;font-weight:650}.panel__status--passed{color:var(--status-good)}.panel__status--failed{color:var(--status-critical)}.panel__status--running{color:var(--status-warning)}.panel__status--cancelled,.panel__status--unknown{color:var(--ink-secondary)}.panel--error{border-color:var(--status-serious)}.panel__link{color:inherit;text-decoration:none}.panel__link:hover .panel__status{text-decoration:underline}.board__footer{color:var(--ink-muted);font-size:.75em}.config-error{max-width:60ch;color:var(--ink-primary);margin:0 auto;padding:2rem}.config-error pre{border-radius:var(--radius);border:1px solid var(--status-critical);background:var(--surface-raised);color:var(--ink-secondary);white-space:pre-wrap;overflow-wrap:anywhere;padding:1rem;font-size:.75em}@media (width<=60rem){.board__grid{grid-template-columns:1fr}.panel{grid-area:auto/1/auto/-1}}
|
package/client/index.html
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
<title>Trust Dashboard</title>
|
|
12
12
|
|
|
13
13
|
<script type="importmap">{"imports":{"react":"https://esm.sh/react@19.2.8","react/":"https://esm.sh/react@19.2.8/","react-dom":"https://esm.sh/react-dom@19.2.8","react-dom/":"https://esm.sh/react-dom@19.2.8/","scheduler":"https://esm.sh/scheduler@0.27.0","scheduler/":"https://esm.sh/scheduler@0.27.0/","zod":"https://esm.sh/zod@4.4.3","zod/":"https://esm.sh/zod@4.4.3/"}}</script>
|
|
14
|
-
<script type="module" crossorigin src="/__ASSET_PATH__/assets/index-
|
|
15
|
-
<link rel="stylesheet" crossorigin href="/__ASSET_PATH__/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/__ASSET_PATH__/assets/index-DOvxvZo2.js"></script>
|
|
15
|
+
<link rel="stylesheet" crossorigin href="/__ASSET_PATH__/assets/index-r7iEInfY.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<div id="root"></div>
|
package/dist/cli.js
CHANGED
|
@@ -921,12 +921,9 @@ async function packageLambda(options) {
|
|
|
921
921
|
);
|
|
922
922
|
return packagedRelease;
|
|
923
923
|
}
|
|
924
|
-
async function
|
|
925
|
-
const artifactDir = resolve2(options.artifactDir);
|
|
924
|
+
async function publishClientAssets(options) {
|
|
926
925
|
const assetsDir = resolve2(options.assetsDir);
|
|
927
|
-
await readFile2(join2(artifactDir, "lambda.zip"));
|
|
928
926
|
await readFile2(join2(assetsDir, "index.html"));
|
|
929
|
-
if (options.dryRun) return;
|
|
930
927
|
const assetPath = `${options.assetsBaseUrl.replace(/\/+$/, "")}/dashboard/${options.version}`;
|
|
931
928
|
await run("aws", [
|
|
932
929
|
"s3",
|
|
@@ -946,6 +943,15 @@ async function deployLambda(options) {
|
|
|
946
943
|
"--cache-control",
|
|
947
944
|
"public, max-age=60"
|
|
948
945
|
]);
|
|
946
|
+
return assetPath;
|
|
947
|
+
}
|
|
948
|
+
async function deployLambda(options) {
|
|
949
|
+
const artifactDir = resolve2(options.artifactDir);
|
|
950
|
+
const assetsDir = resolve2(options.assetsDir);
|
|
951
|
+
await readFile2(join2(artifactDir, "lambda.zip"));
|
|
952
|
+
await readFile2(join2(assetsDir, "index.html"));
|
|
953
|
+
if (options.dryRun) return;
|
|
954
|
+
const assetPath = await publishClientAssets(options);
|
|
949
955
|
await run("aws", [
|
|
950
956
|
"lambda",
|
|
951
957
|
"update-function-code",
|
|
@@ -1180,6 +1186,15 @@ try {
|
|
|
1180
1186
|
dryRun: args.includes("--dry-run")
|
|
1181
1187
|
});
|
|
1182
1188
|
console.log(JSON.stringify({ deployed: true, version }));
|
|
1189
|
+
} else if (args[0] === "publish-assets") {
|
|
1190
|
+
const version = requiredOption("--version", packageVersion);
|
|
1191
|
+
const assetPath = await publishClientAssets({
|
|
1192
|
+
assetsDir: option("--assets-dir", bundledAssets) ?? bundledAssets,
|
|
1193
|
+
assetsBucket: requiredOption("--assets-bucket"),
|
|
1194
|
+
assetsBaseUrl: requiredOption("--assets-base-url"),
|
|
1195
|
+
version
|
|
1196
|
+
});
|
|
1197
|
+
console.log(JSON.stringify({ published: true, version, assetPath }));
|
|
1183
1198
|
} else if (args[0] === "doctor") {
|
|
1184
1199
|
const parametersPath = option("--parameters", "aws-dashboard-parameters.json") ?? "aws-dashboard-parameters.json";
|
|
1185
1200
|
const region = option("--region", process.env.AWS_REGION ?? process.env.AWS_DEFAULT_REGION ?? "us-east-1") ?? "us-east-1";
|
|
@@ -1237,7 +1252,9 @@ try {
|
|
|
1237
1252
|
`);
|
|
1238
1253
|
console.log(JSON.stringify({ output }));
|
|
1239
1254
|
} else if (args[0] !== "package")
|
|
1240
|
-
throw new Error(
|
|
1255
|
+
throw new Error(
|
|
1256
|
+
"Usage: ze-great-dashboard-aws package|parameters|publish-assets|deploy|doctor [options]"
|
|
1257
|
+
);
|
|
1241
1258
|
else {
|
|
1242
1259
|
const boardConfig = option("--board-config");
|
|
1243
1260
|
const version = option("--version", process.env.DASHBOARD_VERSION ?? packageVersion);
|
package/dist/index.d.ts
CHANGED
|
@@ -27,6 +27,14 @@ export type DeployLambdaOptions = {
|
|
|
27
27
|
version: string;
|
|
28
28
|
dryRun?: boolean;
|
|
29
29
|
};
|
|
30
|
+
export type PublishClientAssetsOptions = {
|
|
31
|
+
assetsDir: string;
|
|
32
|
+
assetsBucket: string;
|
|
33
|
+
assetsBaseUrl: string;
|
|
34
|
+
version: string;
|
|
35
|
+
};
|
|
36
|
+
/** Publishes the immutable client half of a provider-managed release. */
|
|
37
|
+
export declare function publishClientAssets(options: PublishClientAssetsOptions): Promise<string>;
|
|
30
38
|
/** Performs the AWS-specific half of a release using explicit deployment outputs. */
|
|
31
39
|
export declare function deployLambda(options: DeployLambdaOptions): Promise<void>;
|
|
32
40
|
export declare function cloudFormationTemplate(): Promise<string>;
|
package/dist/index.js
CHANGED
|
@@ -908,12 +908,9 @@ async function packageLambda(options) {
|
|
|
908
908
|
);
|
|
909
909
|
return packagedRelease;
|
|
910
910
|
}
|
|
911
|
-
async function
|
|
912
|
-
const artifactDir = resolve2(options.artifactDir);
|
|
911
|
+
async function publishClientAssets(options) {
|
|
913
912
|
const assetsDir = resolve2(options.assetsDir);
|
|
914
|
-
await readFile2(join2(artifactDir, "lambda.zip"));
|
|
915
913
|
await readFile2(join2(assetsDir, "index.html"));
|
|
916
|
-
if (options.dryRun) return;
|
|
917
914
|
const assetPath = `${options.assetsBaseUrl.replace(/\/+$/, "")}/dashboard/${options.version}`;
|
|
918
915
|
await run("aws", [
|
|
919
916
|
"s3",
|
|
@@ -933,6 +930,15 @@ async function deployLambda(options) {
|
|
|
933
930
|
"--cache-control",
|
|
934
931
|
"public, max-age=60"
|
|
935
932
|
]);
|
|
933
|
+
return assetPath;
|
|
934
|
+
}
|
|
935
|
+
async function deployLambda(options) {
|
|
936
|
+
const artifactDir = resolve2(options.artifactDir);
|
|
937
|
+
const assetsDir = resolve2(options.assetsDir);
|
|
938
|
+
await readFile2(join2(artifactDir, "lambda.zip"));
|
|
939
|
+
await readFile2(join2(assetsDir, "index.html"));
|
|
940
|
+
if (options.dryRun) return;
|
|
941
|
+
const assetPath = await publishClientAssets(options);
|
|
936
942
|
await run("aws", [
|
|
937
943
|
"lambda",
|
|
938
944
|
"update-function-code",
|
|
@@ -960,5 +966,6 @@ async function cloudFormationTemplate() {
|
|
|
960
966
|
export {
|
|
961
967
|
cloudFormationTemplate,
|
|
962
968
|
deployLambda,
|
|
963
|
-
packageLambda
|
|
969
|
+
packageLambda,
|
|
970
|
+
publishClientAssets
|
|
964
971
|
};
|
package/dist/lambda.mjs
CHANGED
|
@@ -24312,6 +24312,8 @@ config(en_default());
|
|
|
24312
24312
|
var githubSourceSchema = external_exports.object({
|
|
24313
24313
|
type: external_exports.literal("github-actions"),
|
|
24314
24314
|
repo: external_exports.string().regex(/^[^/\s]+\/[^/\s]+$/, "must be an owner/repository pair"),
|
|
24315
|
+
/** The branch whose workflow health the dashboard represents. */
|
|
24316
|
+
branch: external_exports.string().min(1).optional(),
|
|
24315
24317
|
token_env: external_exports.string().min(1).optional()
|
|
24316
24318
|
});
|
|
24317
24319
|
var pipelinePanelSchema = external_exports.object({
|
|
@@ -24325,15 +24327,18 @@ var runSchema = external_exports.object({
|
|
|
24325
24327
|
status: external_exports.string(),
|
|
24326
24328
|
conclusion: external_exports.string().nullable(),
|
|
24327
24329
|
name: external_exports.string().min(1),
|
|
24328
|
-
html_url: external_exports.url()
|
|
24330
|
+
html_url: external_exports.url(),
|
|
24331
|
+
run_started_at: external_exports.iso.datetime().nullable().optional(),
|
|
24332
|
+
updated_at: external_exports.iso.datetime().optional()
|
|
24329
24333
|
});
|
|
24330
|
-
var runsSchema = external_exports.object({ workflow_runs: external_exports.array(runSchema)
|
|
24334
|
+
var runsSchema = external_exports.object({ workflow_runs: external_exports.array(runSchema) });
|
|
24331
24335
|
function permittedGithubActionsCalls(panel, source) {
|
|
24332
24336
|
const parsedPanel = pipelinePanelSchema.parse(panel);
|
|
24333
24337
|
const parsedSource = githubSourceSchema.parse(source);
|
|
24334
24338
|
const url2 = new URL(
|
|
24335
24339
|
`https://api.github.com/repos/${parsedSource.repo}/actions/workflows/${encodeURIComponent(parsedPanel.pipeline)}/runs`
|
|
24336
24340
|
);
|
|
24341
|
+
if (parsedSource.branch) url2.searchParams.set("branch", parsedSource.branch);
|
|
24337
24342
|
url2.searchParams.set("per_page", "1");
|
|
24338
24343
|
const headers = new Headers({ accept: "application/vnd.github+json" });
|
|
24339
24344
|
const token = parsedSource.token_env ? process.env[parsedSource.token_env] : void 0;
|
|
@@ -24341,6 +24346,7 @@ function permittedGithubActionsCalls(panel, source) {
|
|
|
24341
24346
|
return [{ url: url2.toString(), headers }];
|
|
24342
24347
|
}
|
|
24343
24348
|
async function fetchGithubActionsPipeline(args) {
|
|
24349
|
+
const parsedSource = githubSourceSchema.parse(args.source);
|
|
24344
24350
|
const call = permittedGithubActionsCalls(args.panel, args.source)[0];
|
|
24345
24351
|
if (!call) throw new Error("GitHub Actions adapter declared no permitted call");
|
|
24346
24352
|
for (const name of ["if-none-match", "if-modified-since"]) {
|
|
@@ -24379,12 +24385,29 @@ async function fetchGithubActionsPipeline(args) {
|
|
|
24379
24385
|
}
|
|
24380
24386
|
try {
|
|
24381
24387
|
const run = runsSchema.parse(await upstream.json()).workflow_runs[0];
|
|
24382
|
-
if (!run)
|
|
24388
|
+
if (!run) {
|
|
24389
|
+
return {
|
|
24390
|
+
response: new Response(
|
|
24391
|
+
JSON.stringify(
|
|
24392
|
+
errorEnvelope(
|
|
24393
|
+
args.panel.id,
|
|
24394
|
+
"no-runs",
|
|
24395
|
+
parsedSource.branch ? `No workflow runs found for branch "${parsedSource.branch}". Check the source's branch setting.` : "No workflow runs found.",
|
|
24396
|
+
sourceLink(args.panel, args.source),
|
|
24397
|
+
observedAt(upstream.headers.get("date"))
|
|
24398
|
+
)
|
|
24399
|
+
),
|
|
24400
|
+
{ status: 200 }
|
|
24401
|
+
)
|
|
24402
|
+
};
|
|
24403
|
+
}
|
|
24383
24404
|
const signal = {
|
|
24384
24405
|
type: "pipeline-status",
|
|
24385
24406
|
status: normalizeStatus(run.status, run.conclusion),
|
|
24386
24407
|
rawStatus: run.conclusion ?? run.status,
|
|
24387
|
-
name: run.name
|
|
24408
|
+
name: run.name,
|
|
24409
|
+
branch: parsedSource.branch,
|
|
24410
|
+
...run.status === "completed" ? completedRunDuration(run) : {}
|
|
24388
24411
|
};
|
|
24389
24412
|
const envelope = {
|
|
24390
24413
|
panelId: args.panel.id,
|
|
@@ -24411,6 +24434,11 @@ async function fetchGithubActionsPipeline(args) {
|
|
|
24411
24434
|
};
|
|
24412
24435
|
}
|
|
24413
24436
|
}
|
|
24437
|
+
function completedRunDuration(run) {
|
|
24438
|
+
if (!run.run_started_at || !run.updated_at) return {};
|
|
24439
|
+
const durationMs = new Date(run.updated_at).valueOf() - new Date(run.run_started_at).valueOf();
|
|
24440
|
+
return Number.isFinite(durationMs) && durationMs >= 0 ? { durationMs } : {};
|
|
24441
|
+
}
|
|
24414
24442
|
function normalizeStatus(status, conclusion) {
|
|
24415
24443
|
if (status !== "completed") return "running";
|
|
24416
24444
|
if (conclusion === "success") return "passed";
|
|
@@ -24826,6 +24854,7 @@ var errorKindSchema = external_exports.enum([
|
|
|
24826
24854
|
"unreachable",
|
|
24827
24855
|
"unauthorized",
|
|
24828
24856
|
"not-found",
|
|
24857
|
+
"no-runs",
|
|
24829
24858
|
"upstream-error"
|
|
24830
24859
|
]);
|
|
24831
24860
|
var envelopeErrorSchema = external_exports.object({
|
|
@@ -24860,7 +24889,11 @@ var pipelineStatusSchema = external_exports.object({
|
|
|
24860
24889
|
status: external_exports.enum(["passed", "failed", "running", "cancelled", "unknown"]),
|
|
24861
24890
|
/** The source's unmodified status/result vocabulary, for an honest display. */
|
|
24862
24891
|
rawStatus: external_exports.string(),
|
|
24863
|
-
name: external_exports.string().min(1)
|
|
24892
|
+
name: external_exports.string().min(1),
|
|
24893
|
+
/** The branch represented by this status, when the upstream supplies or filters by one. */
|
|
24894
|
+
branch: external_exports.string().min(1).optional(),
|
|
24895
|
+
/** Elapsed execution time, supplied only after the upstream run has completed. */
|
|
24896
|
+
durationMs: external_exports.number().int().nonnegative().optional()
|
|
24864
24897
|
});
|
|
24865
24898
|
var httpValueSchema = external_exports.object({
|
|
24866
24899
|
type: external_exports.literal("http-value"),
|
package/package.json
CHANGED
package/template.yml
CHANGED
|
@@ -25,6 +25,9 @@ Resources:
|
|
|
25
25
|
ServerRole:
|
|
26
26
|
Type: AWS::IAM::Role
|
|
27
27
|
Properties:
|
|
28
|
+
# A stable, Name-derived role name lets consumer bootstrap policies scope CloudFormation
|
|
29
|
+
# execution to this stack's runtime role rather than every role in the account.
|
|
30
|
+
RoleName: !Sub '${Name}-server'
|
|
28
31
|
AssumeRolePolicyDocument:
|
|
29
32
|
Version: '2012-10-17'
|
|
30
33
|
Statement: [{ Effect: Allow, Principal: { Service: lambda.amazonaws.com }, Action: sts:AssumeRole }]
|
|
@@ -36,7 +39,12 @@ Resources:
|
|
|
36
39
|
Statement:
|
|
37
40
|
- Effect: Allow
|
|
38
41
|
Action: [secretsmanager:DescribeSecret, secretsmanager:GetSecretValue]
|
|
39
|
-
|
|
42
|
+
# IAM requires every statement to have a resource. When no secret is configured,
|
|
43
|
+
# keep this read permission pointed at a nonexistent ARN rather than widening it.
|
|
44
|
+
Resource: !If
|
|
45
|
+
- HasSecretReference
|
|
46
|
+
- !Ref SecretReference
|
|
47
|
+
- !Sub 'arn:${AWS::Partition}:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:ze-great-dashboard-no-secret-configured'
|
|
40
48
|
ServerLogGroup:
|
|
41
49
|
Type: AWS::Logs::LogGroup
|
|
42
50
|
Properties: { RetentionInDays: !Ref LogRetentionInDays, LogGroupName: !Sub '/aws/lambda/${Name}' }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:root{--surface:#12140f;--surface-raised:#1a1a19;--ink-primary:#fff;--ink-secondary:#c3c2b7;--ink-muted:#898781;--edge:#2f312b;--status-good:#0ca30c;--status-warning:#fab219;--status-serious:#ec835a;--status-critical:#d03b3b;--gap:1rem;--radius:.5rem;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}*{box-sizing:border-box}html,body{height:100%;margin:0}body{background:var(--surface);color:var(--ink-primary);font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Helvetica,Arial,sans-serif;font-size:clamp(16px,1.1vw + .5rem,28px);line-height:1.4}.board{gap:var(--gap);min-height:100%;padding:var(--gap);flex-direction:column;display:flex}.board__header{justify-content:space-between;align-items:baseline;gap:var(--gap);border-bottom:1px solid var(--edge);padding-bottom:var(--gap);flex-wrap:wrap;display:flex}.board__title{letter-spacing:-.01em;margin:0;font-size:1.75em;font-weight:650}.board__meta{gap:calc(var(--gap) * 1.5);flex-wrap:wrap;margin:0;font-size:.7em;display:flex}.board__meta div{flex-direction:column;display:flex}.board__meta dt{color:var(--ink-muted);text-transform:uppercase;letter-spacing:.08em;font-size:.8em}.board__meta dd{color:var(--ink-secondary);overflow-wrap:anywhere;margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.board__grid{gap:var(--gap);flex:1;grid-template-columns:repeat(12,1fr);align-content:start;display:grid}.panel{grid-column:var(--panel-column,span 6);grid-row:var(--panel-row,auto);min-height:6em;padding:var(--gap);border:1px solid var(--edge);border-radius:var(--radius);background:var(--surface-raised);flex-direction:column;justify-content:center;gap:.25em;display:flex;overflow:hidden}.panel--wide{grid-column:span 12}.panel__label{color:var(--ink-secondary);margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:1em;font-weight:600}.panel__hint{color:var(--ink-muted);margin:0;font-size:.75em}.panel__observed{align-items:center;gap:.35em;display:flex}.panel__observed--stale{color:var(--status-warning)}.panel__status{margin:0;font-size:1.35em;font-weight:650}.panel__status--passed{color:var(--status-good)}.panel__status--failed{color:var(--status-critical)}.panel__status--running{color:var(--status-warning)}.panel__status--cancelled,.panel__status--unknown{color:var(--ink-secondary)}.panel--error{border-color:var(--status-serious)}.panel__link{color:inherit;text-decoration:none}.panel__link:hover .panel__status{text-decoration:underline}.board__footer{color:var(--ink-muted);font-size:.75em}.config-error{max-width:60ch;color:var(--ink-primary);margin:0 auto;padding:2rem}.config-error pre{border-radius:var(--radius);border:1px solid var(--status-critical);background:var(--surface-raised);color:var(--ink-secondary);white-space:pre-wrap;overflow-wrap:anywhere;padding:1rem;font-size:.75em}@media (width<=60rem){.board__grid{grid-template-columns:1fr}.panel{grid-area:auto/1/auto/-1}}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{z as e}from"zod";import{StrictMode as t,useEffect as n,useState as r}from"react";import{createRoot as i}from"react-dom/client";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var c=/^(\d+)(ms|s|m|h)$/,l={ms:1,s:1e3,m:6e4,h:36e5};function u(e){let t=c.exec(e);if(!t)return null;let[,n,r]=t;if(n===void 0||r===void 0)return null;let i=Number(n);return i<=0?null:i*l[r]}var d=e.string().refine(e=>u(e)!==null,{message:`must be a positive duration like "30s", "5m", or "1h"`}).brand(),f=e.object({x:e.number().int().min(0),y:e.number().int().min(0),w:e.number().int().min(1).max(12),h:e.number().int().min(1)}),p=e.looseObject({id:e.string().min(1),type:e.string().min(1),source:e.string().min(1).optional(),position:f.optional(),refresh:d.optional(),link:e.url().optional(),url:e.url().optional(),json_path:e.string().regex(/^\$(?:\.[A-Za-z_][A-Za-z0-9_]*|\[\d+\])*$/,`must be a simple JSON path`).optional()}),m=e.looseObject({type:e.string().min(1),token_env:e.string().min(1).optional()}),h=e.object({refresh:d.optional(),panels:e.array(p).min(1).superRefine((e,t)=>{let n=new Map;e.forEach((e,r)=>{let i=n.get(e.id);if(i===void 0){n.set(e.id,r);return}t.addIssue({code:`custom`,path:[r,`id`],message:`duplicate panel id "${e.id}" (already used by panel at index ${i})`})})})}),g=e.object({issuer:e.url(),client_id:e.string().min(1).optional(),allow:e.object({groups:e.array(e.string().min(1)).optional(),subjects:e.array(e.string().min(1)).optional()}).optional()});e.object({sources:e.record(e.string().min(1),m).default({}),boards:e.record(e.string().min(1),h),auth:g.optional()});function _(e){let t=e.panelOverrideMillis??e.boardDefaultMillis;return Math.max(t,e.adapterFloorMillis)}var v=e.object({assetPath:e.string().min(1),proxyPath:e.string().min(1),board:e.string().min(1),clientVersion:e.string().min(1),auth:e.object({issuer:e.string().min(1),clientId:e.string().min(1).optional()}).optional()});function y(t=globalThis.window?.env){let n=v.safeParse(t);if(!n.success)throw Error(`window.env is missing or invalid \u2014 the server did not inject usable configuration.
|
|
2
|
-
${e.prettifyError(n.error)}`);return n.data}var b=e.enum([`unreachable`,`unauthorized`,`not-found`,`upstream-error`]),x=e.object({kind:b,message:e.string()}),S=e.discriminatedUnion(`state`,[e.object({panelId:e.string().min(1),state:e.literal(`ok`),observedAt:e.iso.datetime(),link:e.url().nullable(),signal:e.unknown()}),e.object({panelId:e.string().min(1),state:e.literal(`error`),observedAt:e.iso.datetime(),link:e.url().nullable(),error:x})]),C=e.object({type:e.literal(`pipeline-status`),status:e.enum([`passed`,`failed`,`running`,`cancelled`,`unknown`]),rawStatus:e.string(),name:e.string().min(1)}),w=e.object({type:e.literal(`http-value`),value:e.union([e.string(),e.number(),e.boolean()])});function T({value:e}){let t=new Date(e),n=t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),r=Date.now()-t.getTime(),i=r>3e5,a=E(r);return s(`p`,{className:`panel__hint panel__observed${i?` panel__observed--stale`:``}`,children:[o(`span`,{"aria-hidden":`true`,children:`◷`}),` As of `,n,` · `,a]})}function E(e){if(e<6e4)return`just now`;let t=Math.floor(e/6e4);return t<60?`${t}m ago`:`${Math.floor(t/60)}h ${t%60}m ago`}function D(e){let t=e.position;if(t)return{"--panel-column":`${t.x+1} / span ${t.w}`,"--panel-row":`${t.y+1} / span ${t.h}`}}function O({panel:e,data:t}){if(!t)return s(`section`,{className:`panel`,style:D(e),"aria-busy":`true`,children:[o(`h2`,{className:`panel__label`,children:e.id}),o(`p`,{className:`panel__hint`,children:`Loading…`})]});if(t.state===`error`)return s(`section`,{className:`panel panel--error`,style:D(e),children:[o(`h2`,{className:`panel__label`,children:e.id}),o(`p`,{className:`panel__status`,children:`⚠ Unable to read`}),o(`p`,{className:`panel__hint`,children:t.error.message}),o(T,{value:t.observedAt})]});let n=w.safeParse(t.signal);if(!n.success)return s(`section`,{className:`panel panel--error`,style:D(e),children:[o(`h2`,{className:`panel__label`,children:e.id}),o(`p`,{className:`panel__status`,children:`⚠ Invalid value`}),o(T,{value:t.observedAt})]});let r=s(a,{children:[o(`p`,{className:`panel__status`,children:String(n.data.value)}),o(T,{value:t.observedAt})]});return s(`section`,{className:`panel`,style:D(e),children:[o(`h2`,{className:`panel__label`,children:e.id}),t.link?o(`a`,{className:`panel__link`,href:t.link,children:r}):r]})}function k({label:e,hint:t,wide:n=!1}){return s(`section`,{className:n?`panel panel--wide`:`panel`,children:[o(`h2`,{className:`panel__label`,children:e}),o(`p`,{className:`panel__hint`,children:t})]})}function A({panel:e,data:t}){if(!t)return s(`section`,{className:`panel`,style:D(e),"aria-busy":`true`,children:[o(`h2`,{className:`panel__label`,children:e.id}),o(`p`,{className:`panel__hint`,children:`Loading…`})]});if(t.state===`error`)return s(`section`,{className:`panel panel--error`,style:D(e),children:[o(`h2`,{className:`panel__label`,children:e.id}),o(`p`,{className:`panel__status`,children:`⚠ Unable to read`}),o(`p`,{className:`panel__hint`,children:t.error.message}),o(T,{value:t.observedAt})]});let n=C.safeParse(t.signal);if(!n.success)return s(`section`,{className:`panel panel--error`,style:D(e),children:[o(`h2`,{className:`panel__label`,children:e.id}),o(`p`,{className:`panel__status`,children:`⚠ Invalid signal`}),o(T,{value:t.observedAt})]});let r=j(n.data.status),i=s(a,{children:[s(`p`,{className:`panel__status panel__status--${n.data.status}`,children:[r.glyph,` `,r.label]}),s(`p`,{className:`panel__hint`,children:[n.data.name,` · `,n.data.rawStatus]}),o(T,{value:t.observedAt})]});return s(`section`,{className:`panel`,style:D(e),children:[o(`h2`,{className:`panel__label`,children:e.id}),t.link?o(`a`,{className:`panel__link`,href:t.link,children:i}):i]})}function j(e){switch(e){case`passed`:return{glyph:`✓`,label:`Passed`};case`failed`:return{glyph:`✕`,label:`Failed`};case`running`:return{glyph:`↻`,label:`Running`};case`cancelled`:return{glyph:`⊘`,label:`Cancelled`};case`unknown`:return{glyph:`?`,label:`Unknown`}}}function M(e){let t=S.safeParse(e);return t.success?t.data:void 0}function N({env:e}){let[t,i]=r(),[a,c]=r(),[l,d]=r({});return n(()=>{let t=!1;return i(void 0),c(void 0),d({}),fetch(`${e.proxyPath}/boards/${encodeURIComponent(e.board)}`).then(e=>e.ok?e.json():Promise.reject(Error(`Board configuration returned ${e.status}`))).then(n=>{t||(i(n),c(e.board))}).catch(()=>{t||(i({panels:[]}),c(e.board))}),()=>{t=!0}},[e.board,e.proxyPath]),n(()=>{if(!t||a!==e.board)return;let n=!1,r=[];for(let i of t.panels){if(i.type!==`pipeline-status`&&i.type!==`http-value`)continue;let a=!1,o=_({boardDefaultMillis:u(t.refresh??`60s`)??6e4,panelOverrideMillis:i.refresh?u(i.refresh)??void 0:void 0,adapterFloorMillis:0}),s=()=>{n||a||(a=!0,fetch(`${e.proxyPath}/panel/${encodeURIComponent(e.board)}/${encodeURIComponent(i.id)}`).then(e=>e.status===304?void 0:e.json()).then(e=>{let t=M(e);!n&&t&&d(e=>({...e,[i.id]:t}))}).catch(()=>void 0).finally(()=>{a=!1}))};s(),r.push(window.setInterval(s,o))}return()=>{n=!0;for(let e of r)window.clearInterval(e)}},[t,e.board,e.proxyPath,a]),s(`div`,{className:`board`,children:[s(`header`,{className:`board__header`,children:[o(`h1`,{className:`board__title`,children:e.board}),s(`dl`,{className:`board__meta`,children:[s(`div`,{children:[o(`dt`,{children:`client`}),o(`dd`,{children:e.clientVersion})]}),s(`div`,{children:[o(`dt`,{children:`assets`}),o(`dd`,{children:e.assetPath})]})]})]}),s(`main`,{className:`board__grid`,children:[!t&&o(k,{label:`board`,hint:`Loading configuration…`,wide:!0}),t?.panels.map(e=>e.type===`pipeline-status`?o(A,{panel:e,data:l[e.id]},e.id):e.type===`http-value`?o(O,{panel:e,data:l[e.id]},e.id):o(k,{label:e.type,hint:`Not wired yet`,wide:!0},e.id))]}),o(`footer`,{className:`board__footer`,children:`Signals are read live from their configured authorities.`})]})}function P({message:e}){return s(`div`,{className:`config-error`,role:`alert`,children:[o(`h1`,{children:`⚠️ Dashboard misconfigured`}),o(`p`,{children:`The page loaded, but the server did not hand it usable configuration.`}),o(`pre`,{children:e})]})}var F=document.getElementById(`root`);if(!F)throw Error(`No #root element in the document — the template is not the one we expect.`);var I=i(F);try{I.render(o(t,{children:o(N,{env:y()})}))}catch(e){I.render(o(P,{message:e instanceof Error?e.message:String(e)}))}
|
|
3
|
-
//# sourceMappingURL=index-BddJ8Qxp.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-BddJ8Qxp.js","names":[],"sources":["../../../shared/dist/index.js","../../src/ObservedAt.tsx","../../src/panel-layout.ts","../../src/HttpValuePanel.tsx","../../src/PanelPlaceholder.tsx","../../src/PipelinePanel.tsx","../../src/App.tsx","../../src/ConfigError.tsx","../../src/main.tsx"],"sourcesContent":["// packages/shared/src/board-config.ts\nimport { z as z2 } from \"zod\";\n\n// packages/shared/src/duration.ts\nimport { z } from \"zod\";\nvar DURATION_PATTERN = /^(\\d+)(ms|s|m|h)$/;\nvar UNIT_MILLIS = {\n ms: 1,\n s: 1e3,\n m: 6e4,\n h: 36e5\n};\nfunction parseDuration(value) {\n const match = DURATION_PATTERN.exec(value);\n if (!match) return null;\n const [, rawAmount, rawUnit] = match;\n if (rawAmount === void 0 || rawUnit === void 0) return null;\n const amount = Number(rawAmount);\n if (amount <= 0) return null;\n return amount * UNIT_MILLIS[rawUnit];\n}\nvar durationSchema = z.string().refine((value) => parseDuration(value) !== null, {\n message: 'must be a positive duration like \"30s\", \"5m\", or \"1h\"'\n}).brand();\n\n// packages/shared/src/board-config.ts\nvar positionSchema = z2.object({\n x: z2.number().int().min(0),\n y: z2.number().int().min(0),\n w: z2.number().int().min(1).max(12),\n h: z2.number().int().min(1)\n});\nvar panelSchema = z2.looseObject({\n id: z2.string().min(1),\n type: z2.string().min(1),\n source: z2.string().min(1).optional(),\n /** Advisory in v1 — a panel without a position renders in config order rather than not at all. */\n position: positionSchema.optional(),\n refresh: durationSchema.optional(),\n /** A deliberate override only. Adapters derive links; hand-written ones drift. */\n link: z2.url().optional(),\n /** Source-agnostic endpoint used by the http-value signal. */\n url: z2.url().optional(),\n /** Small, deliberate JSON path subset: $.version, $.deployment.version, or $.response.docs[0].latestVersion. */\n json_path: z2.string().regex(/^\\$(?:\\.[A-Za-z_][A-Za-z0-9_]*|\\[\\d+\\])*$/, \"must be a simple JSON path\").optional()\n});\nvar sourceSchema = z2.looseObject({\n type: z2.string().min(1),\n /** Credentials are never in the config — only the name of the env var holding one. */\n token_env: z2.string().min(1).optional()\n});\nvar boardSchema = z2.object({\n refresh: durationSchema.optional(),\n panels: z2.array(panelSchema).min(1).superRefine((panels, ctx) => {\n const seen = /* @__PURE__ */ new Map();\n panels.forEach((panel, index) => {\n const firstIndex = seen.get(panel.id);\n if (firstIndex === void 0) {\n seen.set(panel.id, index);\n return;\n }\n ctx.addIssue({\n code: \"custom\",\n path: [index, \"id\"],\n message: `duplicate panel id \"${panel.id}\" (already used by panel at index ${firstIndex})`\n });\n });\n })\n});\nvar authSchema = z2.object({\n issuer: z2.url(),\n /** Absent in gateway mode — the gateway does the flow, the proxy still validates. */\n client_id: z2.string().min(1).optional(),\n allow: z2.object({\n groups: z2.array(z2.string().min(1)).optional(),\n subjects: z2.array(z2.string().min(1)).optional()\n }).optional()\n});\nvar boardConfigSchema = z2.object({\n sources: z2.record(z2.string().min(1), sourceSchema).default({}),\n boards: z2.record(z2.string().min(1), boardSchema),\n auth: authSchema.optional()\n});\nfunction resolveRefreshMillis(args) {\n const requested = args.panelOverrideMillis ?? args.boardDefaultMillis;\n return Math.max(requested, args.adapterFloorMillis);\n}\n\n// packages/shared/src/client-env.ts\nimport { z as z3 } from \"zod\";\nvar clientEnvSchema = z3.object({\n /** Where the immutable client assets live. The one variable that repoints the whole client. */\n assetPath: z3.string().min(1),\n /** Same-origin path the proxy is mounted at, so there is no CORS and no cookie problem. */\n proxyPath: z3.string().min(1),\n /** Which board this is, resolved server-side so the client parses no URLs. */\n board: z3.string().min(1),\n /** The client version being served, so two published versions are visibly distinguishable. */\n clientVersion: z3.string().min(1),\n /** Omitted entirely when unauthenticated — presence is what turns auth on. */\n auth: z3.object({\n issuer: z3.string().min(1),\n clientId: z3.string().min(1).optional()\n }).optional()\n});\nfunction readClientEnv(source = globalThis.window?.env) {\n const result = clientEnvSchema.safeParse(source);\n if (!result.success) {\n throw new Error(\n `window.env is missing or invalid \\u2014 the server did not inject usable configuration.\n${z3.prettifyError(result.error)}`\n );\n }\n return result.data;\n}\n\n// packages/shared/src/envelope.ts\nimport { z as z4 } from \"zod\";\nvar errorKindSchema = z4.enum([\n \"unreachable\",\n \"unauthorized\",\n \"not-found\",\n \"upstream-error\"\n]);\nvar envelopeErrorSchema = z4.object({\n kind: errorKindSchema,\n message: z4.string()\n});\nvar envelopeSchema = z4.discriminatedUnion(\"state\", [\n z4.object({\n panelId: z4.string().min(1),\n state: z4.literal(\"ok\"),\n /** From the upstream response `Date`. A cached value must never be shown without its age. */\n observedAt: z4.iso.datetime(),\n /** Adapter-derived. The authority for this panel; the dashboard itself asserts nothing. */\n link: z4.url().nullable(),\n signal: z4.unknown()\n }),\n z4.object({\n panelId: z4.string().min(1),\n state: z4.literal(\"error\"),\n /**\n * Populated even on error: knowing *when* a failure was observed is the difference between\n * \"broken just now\" and \"broken all morning\", and a panel that can't reach its source is\n * exactly when a viewer most wants to click through.\n */\n observedAt: z4.iso.datetime(),\n link: z4.url().nullable(),\n error: envelopeErrorSchema\n })\n]);\nvar pipelineStatusSchema = z4.object({\n type: z4.literal(\"pipeline-status\"),\n status: z4.enum([\"passed\", \"failed\", \"running\", \"cancelled\", \"unknown\"]),\n /** The source's unmodified status/result vocabulary, for an honest display. */\n rawStatus: z4.string(),\n name: z4.string().min(1)\n});\nvar httpValueSchema = z4.object({\n type: z4.literal(\"http-value\"),\n value: z4.union([z4.string(), z4.number(), z4.boolean()])\n});\nexport {\n authSchema,\n boardConfigSchema,\n boardSchema,\n clientEnvSchema,\n durationSchema,\n envelopeSchema,\n errorKindSchema,\n httpValueSchema,\n panelSchema,\n parseDuration,\n pipelineStatusSchema,\n positionSchema,\n readClientEnv,\n resolveRefreshMillis,\n sourceSchema\n};\n","export function ObservedAt({ value }: { value: string }) {\n const observed = new Date(value)\n const formatted = observed.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })\n const age = Date.now() - observed.getTime()\n const stale = age > 5 * 60 * 1000\n const ageText = formatAge(age)\n return (\n <p className={`panel__hint panel__observed${stale ? ' panel__observed--stale' : ''}`}>\n <span aria-hidden=\"true\">◷</span> As of {formatted} · {ageText}\n </p>\n )\n}\n\nfunction formatAge(milliseconds: number) {\n if (milliseconds < 60_000) return 'just now'\n const minutes = Math.floor(milliseconds / 60_000)\n if (minutes < 60) return `${minutes}m ago`\n const hours = Math.floor(minutes / 60)\n return `${hours}h ${minutes % 60}m ago`\n}\n","import type { Panel } from '@ze-great-dashboard/shared'\nimport type { CSSProperties } from 'react'\n\n/** Convert the advisory board position into CSS grid placement. */\nexport function panelLayout(panel: Panel): CSSProperties | undefined {\n const position = panel.position\n if (!position) return undefined\n\n return {\n '--panel-column': `${position.x + 1} / span ${position.w}`,\n '--panel-row': `${position.y + 1} / span ${position.h}`,\n } as CSSProperties\n}\n","import type { Panel } from '@ze-great-dashboard/shared'\nimport { type Envelope, httpValueSchema } from '@ze-great-dashboard/shared'\nimport { ObservedAt } from './ObservedAt.tsx'\nimport { panelLayout } from './panel-layout.ts'\n\nexport function HttpValuePanel({ panel, data }: { panel: Panel; data: Envelope | undefined }) {\n if (!data)\n return (\n <section className=\"panel\" style={panelLayout(panel)} aria-busy=\"true\">\n <h2 className=\"panel__label\">{panel.id}</h2>\n <p className=\"panel__hint\">Loading…</p>\n </section>\n )\n if (data.state === 'error')\n return (\n <section className=\"panel panel--error\" style={panelLayout(panel)}>\n <h2 className=\"panel__label\">{panel.id}</h2>\n <p className=\"panel__status\">⚠ Unable to read</p>\n <p className=\"panel__hint\">{data.error.message}</p>\n <ObservedAt value={data.observedAt} />\n </section>\n )\n const signal = httpValueSchema.safeParse(data.signal)\n if (!signal.success)\n return (\n <section className=\"panel panel--error\" style={panelLayout(panel)}>\n <h2 className=\"panel__label\">{panel.id}</h2>\n <p className=\"panel__status\">⚠ Invalid value</p>\n <ObservedAt value={data.observedAt} />\n </section>\n )\n const content = (\n <>\n <p className=\"panel__status\">{String(signal.data.value)}</p>\n <ObservedAt value={data.observedAt} />\n </>\n )\n return (\n <section className=\"panel\" style={panelLayout(panel)}>\n <h2 className=\"panel__label\">{panel.id}</h2>\n {data.link ? (\n <a className=\"panel__link\" href={data.link}>\n {content}\n </a>\n ) : (\n content\n )}\n </section>\n )\n}\n","/**\n * A panel-shaped hole, so the grid can be looked at and argued with before any signal exists.\n * Replaced by real panels in Stage 2 — nothing here is meant to survive.\n */\nexport function PanelPlaceholder({\n label,\n hint,\n wide = false,\n}: {\n label: string\n hint: string\n wide?: boolean\n}) {\n return (\n <section className={wide ? 'panel panel--wide' : 'panel'}>\n <h2 className=\"panel__label\">{label}</h2>\n <p className=\"panel__hint\">{hint}</p>\n </section>\n )\n}\n","import {\n type Envelope,\n envelopeSchema,\n type Panel,\n pipelineStatusSchema,\n} from '@ze-great-dashboard/shared'\nimport { ObservedAt } from './ObservedAt.tsx'\nimport { panelLayout } from './panel-layout.ts'\n\nexport function PipelinePanel({ panel, data }: { panel: Panel; data: Envelope | undefined }) {\n if (!data)\n return (\n <section className=\"panel\" style={panelLayout(panel)} aria-busy=\"true\">\n <h2 className=\"panel__label\">{panel.id}</h2>\n <p className=\"panel__hint\">Loading…</p>\n </section>\n )\n if (data.state === 'error') {\n return (\n <section className=\"panel panel--error\" style={panelLayout(panel)}>\n <h2 className=\"panel__label\">{panel.id}</h2>\n <p className=\"panel__status\">⚠ Unable to read</p>\n <p className=\"panel__hint\">{data.error.message}</p>\n <ObservedAt value={data.observedAt} />\n </section>\n )\n }\n\n const signal = pipelineStatusSchema.safeParse(data.signal)\n if (!signal.success)\n return (\n <section className=\"panel panel--error\" style={panelLayout(panel)}>\n <h2 className=\"panel__label\">{panel.id}</h2>\n <p className=\"panel__status\">⚠ Invalid signal</p>\n <ObservedAt value={data.observedAt} />\n </section>\n )\n const presentation = statusPresentation(signal.data.status)\n const content = (\n <>\n <p className={`panel__status panel__status--${signal.data.status}`}>\n {presentation.glyph} {presentation.label}\n </p>\n <p className=\"panel__hint\">\n {signal.data.name} · {signal.data.rawStatus}\n </p>\n <ObservedAt value={data.observedAt} />\n </>\n )\n return (\n <section className=\"panel\" style={panelLayout(panel)}>\n <h2 className=\"panel__label\">{panel.id}</h2>\n {data.link ? (\n <a className=\"panel__link\" href={data.link}>\n {content}\n </a>\n ) : (\n content\n )}\n </section>\n )\n}\n\nfunction statusPresentation(status: 'passed' | 'failed' | 'running' | 'cancelled' | 'unknown') {\n switch (status) {\n case 'passed':\n return { glyph: '✓', label: 'Passed' }\n case 'failed':\n return { glyph: '✕', label: 'Failed' }\n case 'running':\n return { glyph: '↻', label: 'Running' }\n case 'cancelled':\n return { glyph: '⊘', label: 'Cancelled' }\n case 'unknown':\n return { glyph: '?', label: 'Unknown' }\n }\n}\n\nexport function parseEnvelope(value: unknown): Envelope | undefined {\n const result = envelopeSchema.safeParse(value)\n return result.success ? result.data : undefined\n}\n","import {\n type Board,\n type ClientEnv,\n type Envelope,\n parseDuration,\n resolveRefreshMillis,\n} from '@ze-great-dashboard/shared'\nimport { useEffect, useState } from 'react'\nimport { HttpValuePanel } from './HttpValuePanel.tsx'\nimport { PanelPlaceholder } from './PanelPlaceholder.tsx'\nimport { PipelinePanel, parseEnvelope } from './PipelinePanel.tsx'\n\n/**\n * The board shell.\n *\n * Stage 1 has no data: there is no proxy endpoint to poll yet. What this proves is the plumbing —\n * that the client was handed its configuration by the server and knows which version of itself it\n * is. The version readout is what makes two published versions visibly different, which is the\n * whole point of the Stage 1 exit criterion.\n */\nexport function App({ env }: { env: ClientEnv }) {\n const [board, setBoard] = useState<Board>()\n const [loadedBoardName, setLoadedBoardName] = useState<string>()\n const [signals, setSignals] = useState<Record<string, Envelope | undefined>>({})\n\n useEffect(() => {\n let cancelled = false\n setBoard(undefined)\n setLoadedBoardName(undefined)\n setSignals({})\n fetch(`${env.proxyPath}/boards/${encodeURIComponent(env.board)}`)\n .then((response) =>\n response.ok\n ? response.json()\n : Promise.reject(new Error(`Board configuration returned ${response.status}`)),\n )\n .then((value: unknown) => {\n if (!cancelled) {\n setBoard(value as Board)\n setLoadedBoardName(env.board)\n }\n })\n .catch(() => {\n if (!cancelled) {\n setBoard({ panels: [] })\n setLoadedBoardName(env.board)\n }\n })\n return () => {\n cancelled = true\n }\n }, [env.board, env.proxyPath])\n\n useEffect(() => {\n if (!board || loadedBoardName !== env.board) return\n let cancelled = false\n const timers: number[] = []\n\n for (const panel of board.panels) {\n if (panel.type !== 'pipeline-status' && panel.type !== 'http-value') continue\n\n let inFlight = false\n const refreshMillis = resolveRefreshMillis({\n boardDefaultMillis: parseDuration(board.refresh ?? '60s') ?? 60_000,\n panelOverrideMillis: panel.refresh\n ? (parseDuration(panel.refresh) ?? undefined)\n : undefined,\n adapterFloorMillis: 0,\n })\n\n const refresh = () => {\n if (cancelled || inFlight) return\n inFlight = true\n fetch(\n `${env.proxyPath}/panel/${encodeURIComponent(env.board)}/${encodeURIComponent(panel.id)}`,\n )\n .then((response) => (response.status === 304 ? undefined : response.json()))\n .then((value: unknown) => {\n const envelope = parseEnvelope(value)\n if (!cancelled && envelope)\n setSignals((current) => ({ ...current, [panel.id]: envelope }))\n })\n .catch(() => undefined)\n .finally(() => {\n inFlight = false\n })\n }\n\n refresh()\n timers.push(window.setInterval(refresh, refreshMillis))\n }\n return () => {\n cancelled = true\n for (const timer of timers) window.clearInterval(timer)\n }\n }, [board, env.board, env.proxyPath, loadedBoardName])\n\n return (\n <div className=\"board\">\n <header className=\"board__header\">\n <h1 className=\"board__title\">{env.board}</h1>\n <dl className=\"board__meta\">\n <div>\n <dt>client</dt>\n <dd>{env.clientVersion}</dd>\n </div>\n <div>\n <dt>assets</dt>\n <dd>{env.assetPath}</dd>\n </div>\n </dl>\n </header>\n\n <main className=\"board__grid\">\n {!board && <PanelPlaceholder label=\"board\" hint=\"Loading configuration…\" wide />}\n {board?.panels.map((panel) =>\n panel.type === 'pipeline-status' ? (\n <PipelinePanel key={panel.id} panel={panel} data={signals[panel.id]} />\n ) : panel.type === 'http-value' ? (\n <HttpValuePanel key={panel.id} panel={panel} data={signals[panel.id]} />\n ) : (\n <PanelPlaceholder key={panel.id} label={panel.type} hint=\"Not wired yet\" wide />\n ),\n )}\n </main>\n\n <footer className=\"board__footer\">\n Signals are read live from their configured authorities.\n </footer>\n </div>\n )\n}\n","export function ConfigError({ message }: { message: string }) {\n return (\n <div className=\"config-error\" role=\"alert\">\n <h1>⚠️ Dashboard misconfigured</h1>\n <p>The page loaded, but the server did not hand it usable configuration.</p>\n <pre>{message}</pre>\n </div>\n )\n}\n","import { readClientEnv } from '@ze-great-dashboard/shared'\nimport { StrictMode } from 'react'\nimport { createRoot } from 'react-dom/client'\nimport { App } from './App.tsx'\nimport { ConfigError } from './ConfigError.tsx'\nimport './styles.css'\n\nconst container = document.getElementById('root')\nif (!container) {\n throw new Error('No #root element in the document — the template is not the one we expect.')\n}\n\nconst root = createRoot(container)\n\ntry {\n root.render(\n <StrictMode>\n <App env={readClientEnv()} />\n </StrictMode>,\n )\n} catch (error) {\n // A radiator that fails silently is worse than one that says what's wrong. If configuration\n // never arrived, say so on screen rather than rendering an empty board.\n root.render(<ConfigError message={error instanceof Error ? error.message : String(error)} />)\n}\n"],"mappings":"o2BAKA,IAAI,EAAmB,oBACnB,EAAc,CAChB,GAAI,EACJ,EAAG,IACH,EAAG,IACH,EAAG,IACL,EACA,SAAS,EAAc,EAAO,CAC5B,IAAM,EAAQ,EAAiB,KAAK,CAAK,EACzC,GAAI,CAAC,EAAO,OAAO,KACnB,GAAM,EAAG,EAAW,GAAW,EAC/B,GAAI,IAAc,IAAK,IAAK,IAAY,IAAK,GAAG,OAAO,KACvD,IAAM,EAAS,OAAO,CAAS,EAE/B,OADI,GAAU,EAAU,KACjB,EAAS,EAAY,EAC9B,CACA,IAAI,EAAiB,EAAE,OAAO,CAAC,CAAC,OAAQ,GAAU,EAAc,CAAK,IAAM,KAAM,CAC/E,QAAS,uDACX,CAAC,CAAC,CAAC,MAAM,EAGL,EAAiB,EAAG,OAAO,CAC7B,EAAG,EAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAC1B,EAAG,EAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAC1B,EAAG,EAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,EAClC,EAAG,EAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAC5B,CAAC,EACG,EAAc,EAAG,YAAY,CAC/B,GAAI,EAAG,OAAO,CAAC,CAAC,IAAI,CAAC,EACrB,KAAM,EAAG,OAAO,CAAC,CAAC,IAAI,CAAC,EACvB,OAAQ,EAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAEpC,SAAU,EAAe,SAAS,EAClC,QAAS,EAAe,SAAS,EAEjC,KAAM,EAAG,IAAI,CAAC,CAAC,SAAS,EAExB,IAAK,EAAG,IAAI,CAAC,CAAC,SAAS,EAEvB,UAAW,EAAG,OAA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