@soffits/dsh-card-board 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,29 @@
1
1
  {
2
- "title": "Home",
3
- "viewers": ["alex", "sam"],
4
- "order": ["weather", "savings", "energy", "next-weeks", "spending", "chores", "house"],
2
+ "title": {
3
+ "en": "Home",
4
+ "zh": "家"
5
+ },
6
+ "viewers": [
7
+ "alex",
8
+ "sam"
9
+ ],
10
+ "order": [
11
+ "weather",
12
+ "savings",
13
+ "energy",
14
+ "next-weeks",
15
+ "spending",
16
+ "chores",
17
+ "house"
18
+ ],
5
19
  "layout": {
6
- "savings": { "w": 1, "h": 1 },
7
- "next-weeks": { "w": 2, "h": 1 }
20
+ "savings": {
21
+ "w": 1,
22
+ "h": 1
23
+ },
24
+ "next-weeks": {
25
+ "w": 2,
26
+ "h": 1
27
+ }
8
28
  }
9
29
  }
@@ -1,24 +1,39 @@
1
1
  {
2
2
  "type": "list",
3
- "title": "Today",
3
+ "title": {
4
+ "en": "Today",
5
+ "zh": "今天"
6
+ },
4
7
  "updatedAt": "2026-03-02T09:00:00Z",
5
8
  "staleAfter": 3600,
6
9
  "data": {
7
10
  "progress": {
8
11
  "done": 1,
9
12
  "total": 3,
10
- "label": "done"
13
+ "label": {
14
+ "en": "done",
15
+ "zh": "已完成"
16
+ }
11
17
  },
12
18
  "rows": [
13
19
  {
14
- "title": "Water the plants",
20
+ "title": {
21
+ "en": "Water the plants",
22
+ "zh": "给植物浇水"
23
+ },
15
24
  "checked": true
16
25
  },
17
26
  {
18
- "title": "Return the library books",
27
+ "title": {
28
+ "en": "Return the library books",
29
+ "zh": "还图书馆的书"
30
+ },
19
31
  "checked": false,
20
32
  "chip": {
21
- "text": "due today",
33
+ "text": {
34
+ "en": "due today",
35
+ "zh": "今天到期"
36
+ },
22
37
  "tone": "warn"
23
38
  },
24
39
  "actions": [
@@ -33,18 +48,30 @@
33
48
  ]
34
49
  },
35
50
  {
36
- "title": "Call the landlord about the heater",
37
- "sub": "waiting since Friday",
51
+ "title": {
52
+ "en": "Call the landlord about the heater",
53
+ "zh": "就暖气问题联系房东"
54
+ },
55
+ "sub": {
56
+ "en": "waiting since Friday",
57
+ "zh": "从周五起一直在等"
58
+ },
38
59
  "date": "2026-02-27",
39
60
  "chip": {
40
- "text": "chase",
61
+ "text": {
62
+ "en": "chase",
63
+ "zh": "去催一催"
64
+ },
41
65
  "tone": "bad"
42
66
  },
43
67
  "actions": [
44
68
  {
45
69
  "kind": "chat",
46
70
  "id": "landlord:ask",
47
- "label": "Draft a message",
71
+ "label": {
72
+ "en": "Draft a message",
73
+ "zh": "起草消息"
74
+ },
48
75
  "payload": {
49
76
  "prompt": "Help me write a short, polite follow-up to the landlord about the heater."
50
77
  }
@@ -52,6 +79,9 @@
52
79
  ]
53
80
  }
54
81
  ],
55
- "empty": "Nothing left for today."
82
+ "empty": {
83
+ "en": "Nothing left for today.",
84
+ "zh": "今天没有待办了。"
85
+ }
56
86
  }
57
87
  }
@@ -1,17 +1,62 @@
1
1
  {
2
2
  "type": "bar",
3
- "title": "Electricity this week",
3
+ "title": {
4
+ "en": "Electricity this week",
5
+ "zh": "本周用电"
6
+ },
4
7
  "updatedAt": "2026-03-02T08:00:00Z",
5
8
  "staleAfter": 7200,
6
9
  "data": {
7
10
  "bars": [
8
- { "x": "Mon", "values": { "Day": 5.2, "Night": 2.1 } },
9
- { "x": "Tue", "values": { "Day": 4.8, "Night": 2.4 } },
10
- { "x": "Wed", "values": { "Day": 6.1, "Night": 1.9 } },
11
- { "x": "Thu", "values": { "Day": 5.5, "Night": 2.2 } },
12
- { "x": "Fri", "values": { "Day": 4.2, "Night": 3.0 } },
13
- { "x": "Sat", "values": { "Day": 7.4, "Night": 2.6 } },
14
- { "x": "Sun", "values": { "Day": 6.8, "Night": 2.3 } }
11
+ {
12
+ "x": "Mon",
13
+ "values": {
14
+ "Day": 5.2,
15
+ "Night": 2.1
16
+ }
17
+ },
18
+ {
19
+ "x": "Tue",
20
+ "values": {
21
+ "Day": 4.8,
22
+ "Night": 2.4
23
+ }
24
+ },
25
+ {
26
+ "x": "Wed",
27
+ "values": {
28
+ "Day": 6.1,
29
+ "Night": 1.9
30
+ }
31
+ },
32
+ {
33
+ "x": "Thu",
34
+ "values": {
35
+ "Day": 5.5,
36
+ "Night": 2.2
37
+ }
38
+ },
39
+ {
40
+ "x": "Fri",
41
+ "values": {
42
+ "Day": 4.2,
43
+ "Night": 3.0
44
+ }
45
+ },
46
+ {
47
+ "x": "Sat",
48
+ "values": {
49
+ "Day": 7.4,
50
+ "Night": 2.6
51
+ }
52
+ },
53
+ {
54
+ "x": "Sun",
55
+ "values": {
56
+ "Day": 6.8,
57
+ "Night": 2.3
58
+ }
59
+ }
15
60
  ],
16
61
  "stacked": true,
17
62
  "unit": "kWh"
@@ -1,17 +1,29 @@
1
1
  {
2
2
  "type": "status",
3
- "title": "House",
3
+ "title": {
4
+ "en": "House",
5
+ "zh": "家"
6
+ },
4
7
  "updatedAt": "2026-03-02T09:29:00Z",
5
8
  "staleAfter": 600,
6
9
  "data": {
7
10
  "rows": [
8
11
  {
9
- "label": "Leak sensor",
10
- "value": "dry",
12
+ "label": {
13
+ "en": "Leak sensor",
14
+ "zh": "漏水传感器"
15
+ },
16
+ "value": {
17
+ "en": "dry",
18
+ "zh": "干燥"
19
+ },
11
20
  "tone": "ok"
12
21
  },
13
22
  {
14
- "label": "Living room",
23
+ "label": {
24
+ "en": "Living room",
25
+ "zh": "客厅"
26
+ },
15
27
  "value": "20.5 °C",
16
28
  "tone": "ok",
17
29
  "spark": [
@@ -26,21 +38,39 @@
26
38
  ]
27
39
  },
28
40
  {
29
- "label": "Front door",
30
- "value": "unlocked",
41
+ "label": {
42
+ "en": "Front door",
43
+ "zh": "前门"
44
+ },
45
+ "value": {
46
+ "en": "unlocked",
47
+ "zh": "未上锁"
48
+ },
31
49
  "tone": "warn",
32
- "sub": "since 08:12",
50
+ "sub": {
51
+ "en": "since 08:12",
52
+ "zh": "从 08:12 起"
53
+ },
33
54
  "actions": [
34
55
  {
35
56
  "kind": "event",
36
57
  "id": "front-door:lock",
37
- "label": "Lock"
58
+ "label": {
59
+ "en": "Lock",
60
+ "zh": "上锁"
61
+ }
38
62
  }
39
63
  ]
40
64
  },
41
65
  {
42
- "label": "Backup drive",
43
- "value": "offline",
66
+ "label": {
67
+ "en": "Backup drive",
68
+ "zh": "备份硬盘"
69
+ },
70
+ "value": {
71
+ "en": "offline",
72
+ "zh": "离线"
73
+ },
44
74
  "tone": "bad"
45
75
  }
46
76
  ]
@@ -49,7 +79,10 @@
49
79
  {
50
80
  "kind": "link",
51
81
  "id": "house:panel",
52
- "label": "Home panel",
82
+ "label": {
83
+ "en": "Home panel",
84
+ "zh": "家庭面板"
85
+ },
53
86
  "payload": {
54
87
  "url": "https://example.com/home-panel"
55
88
  }
@@ -1,16 +1,57 @@
1
1
  {
2
2
  "type": "timeline",
3
- "title": "Next two weeks",
3
+ "title": {
4
+ "en": "Next two weeks",
5
+ "zh": "未来两周"
6
+ },
4
7
  "updatedAt": "2026-03-02T06:00:00Z",
5
8
  "data": {
6
9
  "from": "2026-03-02",
7
10
  "to": "2026-03-16",
8
11
  "points": [
9
- { "date": "2026-03-04", "label": "Train to Lyon", "kind": "travel" },
10
- { "date": "2026-03-05", "label": "Phone bill", "kind": "due", "tone": "warn" },
11
- { "date": "2026-03-12", "label": "Dentist", "kind": "health" },
12
- { "date": "2026-03-14", "label": "Book club", "kind": "event" }
12
+ {
13
+ "date": "2026-03-04",
14
+ "label": {
15
+ "en": "Train to Lyon",
16
+ "zh": "乘火车去里昂"
17
+ },
18
+ "kind": "travel"
19
+ },
20
+ {
21
+ "date": "2026-03-05",
22
+ "label": {
23
+ "en": "Phone bill",
24
+ "zh": "电话账单"
25
+ },
26
+ "kind": "due",
27
+ "tone": "warn"
28
+ },
29
+ {
30
+ "date": "2026-03-12",
31
+ "label": {
32
+ "en": "Dentist",
33
+ "zh": "牙医"
34
+ },
35
+ "kind": "health"
36
+ },
37
+ {
38
+ "date": "2026-03-14",
39
+ "label": {
40
+ "en": "Book club",
41
+ "zh": "读书会"
42
+ },
43
+ "kind": "event"
44
+ }
13
45
  ],
14
- "spans": [{ "from": "2026-03-04", "to": "2026-03-09", "label": "In Lyon" }]
46
+ "spans": [
47
+ {
48
+ "from": "2026-03-04",
49
+ "to": "2026-03-09",
50
+ "label": {
51
+ "en": "In Lyon",
52
+ "zh": "在里昂"
53
+ }
54
+ }
55
+ ]
15
56
  }
16
57
  }
@@ -1,26 +1,79 @@
1
1
  {
2
2
  "type": "line",
3
- "title": "Savings",
3
+ "title": {
4
+ "en": "Savings",
5
+ "zh": "储蓄"
6
+ },
4
7
  "updatedAt": "2026-03-02T06:00:00Z",
5
8
  "staleAfter": 86400,
6
- "stat": { "items": [{ "label": "Total", "value": "18,240", "unit": "EUR", "sub": "up 2,140 since October" }] },
9
+ "stat": {
10
+ "items": [
11
+ {
12
+ "label": {
13
+ "en": "Total",
14
+ "zh": "总额"
15
+ },
16
+ "value": "18,240",
17
+ "unit": "EUR",
18
+ "sub": {
19
+ "en": "up 2,140 since October",
20
+ "zh": "比十月多了 2,140"
21
+ }
22
+ }
23
+ ]
24
+ },
7
25
  "data": {
8
26
  "series": [
9
27
  {
10
- "name": "Savings",
28
+ "name": {
29
+ "en": "Savings",
30
+ "zh": "储蓄"
31
+ },
11
32
  "points": [
12
- { "x": "2025-10-01", "y": 16100 },
13
- { "x": "2025-11-01", "y": 16650 },
14
- { "x": "2025-12-01", "y": 16300 },
15
- { "x": "2026-01-01", "y": 17200 },
16
- { "x": "2026-02-01", "y": 17750 },
17
- { "x": "2026-03-01", "y": 18240 }
33
+ {
34
+ "x": "2025-10-01",
35
+ "y": 16100
36
+ },
37
+ {
38
+ "x": "2025-11-01",
39
+ "y": 16650
40
+ },
41
+ {
42
+ "x": "2025-12-01",
43
+ "y": 16300
44
+ },
45
+ {
46
+ "x": "2026-01-01",
47
+ "y": 17200
48
+ },
49
+ {
50
+ "x": "2026-02-01",
51
+ "y": 17750
52
+ },
53
+ {
54
+ "x": "2026-03-01",
55
+ "y": 18240
56
+ }
18
57
  ]
19
58
  }
20
59
  ],
21
60
  "unit": "EUR",
22
61
  "area": true,
23
- "goal": { "label": "Goal 20k", "y": 20000 },
24
- "markers": [{ "x": "2025-12-01", "label": "New laptop" }]
62
+ "goal": {
63
+ "label": {
64
+ "en": "Goal 20k",
65
+ "zh": "目标 2 万"
66
+ },
67
+ "y": 20000
68
+ },
69
+ "markers": [
70
+ {
71
+ "x": "2025-12-01",
72
+ "label": {
73
+ "en": "New laptop",
74
+ "zh": "新笔记本"
75
+ }
76
+ }
77
+ ]
25
78
  }
26
79
  }
@@ -1,17 +1,54 @@
1
1
  {
2
2
  "type": "donut",
3
- "title": "Spending this month",
3
+ "title": {
4
+ "en": "Spending this month",
5
+ "zh": "本月支出"
6
+ },
4
7
  "updatedAt": "2026-03-02T06:00:00Z",
5
8
  "staleAfter": 86400,
6
9
  "data": {
7
10
  "segments": [
8
- { "label": "Rent", "value": 950 },
9
- { "label": "Groceries", "value": 310 },
10
- { "label": "Transport", "value": 85 },
11
- { "label": "Subscriptions", "value": 42 },
12
- { "label": "Other", "value": 64, "tone": "muted" }
11
+ {
12
+ "label": {
13
+ "en": "Rent",
14
+ "zh": "房租"
15
+ },
16
+ "value": 950
17
+ },
18
+ {
19
+ "label": {
20
+ "en": "Groceries",
21
+ "zh": "买菜"
22
+ },
23
+ "value": 310
24
+ },
25
+ {
26
+ "label": {
27
+ "en": "Transport",
28
+ "zh": "交通"
29
+ },
30
+ "value": 85
31
+ },
32
+ {
33
+ "label": {
34
+ "en": "Subscriptions",
35
+ "zh": "订阅"
36
+ },
37
+ "value": 42
38
+ },
39
+ {
40
+ "label": {
41
+ "en": "Other",
42
+ "zh": "其他"
43
+ },
44
+ "value": 64,
45
+ "tone": "muted"
46
+ }
13
47
  ],
14
- "centre": { "text": "1,451", "sub": "EUR" },
48
+ "centre": {
49
+ "text": "1,451",
50
+ "sub": "EUR"
51
+ },
15
52
  "unit": "EUR"
16
53
  }
17
54
  }
@@ -1,12 +1,38 @@
1
1
  {
2
2
  "type": "stat",
3
- "title": "Outside",
3
+ "title": {
4
+ "en": "Outside",
5
+ "zh": "室外"
6
+ },
4
7
  "updatedAt": "2026-03-02T09:30:00Z",
5
8
  "staleAfter": 3600,
6
9
  "data": {
7
10
  "items": [
8
- { "label": "Temperature", "value": 4.5, "unit": "°C", "delta": { "value": -2.1, "unit": "°C", "tone": "accent" }, "sub": "feels like 1 °C" },
9
- { "label": "Humidity", "value": 71, "unit": "%" }
11
+ {
12
+ "label": {
13
+ "en": "Temperature",
14
+ "zh": "温度"
15
+ },
16
+ "value": 4.5,
17
+ "unit": "°C",
18
+ "delta": {
19
+ "value": -2.1,
20
+ "unit": "°C",
21
+ "tone": "accent"
22
+ },
23
+ "sub": {
24
+ "en": "feels like 1 °C",
25
+ "zh": "体感 1 °C"
26
+ }
27
+ },
28
+ {
29
+ "label": {
30
+ "en": "Humidity",
31
+ "zh": "湿度"
32
+ },
33
+ "value": 71,
34
+ "unit": "%"
35
+ }
10
36
  ]
11
37
  }
12
38
  }
package/index.js CHANGED
@@ -9,8 +9,10 @@
9
9
  import { readFileSync } from 'node:fs'
10
10
  import { homedir } from 'node:os'
11
11
  import { isAbsolute, join, resolve } from 'node:path'
12
+ import { fileURLToPath } from 'node:url'
12
13
  import z from '@deepseek-ai/schemastery'
13
14
  import { createPeople, expandHome } from './src/access.js'
15
+ import { createMessages } from './src/messages.js'
14
16
  import { createPresses } from './src/presses.js'
15
17
  import { createRoutes } from './src/routes.js'
16
18
 
@@ -69,6 +71,7 @@ export function apply(ctx, config) {
69
71
  identity: () => ctx.get('requestIdentity'),
70
72
  pollSeconds: config.pollSeconds ?? 30,
71
73
  presses,
74
+ messages: createMessages(fileURLToPath(new URL('./locale', import.meta.url))),
72
75
  version,
73
76
  })
74
77
  for (const route of routes) ctx.connection.fetch.register(route)
package/locale/en.json CHANGED
@@ -1 +1,50 @@
1
- { "meta": { "title": "Card Board", "description": "Boards of small cards and charts that your own scripts keep up to date. Each person sees only the boards they're allowed to." } }
1
+ {
2
+ "meta": {
3
+ "title": "Card Board",
4
+ "description": "Boards of small cards and charts that your own scripts keep up to date. Each person sees only the boards they're allowed to."
5
+ },
6
+ "ui": {
7
+ "panel": "Boards",
8
+ "title": "Boards",
9
+ "updated": "Updated {time}",
10
+ "refreshFailed": "Couldn’t refresh; trying again",
11
+ "loading": "Loading…",
12
+ "emptyTitle": "No boards yet.",
13
+ "emptyHint": "A board shows up here once a script writes its board.json into the data folder.",
14
+ "noCards": "This board has no cards yet.",
15
+ "cardError": "This card can’t be shown",
16
+ "boardProblems": "board.json has problems:",
17
+ "stale": "stale · {age}",
18
+ "open": "Open",
19
+ "listEmpty": "Nothing here.",
20
+ "checked": "Done",
21
+ "unchecked": "Not done",
22
+ "error.forbidden": "You can’t see this board.",
23
+ "error.notFound": "This board isn’t there any more.",
24
+ "error.gone": "This action isn’t on the card any more.",
25
+ "error.noProvider": "Boards need a sign-in plugin that says who is asking, and none is running.",
26
+ "error.http": "Something went wrong (HTTP {status}).",
27
+ "summary.latest": "{name}: {value} at {x} ({n} points from {from})",
28
+ "summary.latestName": "latest",
29
+ "summary.goal": "goal: {value}",
30
+ "summary.progress": "progress: {done}/{total}",
31
+ "action.chat": "Ask",
32
+ "action.chatAbout": "Chat about this",
33
+ "action.done": "Done",
34
+ "action.snooze": "Snooze",
35
+ "action.event": "Go",
36
+ "action.link": "Open",
37
+ "action.in3h": "In 3 hours",
38
+ "action.tomorrow": "Tomorrow 9:00",
39
+ "action.pick": "Pick a time…",
40
+ "action.set": "Snooze",
41
+ "action.cancel": "Cancel",
42
+ "action.sending": "Sending…",
43
+ "action.pending": "Waiting for it to be picked up",
44
+ "action.handled": "Done",
45
+ "action.unhandled": "Nothing picked this up yet",
46
+ "action.failed": "Didn’t go through: {message}",
47
+ "action.noWorkspace": "Open a conversation once first, then try again.",
48
+ "action.chatNamed": "Ask {name}"
49
+ }
50
+ }
package/locale/fr.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "meta": {
3
+ "title": "Tableau de cartes",
4
+ "description": "Des tableaux de petites cartes et de graphiques tenus à jour par vos propres scripts. Chaque personne ne voit que les tableaux auxquels elle a droit."
5
+ },
6
+ "ui": {
7
+ "panel": "Tableaux",
8
+ "title": "Tableaux",
9
+ "updated": "Mis à jour {time}",
10
+ "refreshFailed": "Actualisation impossible, nouvelle tentative en cours",
11
+ "loading": "Chargement…",
12
+ "emptyTitle": "Aucun tableau pour l’instant.",
13
+ "emptyHint": "Un tableau apparaît ici dès qu’un script écrit son board.json dans le dossier de données.",
14
+ "noCards": "Ce tableau n’a pas encore de cartes.",
15
+ "cardError": "Cette carte ne peut pas être affichée",
16
+ "boardProblems": "board.json contient des erreurs :",
17
+ "stale": "périmée · {age}",
18
+ "open": "Ouvrir",
19
+ "listEmpty": "Rien ici.",
20
+ "checked": "Fait",
21
+ "unchecked": "Pas fait",
22
+ "error.forbidden": "Vous n’avez pas accès à ce tableau.",
23
+ "error.notFound": "Ce tableau n’existe plus.",
24
+ "error.gone": "Cette action n’est plus sur la carte.",
25
+ "error.noProvider": "Les tableaux ont besoin d’un plugin de connexion qui indique qui consulte, et aucun n’est actif.",
26
+ "error.http": "Un problème est survenu (HTTP {status}).",
27
+ "summary.latest": "{name} : {value} à {x} ({n} points depuis {from})",
28
+ "summary.latestName": "dernière valeur",
29
+ "summary.goal": "objectif : {value}",
30
+ "summary.progress": "progression : {done}/{total}",
31
+ "action.chat": "Demander",
32
+ "action.chatAbout": "En discuter",
33
+ "action.done": "Fait",
34
+ "action.snooze": "Reporter",
35
+ "action.event": "Lancer",
36
+ "action.link": "Ouvrir",
37
+ "action.in3h": "Dans 3 heures",
38
+ "action.tomorrow": "Demain à 9 h",
39
+ "action.pick": "Choisir une heure…",
40
+ "action.set": "Reporter",
41
+ "action.cancel": "Annuler",
42
+ "action.sending": "Envoi…",
43
+ "action.pending": "En attente de prise en charge",
44
+ "action.handled": "Fait",
45
+ "action.unhandled": "Personne ne s’en est encore occupé",
46
+ "action.failed": "Échec : {message}",
47
+ "action.noWorkspace": "Ouvrez d’abord une conversation, puis réessayez.",
48
+ "action.chatNamed": "Demander à {name}"
49
+ }
50
+ }