@soffits/dsh-card-board 0.5.0 → 0.7.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.
- package/CHANGELOG.md +14 -0
- package/README.md +62 -12
- package/client.js +1349 -1047
- package/examples/boards/home/board.json +6 -0
- package/examples/boards/home/cards/chores.json +30 -4
- package/examples/boards/home/cards/countdown.json +57 -0
- package/examples/boards/home/cards/house.json +15 -5
- package/examples/boards/home/cards/savings.json +3 -1
- package/examples/boards/home/cards/summary.json +50 -0
- package/examples/boards/home/cards/weather.json +43 -5
- package/index.js +7 -1
- package/locale/en.json +9 -3
- package/locale/fr.json +9 -3
- package/locale/zh.json +9 -3
- package/package.json +9 -5
- package/src/routes.js +135 -19
- package/src/schema.js +127 -17
- package/src/seen.js +111 -0
- package/src/store.js +17 -3
- package/src/watch.js +113 -0
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
"label": {
|
|
14
14
|
"en": "done",
|
|
15
15
|
"zh": "已完成"
|
|
16
|
+
},
|
|
17
|
+
"sub": {
|
|
18
|
+
"en": "2 left today",
|
|
19
|
+
"zh": "今天还剩 2 件"
|
|
16
20
|
}
|
|
17
21
|
},
|
|
18
22
|
"rows": [
|
|
@@ -21,7 +25,9 @@
|
|
|
21
25
|
"en": "Water the plants",
|
|
22
26
|
"zh": "给植物浇水"
|
|
23
27
|
},
|
|
24
|
-
"checked": true
|
|
28
|
+
"checked": true,
|
|
29
|
+
"key": "chore-1",
|
|
30
|
+
"icon": "flower-2"
|
|
25
31
|
},
|
|
26
32
|
{
|
|
27
33
|
"title": {
|
|
@@ -37,6 +43,20 @@
|
|
|
37
43
|
"tone": "warn"
|
|
38
44
|
},
|
|
39
45
|
"actions": [
|
|
46
|
+
{
|
|
47
|
+
"kind": "step",
|
|
48
|
+
"id": "library-books:renew",
|
|
49
|
+
"label": {
|
|
50
|
+
"en": "Renew the books online",
|
|
51
|
+
"fr": "Renouveler les livres en ligne",
|
|
52
|
+
"zh": "在网上续借这些书"
|
|
53
|
+
},
|
|
54
|
+
"payload": {
|
|
55
|
+
"prompt": {
|
|
56
|
+
"en": "Renew the library books that are due on the library's website, then tell me the new due date."
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
40
60
|
{
|
|
41
61
|
"kind": "done",
|
|
42
62
|
"id": "library-books:done"
|
|
@@ -45,7 +65,9 @@
|
|
|
45
65
|
"kind": "snooze",
|
|
46
66
|
"id": "library-books:snooze"
|
|
47
67
|
}
|
|
48
|
-
]
|
|
68
|
+
],
|
|
69
|
+
"key": "chore-2",
|
|
70
|
+
"icon": "book-open"
|
|
49
71
|
},
|
|
50
72
|
{
|
|
51
73
|
"title": {
|
|
@@ -76,12 +98,16 @@
|
|
|
76
98
|
"prompt": "Help me write a short, polite follow-up to the landlord about the heater."
|
|
77
99
|
}
|
|
78
100
|
}
|
|
79
|
-
]
|
|
101
|
+
],
|
|
102
|
+
"key": "chore-3",
|
|
103
|
+
"icon": "trash-2"
|
|
80
104
|
}
|
|
81
105
|
],
|
|
82
106
|
"empty": {
|
|
83
107
|
"en": "Nothing left for today.",
|
|
84
108
|
"zh": "今天没有待办了。"
|
|
85
109
|
}
|
|
86
|
-
}
|
|
110
|
+
},
|
|
111
|
+
"icon": "list-todo",
|
|
112
|
+
"tone": "accent"
|
|
87
113
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "countdown",
|
|
3
|
+
"title": {
|
|
4
|
+
"en": "Trip to the coast",
|
|
5
|
+
"zh": "去海边"
|
|
6
|
+
},
|
|
7
|
+
"updatedAt": "2026-03-02T09:30:00Z",
|
|
8
|
+
"icon": "train-front",
|
|
9
|
+
"tone": "accent",
|
|
10
|
+
"data": {
|
|
11
|
+
"to": "2026-03-04T07:40:00+01:00",
|
|
12
|
+
"label": {
|
|
13
|
+
"en": "until the train leaves",
|
|
14
|
+
"zh": "距离火车出发"
|
|
15
|
+
},
|
|
16
|
+
"sub": {
|
|
17
|
+
"en": "3 h 10 m, one change",
|
|
18
|
+
"zh": "3 小时 10 分,换乘一次"
|
|
19
|
+
},
|
|
20
|
+
"steps": [
|
|
21
|
+
{
|
|
22
|
+
"at": "2026-03-04T07:15:00+01:00",
|
|
23
|
+
"label": {
|
|
24
|
+
"en": "At the station",
|
|
25
|
+
"zh": "到车站"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"at": "2026-03-04T07:40:00+01:00",
|
|
30
|
+
"label": {
|
|
31
|
+
"en": "Train to Lyon",
|
|
32
|
+
"zh": "去里昂的火车"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"at": "2026-03-04T09:20:00+01:00",
|
|
37
|
+
"label": {
|
|
38
|
+
"en": "Change in Lyon",
|
|
39
|
+
"zh": "里昂换乘"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"at": "2026-03-04T10:50:00+01:00",
|
|
44
|
+
"label": {
|
|
45
|
+
"en": "Arrive in Marseille",
|
|
46
|
+
"zh": "到马赛"
|
|
47
|
+
},
|
|
48
|
+
"sub": {
|
|
49
|
+
"en": "14° and sunny",
|
|
50
|
+
"zh": "14°,晴"
|
|
51
|
+
},
|
|
52
|
+
"zone": "Europe/Paris"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"expiresAt": "2026-03-04T10:50:00+01:00"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
"en": "dry",
|
|
18
18
|
"zh": "干燥"
|
|
19
19
|
},
|
|
20
|
-
"tone": "ok"
|
|
20
|
+
"tone": "ok",
|
|
21
|
+
"key": "house-1",
|
|
22
|
+
"icon": "droplets"
|
|
21
23
|
},
|
|
22
24
|
{
|
|
23
25
|
"label": {
|
|
@@ -35,7 +37,9 @@
|
|
|
35
37
|
20.6,
|
|
36
38
|
20.3,
|
|
37
39
|
20.5
|
|
38
|
-
]
|
|
40
|
+
],
|
|
41
|
+
"key": "house-2",
|
|
42
|
+
"icon": "thermometer"
|
|
39
43
|
},
|
|
40
44
|
{
|
|
41
45
|
"label": {
|
|
@@ -60,7 +64,9 @@
|
|
|
60
64
|
"zh": "上锁"
|
|
61
65
|
}
|
|
62
66
|
}
|
|
63
|
-
]
|
|
67
|
+
],
|
|
68
|
+
"key": "house-3",
|
|
69
|
+
"icon": "lock"
|
|
64
70
|
},
|
|
65
71
|
{
|
|
66
72
|
"label": {
|
|
@@ -71,7 +77,9 @@
|
|
|
71
77
|
"en": "offline",
|
|
72
78
|
"zh": "离线"
|
|
73
79
|
},
|
|
74
|
-
"tone": "bad"
|
|
80
|
+
"tone": "bad",
|
|
81
|
+
"key": "house-4",
|
|
82
|
+
"icon": "plug"
|
|
75
83
|
}
|
|
76
84
|
]
|
|
77
85
|
},
|
|
@@ -87,5 +95,7 @@
|
|
|
87
95
|
"url": "https://example.com/home-panel"
|
|
88
96
|
}
|
|
89
97
|
}
|
|
90
|
-
]
|
|
98
|
+
],
|
|
99
|
+
"icon": "house",
|
|
100
|
+
"tone": "ok"
|
|
91
101
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "summary",
|
|
3
|
+
"title": {
|
|
4
|
+
"en": "Summary",
|
|
5
|
+
"zh": "概览"
|
|
6
|
+
},
|
|
7
|
+
"updatedAt": "2026-03-02T09:30:00Z",
|
|
8
|
+
"staleAfter": 7200,
|
|
9
|
+
"data": {
|
|
10
|
+
"text": {
|
|
11
|
+
"en": "A quiet day: the library books are due, and the train leaves the day after tomorrow.",
|
|
12
|
+
"zh": "今天比较轻松:图书馆的书今天到期,后天坐火车。"
|
|
13
|
+
},
|
|
14
|
+
"chips": [
|
|
15
|
+
{
|
|
16
|
+
"icon": "train-front",
|
|
17
|
+
"text": {
|
|
18
|
+
"en": "Train",
|
|
19
|
+
"zh": "火车"
|
|
20
|
+
},
|
|
21
|
+
"tone": "accent",
|
|
22
|
+
"to": "2026-03-04T07:40:00+01:00"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"icon": "book-open",
|
|
26
|
+
"text": {
|
|
27
|
+
"en": "Books due today",
|
|
28
|
+
"zh": "书今天到期"
|
|
29
|
+
},
|
|
30
|
+
"tone": "warn"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"icon": "cloud-sun",
|
|
34
|
+
"text": {
|
|
35
|
+
"en": "6° and bright",
|
|
36
|
+
"zh": "6°,晴间多云"
|
|
37
|
+
},
|
|
38
|
+
"tone": "warn"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"icon": "circle-check",
|
|
42
|
+
"text": {
|
|
43
|
+
"en": "1 of 3 done",
|
|
44
|
+
"zh": "完成 1/3"
|
|
45
|
+
},
|
|
46
|
+
"tone": "ok"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -16,14 +16,50 @@
|
|
|
16
16
|
"value": 4.5,
|
|
17
17
|
"unit": "°C",
|
|
18
18
|
"delta": {
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
"text": {
|
|
20
|
+
"en": "2.1° colder than yesterday",
|
|
21
|
+
"zh": "比昨天冷 2.1°"
|
|
22
|
+
},
|
|
23
|
+
"tone": "accent",
|
|
24
|
+
"dir": "down"
|
|
22
25
|
},
|
|
23
26
|
"sub": {
|
|
24
27
|
"en": "feels like 1 °C",
|
|
25
28
|
"zh": "体感 1 °C"
|
|
26
|
-
}
|
|
29
|
+
},
|
|
30
|
+
"strip": [
|
|
31
|
+
{
|
|
32
|
+
"label": "10",
|
|
33
|
+
"value": 4.8,
|
|
34
|
+
"icon": "cloud-sun"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"label": "11",
|
|
38
|
+
"value": 5.6,
|
|
39
|
+
"icon": "sun"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"label": "12",
|
|
43
|
+
"value": 6.2,
|
|
44
|
+
"icon": "sun",
|
|
45
|
+
"on": true
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"label": "13",
|
|
49
|
+
"value": 5.9,
|
|
50
|
+
"icon": "cloud-sun"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"label": "14",
|
|
54
|
+
"value": 5.1,
|
|
55
|
+
"icon": "cloud"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"label": "15",
|
|
59
|
+
"value": 4.3,
|
|
60
|
+
"icon": "cloud-drizzle"
|
|
61
|
+
}
|
|
62
|
+
]
|
|
27
63
|
},
|
|
28
64
|
{
|
|
29
65
|
"label": {
|
|
@@ -34,5 +70,7 @@
|
|
|
34
70
|
"unit": "%"
|
|
35
71
|
}
|
|
36
72
|
]
|
|
37
|
-
}
|
|
73
|
+
},
|
|
74
|
+
"icon": "cloud-sun",
|
|
75
|
+
"tone": "warn"
|
|
38
76
|
}
|
package/index.js
CHANGED
|
@@ -15,6 +15,8 @@ import { createPeople, expandHome } from './src/access.js'
|
|
|
15
15
|
import { createMessages } from './src/messages.js'
|
|
16
16
|
import { createPresses } from './src/presses.js'
|
|
17
17
|
import { createRoutes } from './src/routes.js'
|
|
18
|
+
import { createSeenStore } from './src/seen.js'
|
|
19
|
+
import { createWatches } from './src/watch.js'
|
|
18
20
|
|
|
19
21
|
export const name = 'dsh-card-board'
|
|
20
22
|
export const inject = ['connection']
|
|
@@ -34,7 +36,7 @@ export const Config = z.object({
|
|
|
34
36
|
peopleKey: z.string().default('')
|
|
35
37
|
.description('The top-level key in peopleFile that holds the mapping. Empty means the whole file is the mapping.'),
|
|
36
38
|
pollSeconds: z.natural().min(5).max(3600).default(30)
|
|
37
|
-
.description('How often an open, visible page checks for changes.'),
|
|
39
|
+
.description('How often an open, visible page checks for changes while its live connection is down.'),
|
|
38
40
|
actionLog: z.string().default('')
|
|
39
41
|
.description('Where presses of done, snooze and event actions are appended (JSON lines). Empty means .actions.jsonl in dataDir.'),
|
|
40
42
|
actionTimeoutSeconds: z.natural().min(10).default(300)
|
|
@@ -65,12 +67,16 @@ export function apply(ctx, config) {
|
|
|
65
67
|
timeoutSeconds: config.actionTimeoutSeconds ?? 300,
|
|
66
68
|
warn: message => logger.warn(message),
|
|
67
69
|
})
|
|
70
|
+
const watches = createWatches()
|
|
71
|
+
ctx.on('dispose', () => watches.close())
|
|
68
72
|
const routes = createRoutes({
|
|
69
73
|
dataDir,
|
|
70
74
|
people,
|
|
71
75
|
identity: () => ctx.get('requestIdentity'),
|
|
72
76
|
pollSeconds: config.pollSeconds ?? 30,
|
|
73
77
|
presses,
|
|
78
|
+
seen: createSeenStore(join(dataDir, '.seen')),
|
|
79
|
+
watches,
|
|
74
80
|
messages: createMessages(fileURLToPath(new URL('./locale', import.meta.url))),
|
|
75
81
|
version,
|
|
76
82
|
})
|
package/locale/en.json
CHANGED
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
"ui": {
|
|
7
7
|
"panel": "Boards",
|
|
8
8
|
"title": "Boards",
|
|
9
|
-
"updated": "Updated {time}",
|
|
10
|
-
"refreshFailed": "Couldn’t refresh; trying again",
|
|
11
9
|
"loading": "Loading…",
|
|
12
10
|
"emptyTitle": "No boards yet.",
|
|
13
11
|
"emptyHint": "A board shows up here once a script writes its board.json into the data folder.",
|
|
@@ -28,6 +26,14 @@
|
|
|
28
26
|
"summary.latestName": "latest",
|
|
29
27
|
"summary.goal": "goal: {value}",
|
|
30
28
|
"summary.progress": "progress: {done}/{total}",
|
|
31
|
-
"action.chatNamed": "Ask {name}"
|
|
29
|
+
"action.chatNamed": "Ask {name}",
|
|
30
|
+
"now": "now",
|
|
31
|
+
"fromTime": "from {time}",
|
|
32
|
+
"ofTotal": "of {total}",
|
|
33
|
+
"dayLine": "{day} {part}",
|
|
34
|
+
"dayPart.morning": "morning",
|
|
35
|
+
"dayPart.afternoon": "afternoon",
|
|
36
|
+
"dayPart.evening": "evening",
|
|
37
|
+
"dayPart.night": "night"
|
|
32
38
|
}
|
|
33
39
|
}
|
package/locale/fr.json
CHANGED
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
"ui": {
|
|
7
7
|
"panel": "Tableaux",
|
|
8
8
|
"title": "Tableaux",
|
|
9
|
-
"updated": "Mis à jour {time}",
|
|
10
|
-
"refreshFailed": "Actualisation impossible, nouvelle tentative en cours",
|
|
11
9
|
"loading": "Chargement…",
|
|
12
10
|
"emptyTitle": "Aucun tableau pour l’instant.",
|
|
13
11
|
"emptyHint": "Un tableau apparaît ici dès qu’un script écrit son board.json dans le dossier de données.",
|
|
@@ -28,6 +26,14 @@
|
|
|
28
26
|
"summary.latestName": "dernière valeur",
|
|
29
27
|
"summary.goal": "objectif : {value}",
|
|
30
28
|
"summary.progress": "progression : {done}/{total}",
|
|
31
|
-
"action.chatNamed": "Demander à {name}"
|
|
29
|
+
"action.chatNamed": "Demander à {name}",
|
|
30
|
+
"now": "maintenant",
|
|
31
|
+
"fromTime": "à partir de {time}",
|
|
32
|
+
"ofTotal": "sur {total}",
|
|
33
|
+
"dayLine": "{day} {part}",
|
|
34
|
+
"dayPart.morning": "matin",
|
|
35
|
+
"dayPart.afternoon": "après-midi",
|
|
36
|
+
"dayPart.evening": "soir",
|
|
37
|
+
"dayPart.night": "nuit"
|
|
32
38
|
}
|
|
33
39
|
}
|
package/locale/zh.json
CHANGED
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
"ui": {
|
|
7
7
|
"panel": "面板",
|
|
8
8
|
"title": "面板",
|
|
9
|
-
"updated": "{time} 更新",
|
|
10
|
-
"refreshFailed": "刷新失败,稍后重试",
|
|
11
9
|
"loading": "加载中…",
|
|
12
10
|
"emptyTitle": "还没有面板。",
|
|
13
11
|
"emptyHint": "脚本把 board.json 写进数据目录后,面板就会出现在这里。",
|
|
@@ -28,6 +26,14 @@
|
|
|
28
26
|
"summary.latestName": "最新",
|
|
29
27
|
"summary.goal": "目标:{value}",
|
|
30
28
|
"summary.progress": "进度:{done}/{total}",
|
|
31
|
-
"action.chatNamed": "问问 {name}"
|
|
29
|
+
"action.chatNamed": "问问 {name}",
|
|
30
|
+
"now": "现在",
|
|
31
|
+
"fromTime": "{time} 起",
|
|
32
|
+
"ofTotal": "共 {total}",
|
|
33
|
+
"dayLine": "{day}{part}",
|
|
34
|
+
"dayPart.morning": "上午",
|
|
35
|
+
"dayPart.afternoon": "下午",
|
|
36
|
+
"dayPart.evening": "傍晚",
|
|
37
|
+
"dayPart.night": "夜里"
|
|
32
38
|
}
|
|
33
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soffits/dsh-card-board",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "A data-driven card board for DeepSeek Harness: scripts write small JSON cards, the Web UI shows each person the boards they may see.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"bin",
|
|
38
|
-
"src",
|
|
38
|
+
"src/*.js",
|
|
39
39
|
"client.js",
|
|
40
40
|
"index.js",
|
|
41
41
|
"cordis.patch.yml",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"@deepseek-ai/dsh-client-locale",
|
|
58
58
|
"@deepseek-ai/dsh-client-ui-layout",
|
|
59
59
|
"@deepseek-ai/dsh-client-ui-sidebar",
|
|
60
|
+
"@soffits/dsh-ui-kit",
|
|
60
61
|
"@soffits/dsh-ui-actions"
|
|
61
62
|
]
|
|
62
63
|
}
|
|
@@ -64,10 +65,11 @@
|
|
|
64
65
|
"icon": "./icon.svg",
|
|
65
66
|
"engines": {
|
|
66
67
|
"node": ">=22",
|
|
67
|
-
"dsh": ">=0.2.
|
|
68
|
+
"dsh": ">=0.2.2-rc.1 <0.3.0-0"
|
|
68
69
|
},
|
|
69
70
|
"scripts": {
|
|
70
|
-
"
|
|
71
|
+
"build": "node scripts/build.mjs",
|
|
72
|
+
"check": "node scripts/build.mjs --check && for f in index.js client.js bin/*.js src/*.js src/client/*.js test/*.js; do node --check \"$f\" || exit 1; done && node bin/dsh-card-board.js check --dir examples/boards",
|
|
71
73
|
"test": "node --test test/*.test.js"
|
|
72
74
|
},
|
|
73
75
|
"dependencies": {
|
|
@@ -78,6 +80,8 @@
|
|
|
78
80
|
"@deepseek-ai/dsh-client-connection": "0.2.2-rc.1",
|
|
79
81
|
"@deepseek-ai/dsh-credentials": "0.2.2-rc.1",
|
|
80
82
|
"@deepseek-ai/dsh-host-webserver": "0.2.2-rc.1",
|
|
81
|
-
"acorn": "^8.19.0"
|
|
83
|
+
"acorn": "^8.19.0",
|
|
84
|
+
"esbuild": "^0.28.2",
|
|
85
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.1"
|
|
82
86
|
}
|
|
83
87
|
}
|