Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | 3x 3x 8x 7x 12x 3x 2x | import {
CreateDashboardBody,
CreateWidgetBody,
WidgetTarget,
} from "@/objects/Dashboard";
import { APP_ROUTES } from "@/routes/const";
/** A starting point for a new board.
*
* Templates exist because an empty grid is a bad first experience: the point
* of the feature is only obvious once a board has a live tile on it. Any
* template whose widgets invoke a model declares `needsTarget`, so the
* creator can resolve one of the user's own agents (or a chat model) before
* seeding — a dynamic widget without a target would be rejected.
*
* The platform's own views — agent fleet, governance, knowledge, usage and
* spend — are not templates: they are built-in boards every user already
* has (svc-core `system_resources/dashboards.py`), and copying one is how a
* user starts from them. A template here is a board only the user can want.
*/
export interface DashboardTemplate {
key: string;
name: string;
description: string;
icon: string;
accent: string;
/** True when `widgets` includes a tile that invokes a model or agent. */
needsTarget: boolean;
widgets: (target: WidgetTarget | null) => CreateWidgetBody[];
}
const PLATFORM_SHORTCUTS: CreateWidgetBody = {
widget_type: "shortcuts",
title: "Jump to",
w: 3,
h: 5,
config: {
links: [
{ label: "Agents", href: APP_ROUTES.USER.INFERENCE.agents, icon: "Bot" },
{ label: "Knowledge", href: APP_ROUTES.USER.knowledge, icon: "Library" },
{ label: "Activity", href: APP_ROUTES.USER.activity, icon: "Activity" },
{ label: "Stats", href: APP_ROUTES.USER.stats, icon: "BarChart3" },
],
},
};
export const TEMPLATES: DashboardTemplate[] = [
{
key: "blank",
name: "Blank board",
description: "Start from nothing and add exactly what you want.",
icon: "LayoutGrid",
accent: "slate",
needsTarget: false,
widgets: () => [],
},
{
// Not the built-in Daily briefing: that one is your platform activity,
// this one is the world's news, run on an agent of your own.
key: "briefing",
name: "Morning digest",
description:
"A news digest that refreshes every morning, the weather, a scratch note, quick links and a list for answers you save.",
icon: "Sunrise",
accent: "amber",
needsTarget: true,
widgets: (target) => [
...(target
? [
{
widget_type: "automation" as const,
title: "Today's briefing",
w: 6,
h: 7,
x: 0,
y: 0,
refresh_interval_seconds: 86400,
config: {
prompt:
"Summarise the most significant news of the last 24 hours " +
"in technology, AI policy and regulation. Give five items, " +
"each with one line on why it matters.",
style: "digest",
target,
},
},
]
: []),
{
widget_type: "weather",
title: "London",
w: 3,
h: 5,
x: 6,
y: 0,
refresh_interval_seconds: 3600,
config: {
latitude: 51.5072,
longitude: -0.1276,
location_name: "London",
units: "metric",
days: 5,
},
},
{
widget_type: "note",
title: "Today",
w: 3,
h: 2,
x: 6,
y: 5,
config: { markdown: "## Focus\n\n- ", accent: "amber" },
},
{ ...PLATFORM_SHORTCUTS, x: 9, y: 0 },
{
widget_type: "message_list",
title: "Saved answers",
w: 3,
h: 2,
x: 9,
y: 5,
config: { items: [], max_items: 25 },
},
],
},
{
key: "media",
name: "Media landscape",
description:
"Place news outlets on political alignment and factual reliability, refreshed weekly.",
icon: "Newspaper",
accent: "rose",
needsTarget: true,
widgets: (target) => [
...(target
? [
{
widget_type: "comparison" as const,
title: "UK outlets — alignment vs reliability",
w: 7,
h: 10,
x: 0,
y: 0,
refresh_interval_seconds: 604800,
config: {
subjects: [
"BBC News",
"The Guardian",
"The Times",
"The Telegraph",
"Daily Mail",
"Reuters",
],
axes: [
{
name: "Political alignment",
min: -1,
max: 1,
min_label: "Left",
max_label: "Right",
},
{
name: "Factual reliability",
min: 0,
max: 10,
min_label: "Low",
max_label: "High",
},
],
context:
"Judge UK national news coverage, using published media-bias " +
"and fact-checking assessments rather than a single rater.",
target,
},
},
]
: []),
{
widget_type: "rss",
title: "BBC News",
w: 5,
h: 6,
x: 7,
y: 0,
refresh_interval_seconds: 3600,
config: {
url: "https://feeds.bbci.co.uk/news/rss.xml",
limit: 6,
show_summaries: true,
},
},
{
widget_type: "chart",
title: "Sources your agents cite",
w: 5,
h: 4,
x: 7,
y: 6,
config: {
source: "web_search_domains",
metric: "avg_trust_score",
chart_type: "bar",
limit: 10,
},
},
{
widget_type: "note",
title: "How to read this",
w: 12,
h: 3,
x: 0,
y: 10,
config: {
markdown:
"The comparison is **AI generated** — a model's reading of " +
"published bias and fact-checking assessments, and a starting " +
"point for your own judgement rather than a verdict. The feed " +
"beside it is the publisher's own output, unaltered. Every tile " +
"is marked with where its content came from.",
accent: "rose",
},
},
],
},
];
export const buildTemplateBody = (
template: DashboardTemplate,
name: string,
target: WidgetTarget | null,
): CreateDashboardBody => ({
name,
description: template.key === "blank" ? null : template.description,
icon: template.icon,
accent: template.accent,
widgets: template.widgets(target),
});
|