@codeledger/insight-ui 0.8.9

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 (50) hide show
  1. package/LICENSE +27 -0
  2. package/dist/components/CockpitLayout.d.ts +60 -0
  3. package/dist/components/CockpitLayout.d.ts.map +1 -0
  4. package/dist/components/CockpitLayout.js +49 -0
  5. package/dist/components/CockpitLayout.js.map +1 -0
  6. package/dist/components/ScopeControls.d.ts +36 -0
  7. package/dist/components/ScopeControls.d.ts.map +1 -0
  8. package/dist/components/ScopeControls.js +137 -0
  9. package/dist/components/ScopeControls.js.map +1 -0
  10. package/dist/components/SystemInsights.d.ts +13 -0
  11. package/dist/components/SystemInsights.d.ts.map +1 -0
  12. package/dist/components/SystemInsights.js +17 -0
  13. package/dist/components/SystemInsights.js.map +1 -0
  14. package/dist/index.d.ts +2 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +2 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/pages/Efficiency.d.ts +8 -0
  19. package/dist/pages/Efficiency.d.ts.map +1 -0
  20. package/dist/pages/Efficiency.js +66 -0
  21. package/dist/pages/Efficiency.js.map +1 -0
  22. package/dist/pages/Integrity.d.ts +8 -0
  23. package/dist/pages/Integrity.d.ts.map +1 -0
  24. package/dist/pages/Integrity.js +39 -0
  25. package/dist/pages/Integrity.js.map +1 -0
  26. package/dist/pages/Knowledge.d.ts +8 -0
  27. package/dist/pages/Knowledge.d.ts.map +1 -0
  28. package/dist/pages/Knowledge.js +32 -0
  29. package/dist/pages/Knowledge.js.map +1 -0
  30. package/dist/pages/Overview.d.ts +8 -0
  31. package/dist/pages/Overview.d.ts.map +1 -0
  32. package/dist/pages/Overview.js +53 -0
  33. package/dist/pages/Overview.js.map +1 -0
  34. package/dist/pages/Quality.d.ts +8 -0
  35. package/dist/pages/Quality.d.ts.map +1 -0
  36. package/dist/pages/Quality.js +32 -0
  37. package/dist/pages/Quality.js.map +1 -0
  38. package/dist/pages/Value.d.ts +8 -0
  39. package/dist/pages/Value.d.ts.map +1 -0
  40. package/dist/pages/Value.js +10 -0
  41. package/dist/pages/Value.js.map +1 -0
  42. package/dist/render.d.ts +3 -0
  43. package/dist/render.d.ts.map +1 -0
  44. package/dist/render.js +105 -0
  45. package/dist/render.js.map +1 -0
  46. package/dist/theme.d.ts +2 -0
  47. package/dist/theme.d.ts.map +1 -0
  48. package/dist/theme.js +442 -0
  49. package/dist/theme.js.map +1 -0
  50. package/package.json +43 -0
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { PatternSpreadPanel } from '../components/ScopeControls.js';
3
+ import { InsightStrip, MetricGrid, PageHeader, ShadowHotspotList } from '../components/CockpitLayout.js';
4
+ export function KnowledgePage({ snapshot }) {
5
+ const syntheticLabel = snapshot.syntheticScenario?.scenarioIds?.join(', ');
6
+ const { metrics, insights, value, patternSpread, shadowHotspots } = snapshot;
7
+ const cards = [
8
+ {
9
+ label: 'Pattern reuse',
10
+ value: metrics.knowledge.patternReuseRate.value,
11
+ detail: 'Reused patterns',
12
+ metricKey: 'patternReuseRate',
13
+ severity: metrics.knowledge.patternReuseRate.value > 0.65 ? 'low' : 'medium',
14
+ },
15
+ {
16
+ label: 'Time to context',
17
+ value: metrics.knowledge.timeToContext.value / 10,
18
+ detail: 'Approx. minutes',
19
+ metricKey: 'timeToContext',
20
+ format: 'raw',
21
+ },
22
+ {
23
+ label: 'Shadow knowledge',
24
+ value: metrics.knowledge.shadowKnowledgeIndex.value,
25
+ detail: 'Signals weight',
26
+ metricKey: 'shadowKnowledgeIndex',
27
+ severity: metrics.knowledge.shadowKnowledgeIndex.value > 0.4 ? 'high' : 'medium',
28
+ },
29
+ ];
30
+ return (_jsxs("div", { className: "knowledge-page", children: [_jsx(PageHeader, { title: "Knowledge cockpit", subtitle: "Patterns, context, and documentation coverage", scope: value.scope, confidence: value.confidence, syntheticLabel: syntheticLabel }), _jsx(MetricGrid, { cards: cards }), _jsx(InsightStrip, { insights: insights, focusMetrics: ['patternReuseRate', 'timeToContext', 'shadowKnowledgeIndex'], title: "Knowledge signals", subtitle: "Memory compounding + emerging gaps", limit: 3 }), _jsx(PatternSpreadPanel, { patternSpread: patternSpread }), _jsx(ShadowHotspotList, { entries: shadowHotspots })] }));
31
+ }
32
+ //# sourceMappingURL=Knowledge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Knowledge.js","sourceRoot":"","sources":["../../src/pages/Knowledge.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAMzG,MAAM,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAS;IAC/C,MAAM,cAAc,GAAG,QAAQ,CAAC,iBAAiB,EAAE,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3E,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,QAAQ,CAAC;IAC7E,MAAM,KAAK,GAA2B;QACpC;YACE,KAAK,EAAE,eAAe;YACtB,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,KAAK;YAC/C,MAAM,EAAE,iBAAiB;YACzB,SAAS,EAAE,kBAAkB;YAC7B,QAAQ,EAAE,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ;SAC7E;QACD;YACE,KAAK,EAAE,iBAAiB;YACxB,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,KAAK,GAAG,EAAE;YACjD,MAAM,EAAE,iBAAiB;YACzB,SAAS,EAAE,eAAe;YAC1B,MAAM,EAAE,KAAK;SACd;QACD;YACE,KAAK,EAAE,kBAAkB;YACzB,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,oBAAoB,CAAC,KAAK;YACnD,MAAM,EAAE,gBAAgB;YACxB,SAAS,EAAE,sBAAsB;YACjC,QAAQ,EAAE,OAAO,CAAC,SAAS,CAAC,oBAAoB,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ;SACjF;KACF,CAAC;IAEF,OAAO,CACL,eAAK,SAAS,EAAC,gBAAgB,aAC7B,KAAC,UAAU,IACT,KAAK,EAAC,mBAAmB,EACzB,QAAQ,EAAC,+CAA+C,EACxD,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,UAAU,EAAE,KAAK,CAAC,UAAU,EAC5B,cAAc,EAAE,cAAc,GAC9B,EACF,KAAC,UAAU,IAAC,KAAK,EAAE,KAAK,GAAI,EAC5B,KAAC,YAAY,IACX,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,CAAC,kBAAkB,EAAE,eAAe,EAAE,sBAAsB,CAAC,EAC3E,KAAK,EAAC,mBAAmB,EACzB,QAAQ,EAAC,oCAAoC,EAC7C,KAAK,EAAE,CAAC,GACR,EACF,KAAC,kBAAkB,IAAC,aAAa,EAAE,aAAa,GAAI,EACpD,KAAC,iBAAiB,IAAC,OAAO,EAAE,cAAc,GAAI,IAC1C,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { InsightSnapshot } from '@codeledger/types';
3
+ interface Props {
4
+ snapshot: InsightSnapshot;
5
+ }
6
+ export declare function OverviewPage({ snapshot }: Props): ReactElement;
7
+ export {};
8
+ //# sourceMappingURL=Overview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Overview.d.ts","sourceRoot":"","sources":["../../src/pages/Overview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKzE,UAAU,KAAK;IACb,QAAQ,EAAE,eAAe,CAAC;CAC3B;AA2CD,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,GAAG,YAAY,CAkG9D"}
@@ -0,0 +1,53 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { CartesianGrid, Line, LineChart, Tooltip, XAxis, YAxis } from 'recharts';
3
+ import { PatternSpreadPanel } from '../components/ScopeControls.js';
4
+ import { ActionCallout, EvidenceLink, InsightStrip, PageHeader, ValueHero } from '../components/CockpitLayout.js';
5
+ function fmt(v) {
6
+ return `${Math.round(v * 100)}%`;
7
+ }
8
+ function healthScore(metrics) {
9
+ const integrity = metrics.integrity.writeSafetySuccessRate.value;
10
+ const quality = metrics.quality.executionReliability.value;
11
+ const knowledge = 1 - metrics.knowledge.shadowKnowledgeIndex.value;
12
+ const patterns = metrics.patterns.goldenPathAdherence.value;
13
+ return (integrity * 0.30) + (quality * 0.30) + (knowledge * 0.20) + (patterns * 0.20);
14
+ }
15
+ function healthSentence(score, pillars) {
16
+ const weakest = pillars.reduce((min, p) => p.value < min.value ? p : min, pillars[0]);
17
+ const gap = score - weakest.value;
18
+ if (score >= 0.85)
19
+ return 'Systems are healthy and compounding.';
20
+ if (score >= 0.70) {
21
+ return gap > 0.15
22
+ ? `Mostly healthy — ${weakest.label} is below target.`
23
+ : 'Mostly healthy — a few areas need attention.';
24
+ }
25
+ if (score >= 0.50) {
26
+ return gap > 0.15
27
+ ? `Mixed signals — ${weakest.label} needs focus.`
28
+ : 'Mixed signals — quality or integrity may need focus.';
29
+ }
30
+ return 'Below target — review the signals below.';
31
+ }
32
+ function severityDot(value) {
33
+ if (value >= 0.80)
34
+ return 'green';
35
+ if (value >= 0.60)
36
+ return 'amber';
37
+ return 'red';
38
+ }
39
+ export function OverviewPage({ snapshot }) {
40
+ const { metrics, value, recommendations, insights } = snapshot;
41
+ const syntheticLabel = snapshot.syntheticScenario?.scenarioIds?.join(', ');
42
+ const pillars = [
43
+ { label: 'Integrity', value: metrics.integrity.writeSafetySuccessRate.value, href: '/integrity' },
44
+ { label: 'Quality', value: metrics.quality.executionReliability.value, href: '/quality' },
45
+ { label: 'Knowledge', value: 1 - metrics.knowledge.shadowKnowledgeIndex.value, href: '/knowledge' },
46
+ { label: 'Patterns', value: metrics.patterns.goldenPathAdherence.value, href: '/knowledge' },
47
+ ];
48
+ const score = healthScore(metrics);
49
+ const eff = metrics.efficiency;
50
+ const hasEffData = eff.promptLift.denominator > 0;
51
+ return (_jsxs("div", { className: "overview-page", children: [_jsx(PageHeader, { title: "System health", scope: value.scope, confidence: value.confidence, syntheticLabel: syntheticLabel, trend: snapshot.valueTrend }), _jsxs("section", { className: "panel system-health-card", children: [_jsxs("div", { className: "health-headline", children: [_jsx("strong", { className: "health-score", children: fmt(score) }), _jsx("span", { className: "health-sentence", children: healthSentence(score, pillars) })] }), _jsx("div", { className: "health-sub-metrics", children: pillars.map((p) => (_jsxs("a", { className: "health-sub", href: p.href, children: [_jsx("span", { className: `severity-dot ${severityDot(p.value)}` }), _jsx("span", { className: "health-sub-label", children: p.label }), _jsx("strong", { children: fmt(p.value) })] }, p.label))) })] }), _jsx(ValueHero, { estimated: value.estimatedSavings, scope: value.scope, trend: snapshot.valueTrend, confidence: value.confidence }), _jsxs("section", { className: "panel drivers-section", children: [_jsx("div", { className: "kicker", children: "Drivers" }), _jsx("p", { className: "drivers-subtitle", children: "What is driving the current result" }), _jsxs("div", { className: "drivers-row", children: [_jsxs("div", { className: "driver-item", children: [_jsx("span", { className: "driver-label", children: "Prompt lift" }), _jsx("strong", { children: hasEffData ? fmt(eff.promptLift.value) : '—' }), hasEffData && _jsx(EvidenceLink, { metric: "promptLift" })] }), _jsxs("div", { className: "driver-item", children: [_jsx("span", { className: "driver-label", children: "Context compression" }), _jsx("strong", { children: hasEffData ? fmt(eff.contextCompression.value) : '—' }), hasEffData && _jsx(EvidenceLink, { metric: "contextCompression" })] }), _jsxs("div", { className: "driver-item", children: [_jsx("span", { className: "driver-label", children: "Waste avoided" }), _jsx("strong", { children: hasEffData ? fmt(eff.wasteAvoided.value) : '—' }), hasEffData && _jsx(EvidenceLink, { metric: "wasteAvoided" })] })] }), !hasEffData && (_jsxs("p", { className: "scope-context", children: ["No prompt refinement data yet. ", _jsx("a", { href: "/efficiency", children: "Learn more \u2192" })] }))] }), _jsx(InsightStrip, { insights: insights, title: "Signals", limit: 3 }), _jsx(ActionCallout, { recommendations: recommendations }), _jsxs("section", { className: "detail-section", children: [metrics.overview.trend.length >= 2 && (_jsxs("section", { className: "panel chart-wrap trend-panel demoted", children: [_jsx("div", { className: "kicker", children: "Trend" }), _jsxs(LineChart, { width: 960, height: 200, data: metrics.overview.trend, children: [_jsx(CartesianGrid, { stroke: "#d7d0c3", strokeDasharray: "3 3" }), _jsx(XAxis, { dataKey: "date", tick: { fontSize: 11 } }), _jsx(YAxis, { domain: [0, 1], tick: { fontSize: 11 } }), _jsx(Tooltip, {}), _jsx(Line, { type: "monotone", dataKey: "integrity", stroke: "#0b6e4f", strokeWidth: 2, dot: false }), _jsx(Line, { type: "monotone", dataKey: "quality", stroke: "#bc6c25", strokeWidth: 2, dot: false }), _jsx(Line, { type: "monotone", dataKey: "knowledge", stroke: "#1e2430", strokeWidth: 1.5, dot: false })] })] })), _jsx(PatternSpreadPanel, { patternSpread: snapshot.patternSpread })] })] }));
52
+ }
53
+ //# sourceMappingURL=Overview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Overview.js","sourceRoot":"","sources":["../../src/pages/Overview.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,YAAY,E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AAS,EAAC,QAAQ,sBAAY,EACnC,MAAC,SAAS,IAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,aAC9D,KAAC,aAAa,IAAC,MAAM,EAAC,SAAS,EAAC,eAAe,EAAC,KAAK,GAAG,EACxD,KAAC,KAAK,IAAC,OAAO,EAAC,MAAM,EAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAI,EAChD,KAAC,KAAK,IAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAI,EACjD,KAAC,OAAO,KAAG,EACX,KAAC,IAAI,IAAC,IAAI,EAAC,UAAU,EAAC,OAAO,EAAC,WAAW,EAAC,MAAM,EAAC,SAAS,EAAC,WAAW,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,GAAI,EACzF,KAAC,IAAI,IAAC,IAAI,EAAC,UAAU,EAAC,OAAO,EAAC,SAAS,EAAC,MAAM,EAAC,SAAS,EAAC,WAAW,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,GAAI,EACvF,KAAC,IAAI,IAAC,IAAI,EAAC,UAAU,EAAC,OAAO,EAAC,WAAW,EAAC,MAAM,EAAC,SAAS,EAAC,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,GAAI,IACjF,IACJ,CACX,EACD,KAAC,kBAAkB,IAAC,aAAa,EAAE,QAAQ,CAAC,aAAa,GAAI,IACrD,IACN,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { InsightSnapshot } from '@codeledger/types';
3
+ interface Props {
4
+ snapshot: InsightSnapshot;
5
+ }
6
+ export declare function QualityPage({ snapshot }: Props): ReactElement;
7
+ export {};
8
+ //# sourceMappingURL=Quality.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Quality.d.ts","sourceRoot":"","sources":["../../src/pages/Quality.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKzD,UAAU,KAAK;IACb,QAAQ,EAAE,eAAe,CAAC;CAC3B;AAED,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,GAAG,YAAY,CAyD7D"}
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ComparisonPanel, HotspotPanel } from '../components/ScopeControls.js';
3
+ import { InsightStrip, MetricGrid, PageHeader } from '../components/CockpitLayout.js';
4
+ export function QualityPage({ snapshot }) {
5
+ const syntheticLabel = snapshot.syntheticScenario?.scenarioIds?.join(', ');
6
+ const { metrics, insights, value } = snapshot;
7
+ const cards = [
8
+ {
9
+ label: 'First pass success',
10
+ value: metrics.quality.firstPassSuccessRate.value,
11
+ detail: 'First-pass success',
12
+ metricKey: 'firstPassSuccessRate',
13
+ severity: metrics.quality.firstPassSuccessRate.value < 0.75 ? 'medium' : 'low',
14
+ },
15
+ {
16
+ label: 'Rework ratio',
17
+ value: metrics.quality.reworkRatio.value,
18
+ detail: 'Rework executions',
19
+ metricKey: 'reworkRatio',
20
+ severity: metrics.quality.reworkRatio.value > 0.3 ? 'high' : 'medium',
21
+ },
22
+ {
23
+ label: 'Reliability',
24
+ value: metrics.quality.executionReliability.value,
25
+ detail: 'Success executions',
26
+ metricKey: 'executionReliability',
27
+ severity: metrics.quality.executionReliability.value < 0.8 ? 'medium' : 'low',
28
+ },
29
+ ];
30
+ return (_jsxs("div", { className: "quality-page", children: [_jsx(PageHeader, { title: "Quality cockpit", subtitle: "Execution performance and rework health", scope: value.scope, confidence: value.confidence, syntheticLabel: syntheticLabel }), _jsx(MetricGrid, { cards: cards }), _jsx(InsightStrip, { insights: insights, focusMetrics: ['firstPassSuccessRate', 'reworkRatio', 'executionReliability'], title: "Quality signals", subtitle: "What shifted in quality this period", limit: 3 }), _jsx(HotspotPanel, { summaries: snapshot.hotspotSummaries, type: "quality", title: "Top hotspots", placeholder: "No quality hotspots yet." }), _jsx(ComparisonPanel, { comparisons: snapshot.scopeComparisons ?? [], filter: ['executionReliability', 'firstPassSuccessRate'], title: "Compare to org" })] }));
31
+ }
32
+ //# sourceMappingURL=Quality.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Quality.js","sourceRoot":"","sources":["../../src/pages/Quality.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAMtF,MAAM,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAS;IAC7C,MAAM,cAAc,GAAG,QAAQ,CAAC,iBAAiB,EAAE,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3E,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;IAC9C,MAAM,KAAK,GAA2B;QACpC;YACE,KAAK,EAAE,oBAAoB;YAC3B,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,KAAK;YACjD,MAAM,EAAE,oBAAoB;YAC5B,SAAS,EAAE,sBAAsB;YACjC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK;SAC/E;QACD;YACE,KAAK,EAAE,cAAc;YACrB,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK;YACxC,MAAM,EAAE,mBAAmB;YAC3B,SAAS,EAAE,aAAa;YACxB,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC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snapshot: InsightSnapshot;
5
+ }
6
+ export declare function ValuePage({ snapshot }: Props): ReactElement;
7
+ export {};
8
+ //# sourceMappingURL=Value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Value.d.ts","sourceRoot":"","sources":["../../src/pages/Value.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAczD,UAAU,KAAK;IACb,QAAQ,EAAE,eAAe,CAAC;CAC3B;AAED,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,GAAG,YAAY,CAiG3D"}
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ActionCallout, InsightStrip, PageHeader, ValueBreakdownCard, ValueHero, } from '../components/CockpitLayout.js';
3
+ import { VALUE_CONFIDENCE_DESCRIPTIONS, VALUE_FORMULA_DESCRIPTION, VALUE_METRICS_USED, } from '@codeledger/types';
4
+ export function ValuePage({ snapshot }) {
5
+ const syntheticLabel = snapshot.syntheticScenario?.scenarioIds?.join(', ');
6
+ const { value, recommendations, insights } = snapshot;
7
+ const totalHours = value.reworkAvoidedHours + value.contextRecoveryHours + value.patternLeverageHours || 1;
8
+ return (_jsxs("div", { className: "value-page", children: [_jsx(PageHeader, { title: "Value cockpit", subtitle: "Estimated savings derived from observed signals", scope: value.scope, confidence: value.confidence, syntheticLabel: syntheticLabel, trend: snapshot.valueTrend }), _jsx(ValueHero, { estimated: value.estimatedSavings, scope: value.scope, confidence: value.confidence, trend: snapshot.valueTrend }), _jsxs("section", { className: "value-breakdown", children: [_jsx("div", { className: "kicker", children: "Breakdown" }), _jsx(ValueBreakdownCard, { label: "Rework reduction", hours: value.reworkAvoidedHours, share: value.reworkAvoidedHours / totalHours, metricKey: "reworkRatio" }), _jsx(ValueBreakdownCard, { label: "Context recovery", hours: value.contextRecoveryHours, share: value.contextRecoveryHours / totalHours, metricKey: "timeToContext" }), _jsx(ValueBreakdownCard, { label: "Pattern leverage", hours: value.patternLeverageHours, share: value.patternLeverageHours / totalHours, metricKey: "patternReuseRate" })] }), _jsxs("section", { className: "value-formula", children: [_jsx("div", { className: "kicker", children: "How this value is computed" }), _jsx("p", { children: VALUE_FORMULA_DESCRIPTION }), _jsx("div", { className: "formula-metrics", children: VALUE_METRICS_USED.map((metric) => (_jsxs("article", { children: [_jsx("strong", { children: metric.label }), _jsx("span", { children: metric.key })] }, metric.key))) }), _jsxs("p", { className: "confidence-note", children: ["Confidence: ", _jsx("strong", { children: value.confidence }), " \u2014 ", VALUE_CONFIDENCE_DESCRIPTIONS[value.confidence]] }), _jsxs("p", { className: "scope-context", children: ["Execution volume taken from execution reliability events (", value.scope.executions, " executions)."] })] }), value.derivation && value.derivation.length > 0 && (_jsxs("section", { className: "value-derivation", children: [_jsx("div", { className: "kicker", children: "Component derivation" }), value.derivation.map((d) => (_jsxs("article", { className: "derivation-card", children: [_jsxs("div", { className: "derivation-header", children: [_jsx("strong", { children: d.label }), _jsxs("span", { children: [d.hours.toFixed(1), "h"] })] }), _jsx("code", { className: "derivation-formula", children: d.formula }), _jsx("div", { className: "derivation-inputs", children: Object.entries(d.inputs).map(([k, v]) => (_jsxs("span", { className: "input-pair", children: [k, ": ", typeof v === 'number' ? v.toFixed(3) : v] }, k))) })] }, d.label)))] })), _jsxs("section", { className: "value-assumptions", children: [_jsx("div", { className: "kicker", children: "Assumptions" }), _jsxs("div", { className: "list", children: [_jsxs("div", { className: "row", children: [_jsx("span", { children: "Cost per hour" }), _jsxs("strong", { children: ["$", value.assumptions.cost_per_hour, "/hr"] })] }), _jsxs("div", { className: "row", children: [_jsx("span", { children: "Rework multiplier" }), _jsxs("strong", { children: [value.assumptions.rework_multiplier, "\u00D7"] })] })] }), _jsx("p", { className: "scope-context", children: "Value is grounded in aggregate signals. No individual developer scoring." })] }), _jsx(InsightStrip, { insights: insights, title: "Evidence-backed signals", subtitle: "Driving the estimated savings", limit: 3 }), _jsx(ActionCallout, { recommendations: recommendations })] }));
9
+ }
10
+ //# sourceMappingURL=Value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Value.js","sourceRoot":"","sources":["../../src/pages/Value.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,aAAa,EACb,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,SAAS,GACV,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,6BAA6B,EAC7B,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAM3B,MAAM,UAAU,SAAS,CAAC,EAAE,QAAQ,EAAS;IAC3C,MAAM,cAAc,GAAG,QAAQ,CAAC,iBAAiB,EAAE,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3E,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC;IACtD,MAAM,UAAU,GAAG,KAAK,CAAC,kBAAkB,GAAG,KAAK,CAAC,oBAAoB,GAAG,KAAK,CAAC,oBAAoB,IAAI,CAAC,CAAC;IAE3G,OAAO,CACL,eAAK,SAAS,EAAC,YAAY,aACzB,KAAC,UAAU,IACT,KAAK,EAAC,eAAe,EACrB,QAAQ,EAAC,iDAAiD,EAC1D,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,UAAU,EAAE,KAAK,CAAC,UAAU,EAC5B,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,QAAQ,CAAC,UAAU,GAC1B,EACF,KAAC,SAAS,IACR,SAAS,EAAE,KAAK,CAAC,gBAAgB,EACjC,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,UAAU,EAAE,KAAK,CAAC,UAAU,EAC5B,KAAK,EAAE,QAAQ,CAAC,UAAU,GAC1B,EACF,mBAAS,SAAS,EAAC,iBAAiB,aAClC,cAAK,SAAS,EAAC,QAAQ,0BAAgB,EACvC,KAAC,kBA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@
1
+ import type { InsightSnapshot } from '@codeledger/types';
2
+ export declare function renderInsightPage(pathname: string, snapshot: InsightSnapshot): string;
3
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAmBzD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,GAAG,MAAM,CA8CrF"}
package/dist/render.js ADDED
@@ -0,0 +1,105 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { renderToStaticMarkup } from 'react-dom/server';
3
+ import { OverviewPage } from './pages/Overview.js';
4
+ import { IntegrityPage } from './pages/Integrity.js';
5
+ import { QualityPage } from './pages/Quality.js';
6
+ import { KnowledgePage } from './pages/Knowledge.js';
7
+ import { ValuePage } from './pages/Value.js';
8
+ import { EfficiencyPage } from './pages/Efficiency.js';
9
+ import { ModeTabs, ScopeHeader } from './components/ScopeControls.js';
10
+ import { insightStyles } from './theme.js';
11
+ const routes = [
12
+ { href: '/', label: 'Overview' },
13
+ { href: '/integrity', label: 'Integrity' },
14
+ { href: '/quality', label: 'Quality' },
15
+ { href: '/knowledge', label: 'Knowledge' },
16
+ { href: '/efficiency', label: 'Efficiency' },
17
+ { href: '/value', label: 'Value' },
18
+ ];
19
+ export function renderInsightPage(pathname, snapshot) {
20
+ const active = pathname === '/' ? '/' : pathname;
21
+ const page = selectPage(active, snapshot);
22
+ return '<!doctype html>' + renderToStaticMarkup(_jsxs("html", { lang: "en", children: [_jsxs("head", { children: [_jsx("meta", { charSet: "utf-8" }), _jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }), _jsx("title", { children: "CodeLedger Insight" }), _jsx("style", { children: insightStyles })] }), _jsxs("body", { children: [_jsxs("div", { className: "shell", children: [_jsxs("header", { className: "header", children: [_jsxs("div", { children: [_jsx("p", { className: "kicker", children: "CodeLedger Insight" }), _jsx("h1", { className: "title", children: "Engineering work as a compounding asset" }), _jsx("p", { className: "subtitle", children: "Every metric is traceable to evidence. No manual logging." })] }), _jsxs("div", { className: "card snapshot-card", children: [_jsx("strong", { children: snapshot.eventCount }), _jsxs("span", { children: ["events \u00B7 ", snapshot.generatedAt.slice(0, 16).replace('T', ' ')] })] })] }), _jsx("nav", { className: "nav", children: routes.map((route) => (_jsx("a", { href: route.href, className: route.href === active ? 'active' : '', children: route.label }, route.href))) }), _jsx(WelcomeBanner, { welcomeState: snapshot.welcomeState }), _jsx(ModeTabs, { snapshot: snapshot, pathname: active }), _jsx(OnboardingHint, { snapshot: snapshot }), _jsx(ScopeHeader, { snapshot: snapshot, pathname: active }), page, _jsx("p", { className: "footer-note", children: "Aggregate signals only \u2014 no individual productivity tracking." })] }), _jsxs("aside", { className: "evidence-drawer", id: "evidence-drawer", children: [_jsx("button", { className: "drawer-close", id: "evidence-close", children: "Close" }), _jsx("div", { id: "evidence-content" })] }), _jsx("script", { dangerouslySetInnerHTML: { __html: drawerScript } })] })] }));
23
+ }
24
+ function selectPage(pathname, snapshot) {
25
+ switch (pathname) {
26
+ case '/integrity':
27
+ return _jsx(IntegrityPage, { snapshot: snapshot });
28
+ case '/quality':
29
+ return _jsx(QualityPage, { snapshot: snapshot });
30
+ case '/knowledge':
31
+ return _jsx(KnowledgePage, { snapshot: snapshot });
32
+ case '/value':
33
+ return _jsx(ValuePage, { snapshot: snapshot });
34
+ case '/efficiency':
35
+ return _jsx(EfficiencyPage, { snapshot: snapshot });
36
+ default:
37
+ return _jsx(OverviewPage, { snapshot: snapshot });
38
+ }
39
+ }
40
+ function WelcomeBanner({ welcomeState }) {
41
+ if (welcomeState === 'auto-seeded') {
42
+ return (_jsxs("div", { className: "welcome-banner", children: [_jsx("strong", { children: "Welcome to CodeLedger Insight" }), _jsx("p", { children: "This is a simulated scenario to illustrate how insights evolve. Real signals will appear as your team uses CodeLedger." })] }));
43
+ }
44
+ return null;
45
+ }
46
+ function OnboardingHint({ snapshot }) {
47
+ const hasReal = snapshot.welcomeState === 'has-real-data';
48
+ if (hasReal)
49
+ return null;
50
+ return (_jsxs("div", { className: "onboarding-hint", children: [_jsxs("div", { className: "onboarding-columns", children: [_jsxs("div", { className: "onboarding-col", children: [_jsx("strong", { children: "Your Team" }), " shows live signals from real CodeLedger usage.", snapshot.welcomeState === 'auto-seeded' && (_jsx("span", { className: "onboarding-note", children: " No events yet \u2014 start using CodeLedger to see data here." }))] }), _jsxs("div", { className: "onboarding-col", children: [_jsx("strong", { children: "What This Becomes" }), " shows how insights compound over time using scenario-backed projections.", _jsx("span", { className: "onboarding-note", children: " Explore this tab to see what your dashboard will look like." })] })] }), snapshot.welcomeState === 'auto-seeded' && (_jsxs("div", { className: "onboarding-steps", children: [_jsx("p", { children: "To start seeing real signals:" }), _jsxs("ol", { children: [_jsxs("li", { children: ["Run CodeLedger in your repo (", _jsx("code", { children: "codeledger bundle" }), ", ", _jsx("code", { children: "codeledger verify" }), ")"] }), _jsx("li", { children: "Execute typical development workflows" }), _jsx("li", { children: "Metrics appear automatically \u2014 no manual logging required" })] })] }))] }));
51
+ }
52
+ const drawerScript = `
53
+ const drawer = document.getElementById('evidence-drawer');
54
+ const content = document.getElementById('evidence-content');
55
+ document.getElementById('evidence-close')?.addEventListener('click', () => drawer?.classList.remove('open'));
56
+ document.addEventListener('click', async (event) => {
57
+ const target = event.target;
58
+ if (!(target instanceof HTMLElement)) return;
59
+ const metric = target.getAttribute('data-metric');
60
+ if (!metric) return;
61
+
62
+ // Carry forward the current page's view/scenario/scope filters
63
+ const pageParams = new URLSearchParams(window.location.search);
64
+ const evidenceParams = new URLSearchParams();
65
+ evidenceParams.set('metric', metric);
66
+ for (const key of ['view', 'scenario', 'repo', 'team', 'scopeType', 'scopeId', 'dateFrom', 'dateTo']) {
67
+ if (pageParams.has(key)) evidenceParams.set(key, pageParams.get(key));
68
+ }
69
+
70
+ const response = await fetch('/api/evidence?' + evidenceParams.toString());
71
+ const payload = await response.json();
72
+ const events = (payload.events ?? []).slice(0, 12);
73
+
74
+ if (events.length === 0) {
75
+ content.innerHTML = '<h2>' + metric + '</h2>'
76
+ + '<p>' + (payload.explanation ?? '') + '</p>'
77
+ + '<div class="empty-evidence">'
78
+ + '<p><strong>No evidence events yet.</strong></p>'
79
+ + '<p>Events will appear here as your team runs CodeLedger commands that produce ' + metric + ' signals.</p>'
80
+ + '</div>';
81
+ drawer?.classList.add('open');
82
+ return;
83
+ }
84
+
85
+ const rows = events.map((entry) => {
86
+ const impact = entry.impact ? '<p class="impact">' + entry.impact + '</p>' : '';
87
+ const source = entry.sourceLabel ? '<span class="source-label">' + entry.sourceLabel + '</span>' : '';
88
+ const detail = entry.command ?? entry.path ?? entry.repo ?? '';
89
+
90
+ // Prompt refinement events get a richer summary
91
+ if (entry.type === 'PROMPT_REFINEMENT') {
92
+ const orig = entry.originalTask ? '<p class="evidence-task"><strong>Task:</strong> ' + entry.originalTask + '</p>' : '';
93
+ const refined = entry.refinedTask && entry.refinedTask !== entry.originalTask
94
+ ? '<p class="evidence-task"><strong>Refined:</strong> ' + entry.refinedTask + '</p>' : '';
95
+ const ctx = entry.contextReductionPct > 0 ? '<p class="evidence-context">Context reduced ' + entry.contextReductionPct + '% (' + entry.scopeUsed + '/' + entry.scopeConsidered + ' files used)</p>' : '';
96
+ return '<div class="row evidence-rich">' + orig + refined + ctx + impact + source + '</div>';
97
+ }
98
+
99
+ return '<div class="row"><div><strong>' + entry.type + '</strong><div>' + entry.timestamp + '</div>' + impact + '</div><div>' + detail + ' ' + source + '</div></div>';
100
+ }).join('');
101
+ content.innerHTML = '<h2>' + metric + '</h2><p>' + (payload.explanation ?? '') + '</p>' + rows;
102
+ drawer?.classList.add('open');
103
+ });
104
+ `;
105
+ //# sourceMappingURL=render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.tsx"],"names":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C,YAAY,KAAK,aAAa,IAAI,CAC1C,eAAM,SAAS,EAAC,iBAAiB,+EAAiE,CACnG,IACG,EACN,eAAK,SAAS,EAAC,gBAAgB,aAC7B,iDAAkC,+EAClC,eAAM,SAAS,EAAC,iBAAiB,6EAAoE,IACjG,IACF,EACL,QAAQ,CAAC,YAAY,KAAK,aAAa,IAAI,CAC1C,eAAK,SAAS,EAAC,kBAAkB,aAC/B,wDAAoC,EACpC,yBACE,0DAAiC,+CAA8B,QAAE,+CAA8B,SAAM,EACrG,iEAA8C,EAC9C,0FAAkE,IAC/D,IACD,CACP,IACG,CACP,CAAC;AACJ,CAAC;AAED,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDpB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const insightStyles = "\n:root {\n --bg: #f3efe6;\n --panel: #fffdf8;\n --ink: #1e2430;\n --muted: #596275;\n --line: #d7d0c3;\n --accent: #0b6e4f;\n --accent-soft: #dcefe8;\n --warn: #bc6c25;\n --risk: #a23b2a;\n --shadow: rgba(30, 36, 48, 0.08);\n}\n* { box-sizing: border-box; }\nbody {\n margin: 0;\n font-family: \"Iowan Old Style\", \"Palatino Linotype\", Georgia, serif;\n color: var(--ink);\n background:\n radial-gradient(circle at top left, rgba(11,110,79,0.08), transparent 35%),\n linear-gradient(180deg, #f6f1e8 0%, #f2eee5 100%);\n}\na { color: inherit; text-decoration: none; }\n.shell { max-width: 1280px; margin: 0 auto; padding: 32px 20px 48px; }\n.header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 24px; }\n.title { font-size: 40px; line-height: 1; margin: 0 0 8px; }\n.subtitle { margin: 0; color: var(--muted); max-width: 720px; }\n.nav { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 28px; }\n.nav a {\n padding: 10px 14px;\n border-radius: 999px;\n border: 1px solid var(--line);\n background: rgba(255,255,255,0.72);\n}\n.nav a.active { background: var(--ink); color: white; border-color: var(--ink); }\n.mode-tabs {\n display: flex;\n gap: 10px;\n flex-wrap: wrap;\n margin-bottom: 12px;\n}\n.mode-pill {\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding: 10px 14px;\n border-radius: 999px;\n border: 1px solid rgba(215, 208, 195, 0.9);\n background: rgba(255, 255, 255, 0.85);\n font-size: 14px;\n color: var(--ink);\n}\n.mode-pill small {\n font-size: 11px;\n letter-spacing: 0.02em;\n color: var(--muted);\n}\n.mode-pill.active {\n background: var(--accent-soft);\n border-color: var(--accent);\n color: var(--accent);\n}\n.scope-shell {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 20px;\n padding: 18px 20px;\n background: rgba(255, 255, 255, 0.85);\n border: 1px solid rgba(215, 208, 195, 0.9);\n border-radius: 16px;\n box-shadow: 0 6px 30px rgba(30, 36, 48, 0.06);\n margin-bottom: 20px;\n}\n.scope-title {\n font-size: 18px;\n margin: 0 0 6px;\n}\n.scope-actions {\n display: flex;\n flex-direction: column;\n gap: 12px;\n min-width: 280px;\n}\n.scope-selector {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.scope-selector-label {\n font-size: 11px;\n letter-spacing: 0.12em;\n text-transform: uppercase;\n color: var(--muted);\n}\n.scope-selector-row {\n display: flex;\n gap: 6px;\n flex-wrap: wrap;\n}\n.scope-pill {\n padding: 6px 12px;\n border-radius: 999px;\n border: 1px solid rgba(215, 208, 195, 0.9);\n background: rgba(255, 255, 255, 0.7);\n font-size: 13px;\n color: var(--ink);\n}\n.scope-pill.active {\n background: var(--ink);\n color: white;\n border-color: var(--ink);\n}\n.comparison-panel {\n border-radius: 16px;\n background: var(--panel);\n}\n.comparison-grid {\n display: grid;\n gap: 12px;\n grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));\n}\n.comparison-card {\n border-radius: 12px;\n border: 1px solid rgba(215, 208, 195, 0.85);\n padding: 12px;\n background: white;\n box-shadow: 0 8px 20px rgba(30, 36, 48, 0.04);\n}\n.comparison-card-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 6px;\n gap: 12px;\n}\n.comparison-direction {\n font-size: 11px;\n text-transform: uppercase;\n border-radius: 999px;\n padding: 2px 8px;\n border: 1px solid rgba(215, 208, 195, 0.7);\n}\n.comparison-direction.above {\n color: #0b6e4f;\n border-color: rgba(11, 110, 79, 0.6);\n}\n.comparison-direction.below {\n color: #a23b2a;\n border-color: rgba(162, 59, 42, 0.6);\n}\n.comparison-direction.flat {\n color: var(--muted);\n border-color: rgba(215, 208, 195, 0.7);\n}\n.comparison-value {\n font-size: 22px;\n font-weight: 700;\n margin-bottom: 6px;\n}\n.comparison-detail {\n margin: 0;\n font-size: 13px;\n color: var(--muted);\n min-height: 36px;\n}\n.comparison-confidence {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n font-size: 12px;\n border-radius: 999px;\n padding: 4px 10px;\n border: 1px solid rgba(215, 208, 195, 0.9);\n}\n.comparison-confidence.high { color: var(--accent); border-color: var(--accent); }\n.comparison-confidence.medium { color: var(--warn); border-color: var(--warn); }\n.comparison-confidence.low { color: var(--risk); border-color: var(--risk); }\n.pattern-panel {\n margin-top: 16px;\n}\n.scenario-banner {\n border-radius: 12px;\n border: 1px solid rgba(215, 208, 195, 0.85);\n padding: 8px 12px;\n background: rgba(255, 255, 255, 0.8);\n display: flex;\n flex-direction: column;\n gap: 4px;\n font-size: 12px;\n color: var(--muted);\n}\n.scenario-picker {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.scenario-picker-label {\n font-size: 11px;\n letter-spacing: 0.12em;\n text-transform: uppercase;\n color: var(--muted);\n}\n.scenario-picker-row {\n display: flex;\n gap: 6px;\n flex-wrap: wrap;\n}\n.scenario-pill {\n padding: 6px 10px;\n border-radius: 999px;\n border: 1px solid rgba(215, 208, 195, 0.9);\n background: rgba(255, 255, 255, 0.7);\n font-size: 12px;\n color: var(--ink);\n}\n.scenario-pill.active {\n background: var(--ink);\n color: white;\n border-color: var(--ink);\n}\n.scenario-banner strong {\n color: var(--ink);\n}\n.grid { display: grid; gap: 16px; }\n.cards { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }\n.two-col { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); align-items: start; }\n.insights-panel ul { list-style:none; margin:0; padding:0; }\n.insights-panel li { padding: 12px 0; border-bottom:1px solid rgba(215,208,195,0.8); }\n.insights-panel li:last-child { border-bottom:none; }\n.insight-severity { font-size:12px; padding:3px 8px; border-radius:12px; margin-left:6px; border:1px solid rgba(215,208,195,0.9); }\n.insight-severity.info { background:#f0f7f4; color:#0b6e4f; }\n.insight-severity.warn { background:#fff4eb; color:#a23b2a; }\n.insight-severity.critical { background:#ffe0df; color:#a23b2a; border-color:#a23b2a; }\n.insight-actions { display:flex; gap:12px; align-items:center; justify-content:space-between; font-size:12px; margin-top:4px; }\n.storyline { display:flex; flex-wrap:wrap; gap:16px; align-items:center; margin-bottom:12px; }\n.scope-context { font-size:13px; color:var(--muted); }\n.scope-view-mode { font-style: italic; }\n.page-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:20px; padding:20px; border-radius:20px; border:1px solid rgba(215,208,195,0.8); background:var(--panel); box-shadow:0 10px 30px var(--shadow); }\n.page-title { font-size:20px; font-weight:700; margin:0; }\n.page-subtitle { margin:8px 0; color:var(--muted); }\n.scope-context-bar { display:flex; flex-wrap:wrap; gap:12px; font-size:12px; color:var(--muted); }\n.scope-context-bar span { padding:4px 8px; border-radius:10px; border:1px solid rgba(215,208,195,0.8); background:rgba(255,255,255,0.7); }\n.page-trend-note { margin-top:8px; font-size:13px; color:var(--muted); }\n.header-badges { display:flex; flex-direction:column; gap:6px; }\n.trend-note { font-size:14px; color:var(--muted); margin-top:8px; }\n.story-panel { flex-direction:column; }\n.story-panel .value-scope { margin-top:12px; display:flex; flex-wrap:wrap; gap:12px; font-size:13px; color:var(--muted); }\n.value-trend-note { font-size:13px; color:var(--muted); margin-top:8px; }\n.card, .panel {\n background: var(--panel);\n border: 1px solid rgba(215, 208, 195, 0.9);\n border-radius: 20px;\n padding: 18px;\n box-shadow: 0 14px 40px var(--shadow);\n}\n.metric-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px; margin-bottom:20px; }\n.metric-card { border-radius:18px; border:1px solid rgba(215,208,195,0.8); background:var(--panel); padding:18px; display:flex; flex-direction:column; gap:12px; box-shadow:0 10px 30px var(--shadow); }\n.metric-card header { display:flex; justify-content:space-between; align-items:center; }\n.metric-label { font-size:12px; letter-spacing:0.2em; text-transform:uppercase; color:var(--muted); }\n.metric-display strong { font-size:28px; }\n.metric-display span { font-size:13px; color:var(--muted); }\n.metric-severity { font-size:11px; padding:4px 10px; border-radius:999px; border:1px solid rgba(215,208,195,0.8); text-transform:uppercase; }\n.metric-severity.high { color:#a23b2a; border-color:#a23b2a; background:rgba(162,59,42,0.12); }\n.metric-severity.medium { color:#bc6c25; border-color:#bc6c25; background:rgba(188,108,37,0.12); }\n.metric-severity.low { color:#0b6e4f; border-color:#0b6e4f; background:rgba(11,110,79,0.12); }\n.value-hero { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; padding:20px; border-radius:20px; border:1px solid rgba(215,208,195,0.8); background:var(--panel); box-shadow:0 14px 36px var(--shadow); margin-bottom:20px; }\n.value-title { font-size:36px; margin:8px 0; }\n.action-callout { border-radius:18px; border:1px solid rgba(215,208,195,0.8); padding:20px; background:var(--panel); box-shadow:0 10px 30px var(--shadow); margin-bottom:20px; }\n.callout-grid { display:grid; gap:12px; margin-top:12px; }\n.callout-title { display:flex; justify-content:space-between; align-items:center; gap:8px; }\n.value-breakdown, .pattern-list, .hotspot-list { margin-bottom:20px; }\n.value-breakdown-row span { font-size:13px; color:var(--muted); }\n.value-breakdown .row strong, .pattern-list article strong { font-size:16px; }\n.value-formula {\n border-radius: 18px;\n border: 1px solid rgba(215, 208, 195, 0.8);\n padding: 20px;\n background: var(--panel);\n box-shadow: 0 10px 30px var(--shadow);\n margin: 16px 0;\n}\n.formula-metrics {\n display: flex;\n gap: 10px;\n flex-wrap: wrap;\n margin-top: 12px;\n}\n.formula-metrics article {\n padding: 10px 12px;\n border-radius: 12px;\n border: 1px solid rgba(215, 208, 195, 0.7);\n background: rgba(255, 255, 255, 0.85);\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 140px;\n font-size: 12px;\n}\n.confidence-note { margin-top: 12px; font-size: 13px; color: var(--muted); }\n.insight-strip { margin:20px 0; }\n.insight-strip-panel { margin:0; }\n.hotspot-list { border-radius:18px; border:1px solid rgba(215,208,195,0.8); padding:20px; background:var(--panel); box-shadow:0 10px 30px var(--shadow); }\n.hotspot-items, .pattern-items { display:grid; gap:12px; margin-top:16px; }\n.hotspot-items article, .pattern-items article { border-radius:16px; border:1px solid rgba(215,208,195,0.8); padding:12px; background:#fff; }\n.hotspot-metrics { display:flex; gap:12px; font-size:12px; color:var(--muted); }\n.synthetic-pill { padding:4px 10px; border-radius:999px; border:1px solid rgba(215,208,195,0.8); background:#fff; font-size:12px; }\n.value-hero { display:flex; flex-direction:column; gap:8px; }\n.value-scope { margin-top:12px; display:flex; flex-wrap:wrap; gap:12px; font-size:13px; color:var(--muted); }\n.value-scope span { display:inline-flex; gap:6px; padding:4px 8px; border-radius:12px; border:1px solid rgba(215,208,195,0.8); background:rgba(255,255,255,0.5); }\n.confidence-badge { border-radius:999px; padding:4px 12px; font-size:12px; display:inline-flex; align-items:center; gap:6px; border:1px solid rgba(215,208,195,0.8); }\n.confidence-badge.high { background:var(--accent); color:#fff; border-color:var(--accent); }\n.confidence-badge.medium { background:var(--warn); color:#fff; border-color:var(--warn); }\n.confidence-badge.low { background:#fff4eb; color:#a23b2a; border-color:#a23b2a; }\n.value-breakdown .row strong, .value-assumptions .row strong { font-size:16px; }\n.kicker { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }\n.metric { font-size: 34px; font-weight: 700; margin: 0; }\n.metric small { font-size: 14px; color: var(--muted); }\n.section-title { font-size: 24px; margin: 0 0 16px; }\n.knowledge-summary { margin-bottom:12px; font-size:14px; color:var(--muted); display:flex; flex-direction:column; gap:4px; }\n.list { display: grid; gap: 10px; }\n.hotspot-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap:12px; margin-top:12px; }\n.hotspot-card, .shadow-card { border-radius:16px; padding:12px; border:1px solid rgba(215,208,195,0.8); display:flex; flex-direction:column; gap:8px; background:#fff; box-shadow:0 10px 30px rgba(30,36,48,0.05); }\n.hotspot-header { display:flex; justify-content:space-between; align-items:center; }\n.hotspot-body { display:flex; justify-content:space-between; gap:12px; }\n.hotspot-body span { font-size:12px; color:var(--muted); }\n.hotspot-note { margin:0; font-size:12px; color:var(--muted); }\n.trend-indicator { font-size:12px; text-transform:capitalize; border-radius:999px; padding:4px 10px; border:1px solid rgba(215,208,195,0.8); }\n.trend-indicator.up { color:#0b6e4f; border-color:#0b6e4f; background:rgba(11,110,79,0.12); }\n.trend-indicator.down { color:#a23b2a; border-color:#a23b2a; background:rgba(162,59,42,0.12); }\n.trend-indicator.flat { color:var(--muted); border-color:rgba(215,208,195,0.9); }\n.pattern-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap:12px; margin-top:12px; }\n.pattern-card { border-radius:16px; padding:12px; border:1px solid rgba(215,208,195,0.8); background:#fff; box-shadow:0 10px 24px rgba(30,36,48,0.05); }\n.pattern-meta { display:flex; flex-direction:column; font-size:12px; color:var(--muted); margin-top:6px; gap:2px; }\n.row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }\n.row:first-child { border-top: 0; padding-top: 0; }\n.value-breakdown .row div, .value-assumptions .row div { font-size: 13px; color: var(--muted); }\n.badge { display: inline-flex; padding: 4px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); }\n.badge.high { color: white; background: var(--risk); border-color: var(--risk); }\n.badge.medium { color: white; background: var(--warn); border-color: var(--warn); }\n.badge.low { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }\n.btn-link {\n border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-align: left;\n}\n.evidence-drawer {\n position: fixed; top: 0; right: 0; width: min(420px, 100vw); height: 100vh; background: var(--panel);\n border-left: 1px solid var(--line); box-shadow: -12px 0 40px var(--shadow); padding: 20px; overflow: auto; display: none;\n}\n.evidence-drawer.open { display: block; }\n.drawer-close { border: 0; background: var(--ink); color: white; border-radius: 999px; padding: 8px 12px; cursor: pointer; }\n.chart-wrap svg { overflow: visible; }\n.footer-note { color: var(--muted); font-size: 11px; margin-top: 32px; text-align: center; opacity: 0.6; }\n.impact { font-size: 12px; color: var(--muted); margin-top: 4px; }\n.empty-evidence { text-align: center; padding: 24px 0; color: var(--muted); }\n.empty-evidence strong { color: var(--ink); }\n.source-label { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: #ede9df; color: var(--muted); }\n.evidence-rich { padding: 12px 0; border-bottom: 1px solid var(--line); }\n.evidence-task { margin: 4px 0; font-size: 13px; line-height: 1.5; }\n.evidence-context { margin: 4px 0; font-size: 12px; color: var(--accent); }\n.system-health-card { text-align: center; padding: 24px 20px; }\n.health-headline { margin-bottom: 16px; }\n.health-score { font-size: 48px; display: block; line-height: 1; color: var(--accent); }\n.health-sentence { font-size: 15px; color: var(--muted); }\n.health-sub-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }\n.health-sub {\n display: flex; flex-direction: column; align-items: center; gap: 2px;\n text-decoration: none; color: inherit; border-radius: 8px; padding: 8px 4px;\n transition: background 0.15s;\n}\n.health-sub:hover { background: rgba(11,110,79,0.06); }\n.health-sub-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }\n.health-sub strong { font-size: 18px; }\n.severity-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }\n.severity-dot.green { background: var(--accent); }\n.severity-dot.amber { background: var(--warn); }\n.severity-dot.red { background: var(--risk); }\n.drivers-section { }\n.drivers-subtitle { margin: 0 0 12px; font-size: 13px; color: var(--muted); }\n.drivers-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }\n.driver-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }\n.driver-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }\n.driver-item strong { font-size: 22px; }\n.detail-section { margin-top: 16px; opacity: 0.85; }\n.detail-section .panel { padding: 14px 18px; }\n.detail-section .kicker { margin-bottom: 6px; }\n.snapshot-card { display: flex; flex-direction: column; align-items: center; gap: 2px; }\n.snapshot-card strong { font-size: 28px; }\n.snapshot-card span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }\n.efficiency-zero-state { text-align: center; padding: 24px; }\n.efficiency-zero-state .causal-chain {\n font-style: italic; color: var(--accent); font-size: 15px; margin-top: 12px;\n}\n.efficiency-strip-row {\n display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px;\n}\n.efficiency-strip-item {\n display: flex; flex-direction: column; align-items: center; gap: 4px;\n}\n.efficiency-strip-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }\n.efficiency-strip-item strong { font-size: 22px; }\n.trend-compact {\n display: flex; gap: 6px; align-items: flex-end; height: 70px; margin-top: 12px;\n}\n.trend-bar-group { display: flex; gap: 2px; align-items: flex-end; }\n.trend-bar { width: 8px; border-radius: 2px 2px 0 0; min-height: 2px; }\n.trend-bar-lift { background: var(--accent); }\n.trend-bar-quality { background: var(--warn); }\n.trend-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 12px; color: var(--muted); }\n.legend-item { display: flex; align-items: center; gap: 4px; }\n.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }\n.dot-lift { background: var(--accent); }\n.dot-quality { background: var(--warn); }\n.welcome-banner {\n background: linear-gradient(135deg, var(--accent-soft), #eef6f2);\n border: 1px solid var(--accent);\n border-radius: 12px;\n padding: 16px 20px;\n margin-bottom: 20px;\n}\n.welcome-banner strong { display: block; font-size: 16px; margin-bottom: 4px; color: var(--accent); }\n.welcome-banner p { margin: 0; color: var(--muted); font-size: 14px; }\n.onboarding-hint {\n background: var(--panel);\n border: 1px dashed var(--line);\n border-radius: 12px;\n padding: 16px 20px;\n margin-bottom: 20px;\n}\n.onboarding-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }\n.onboarding-col { font-size: 14px; line-height: 1.5; }\n.onboarding-note { color: var(--accent); font-style: italic; }\n.onboarding-steps { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }\n.onboarding-steps p { margin: 0 0 8px; font-size: 14px; font-weight: 600; }\n.onboarding-steps ol { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.7; }\n.onboarding-steps code { background: #ede9df; padding: 2px 6px; border-radius: 4px; font-size: 12px; }\n@media (max-width: 900px) {\n .two-col { grid-template-columns: 1fr; }\n .title { font-size: 30px; }\n .onboarding-columns { grid-template-columns: 1fr; }\n}\n";
2
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,q6mBAwbzB,CAAC"}