@meri-imperiumi/signalk-passage-briefing 0.2.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.
Files changed (86) hide show
  1. package/.editorconfig +5 -0
  2. package/.github/workflows/publish.yml +34 -0
  3. package/.github/workflows/signalk-ci.yml +11 -0
  4. package/.github/workflows/test.yml +21 -0
  5. package/CHANGELOG.md +423 -0
  6. package/README.md +86 -0
  7. package/SPEC.md +488 -0
  8. package/bin/backfill-report.js +218 -0
  9. package/bin/backtest-cli.js +132 -0
  10. package/biome.json +6 -0
  11. package/doc/here-brief.png +0 -0
  12. package/package.json +48 -0
  13. package/plugin/backtest.js +742 -0
  14. package/plugin/brief-ext.js +173 -0
  15. package/plugin/bulletin-engine.js +746 -0
  16. package/plugin/bulletin-source.js +150 -0
  17. package/plugin/celestial-source.js +417 -0
  18. package/plugin/fetch-engine.js +717 -0
  19. package/plugin/history-backfill.js +540 -0
  20. package/plugin/index.js +1479 -0
  21. package/plugin/logbook-source.js +463 -0
  22. package/plugin/notes-publisher.js +228 -0
  23. package/plugin/notes-store.js +241 -0
  24. package/plugin/raster-convert.js +168 -0
  25. package/plugin/sails-configuration.js +111 -0
  26. package/plugin/spool-watcher.js +218 -0
  27. package/plugin/sqlite-db.js +378 -0
  28. package/plugin/state-machine.js +249 -0
  29. package/plugin/statustilesexamples.js +101 -0
  30. package/plugin/synoptic-map.json +45 -0
  31. package/plugin/synoptic-source.js +227 -0
  32. package/plugin/zone-source.js +339 -0
  33. package/public/app.js +18 -0
  34. package/public/brief-ext-model.js +64 -0
  35. package/public/brief-ext-widget.html +14 -0
  36. package/public/brief-ext-widget.js +294 -0
  37. package/public/components/backfill-controls.js +100 -0
  38. package/public/components/comfort-info.js +94 -0
  39. package/public/components/conditions-here.js +234 -0
  40. package/public/components/horizon-sparkline.js +77 -0
  41. package/public/components/models.mjs +372 -0
  42. package/public/components/passage-outlook.js +368 -0
  43. package/public/components/sk-api.js +146 -0
  44. package/public/components/sk-base-css.js +177 -0
  45. package/public/components/strategic-outlook.js +248 -0
  46. package/public/components/synoptic-chart.js +48 -0
  47. package/public/components/tactical-dashboard.js +172 -0
  48. package/public/css/visuals.css +292 -0
  49. package/public/gmdss-zones-min.json +287 -0
  50. package/public/icon.png +0 -0
  51. package/public/index.html +13 -0
  52. package/public/polar.mjs +303 -0
  53. package/public/route-sim.mjs +750 -0
  54. package/public/sereno-physics.mjs +592 -0
  55. package/public/tack-gybe.js +174 -0
  56. package/public/vendor/plotterext-bus/LICENSE +21 -0
  57. package/public/vendor/plotterext-bus/README.md +17 -0
  58. package/public/vendor/plotterext-bus/chunk-4W6N34SD.js +333 -0
  59. package/public/vendor/plotterext-bus/chunk-7XRFPDQL.js +263 -0
  60. package/public/vendor/plotterext-bus/chunk-RED55KML.js +117 -0
  61. package/public/vendor/plotterext-bus/extension.js +29 -0
  62. package/public/vendor/plotterext-bus/host.js +28 -0
  63. package/public/vendor/utif/LICENSE +21 -0
  64. package/public/vendor/utif/UTIF.js +1171 -0
  65. package/public/worker.js +35 -0
  66. package/status-tiles-examples.json +55 -0
  67. package/tests/backtest.test.js +461 -0
  68. package/tests/brief-ext.test.js +194 -0
  69. package/tests/bulletin-engine.test.js +361 -0
  70. package/tests/celestial-source.test.js +265 -0
  71. package/tests/fetch-engine.test.js +297 -0
  72. package/tests/history-backfill.test.js +341 -0
  73. package/tests/logbook-source.test.js +324 -0
  74. package/tests/notes-publisher.test.js +161 -0
  75. package/tests/notes-store.test.js +138 -0
  76. package/tests/openmeteo-mock.js +100 -0
  77. package/tests/plugin.test.js +1344 -0
  78. package/tests/route-sim.test.js +533 -0
  79. package/tests/sereno-physics.test.js +333 -0
  80. package/tests/sqlite-db.test.js +164 -0
  81. package/tests/state-machine.test.js +182 -0
  82. package/tests/statustilesexamples.test.js +86 -0
  83. package/tests/synoptic-source.test.js +195 -0
  84. package/tests/tack-gybe.test.js +211 -0
  85. package/tests/webapp.test.js +257 -0
  86. package/tests/zone-source.test.js +226 -0
@@ -0,0 +1,292 @@
1
+ /*
2
+ * Passage Briefing — design system tokens & base styles.
3
+ *
4
+ * Dark canvas in both modes ("no white mode"): day mode raises
5
+ * brightness and saturation to fight glare, night mode dims to
6
+ * protect rhodopsin. Host pages (or this app when standalone) set
7
+ * `data-mode="day" | "night"` on the root <html> element.
8
+ *
9
+ * @file css/visuals.css
10
+ */
11
+
12
+ :root {
13
+ /* Base canvas (constant) */
14
+ --bg-base: #080a0c;
15
+ --bg-panel: #111414;
16
+ --bg-panel-muted: #0a0c0c;
17
+
18
+ /* Comfort tiers (Sereno physics, SPEC §5.2) — night-lean defaults */
19
+ --comfort-champagne: #33616b;
20
+ --comfort-easy: #4a7555;
21
+ --comfort-coffee: #8a5318;
22
+ --comfort-rough: #a05218;
23
+ --comfort-sick: #8f3333;
24
+ --comfort-unknown: #333333;
25
+
26
+ --color-green: #4a7555;
27
+ --color-teal: #33616b;
28
+ --color-orange: #8a5318;
29
+ --color-red: #8f3333;
30
+ --color-grey: #333333;
31
+
32
+ --text-main: #c4c4c4;
33
+ --text-muted: #666677;
34
+
35
+ --font-ui: system-ui, -apple-system, sans-serif;
36
+ --font-data: ui-monospace, "Fira Code", monospace;
37
+ }
38
+
39
+ :root[data-mode="day"] {
40
+ --comfort-champagne: #66c6db;
41
+ --comfort-easy: #8dfcbb;
42
+ --comfort-coffee: #fca847;
43
+ --comfort-rough: #ff8847;
44
+ --comfort-sick: #ff5e5e;
45
+ --comfort-unknown: #666666;
46
+
47
+ --color-green: #8dfcbb;
48
+ --color-teal: #66c6db;
49
+ --color-orange: #fca847;
50
+ --color-red: #ff5e5e;
51
+ --color-grey: #666666;
52
+
53
+ --text-main: #ffffff;
54
+ --text-muted: #a0a0b5;
55
+ }
56
+
57
+ * {
58
+ box-sizing: border-box;
59
+ border-radius: 0;
60
+ }
61
+
62
+ body {
63
+ background-color: var(--bg-base);
64
+ color: var(--text-main);
65
+ font-family: var(--font-ui);
66
+ margin: 0;
67
+ padding: 8px;
68
+ }
69
+
70
+ /* --- Panels: faint inner borders + 2px corner brackets ------------- */
71
+
72
+ .sk-card {
73
+ position: relative;
74
+ background-color: var(--bg-panel);
75
+ border: 1px solid rgba(102, 198, 219, 0.3);
76
+ padding: 12px;
77
+ margin-bottom: 12px;
78
+ }
79
+
80
+ .sk-card::before,
81
+ .sk-card::after {
82
+ content: "";
83
+ position: absolute;
84
+ width: 12px;
85
+ height: 12px;
86
+ pointer-events: none;
87
+ }
88
+
89
+ .sk-card::before {
90
+ top: -2px;
91
+ left: -2px;
92
+ border-top: 2px solid var(--theme-color, var(--color-teal));
93
+ border-left: 2px solid var(--theme-color, var(--color-teal));
94
+ }
95
+
96
+ .sk-card::after {
97
+ bottom: -2px;
98
+ right: -2px;
99
+ border-bottom: 2px solid var(--theme-color, var(--color-teal));
100
+ border-right: 2px solid var(--theme-color, var(--color-teal));
101
+ }
102
+
103
+ .theme-green {
104
+ --theme-color: var(--color-green);
105
+ }
106
+ .theme-teal {
107
+ --theme-color: var(--color-teal);
108
+ }
109
+ .theme-orange {
110
+ --theme-color: var(--color-orange);
111
+ }
112
+ .theme-red {
113
+ --theme-color: var(--color-red);
114
+ }
115
+ .theme-offline {
116
+ --theme-color: var(--color-grey);
117
+ }
118
+
119
+ /* --- Headers & labels ---------------------------------------------- */
120
+
121
+ h1,
122
+ h2,
123
+ h3 {
124
+ font-size: 0.85rem;
125
+ font-weight: 700;
126
+ letter-spacing: 0.1em;
127
+ text-transform: uppercase;
128
+ color: var(--theme-color, var(--color-teal));
129
+ margin: 0 0 8px 0;
130
+ }
131
+
132
+ .label {
133
+ font-size: 0.75rem;
134
+ font-weight: 700;
135
+ letter-spacing: 0.1em;
136
+ text-transform: uppercase;
137
+ color: var(--text-muted);
138
+ }
139
+
140
+ /* --- Data values ---------------------------------------------------- */
141
+
142
+ .value {
143
+ font-family: var(--font-data);
144
+ font-variant-numeric: tabular-nums;
145
+ font-size: 2.5rem;
146
+ font-weight: 700;
147
+ color: var(--text-main);
148
+ line-height: 1.1;
149
+ }
150
+
151
+ .value-small {
152
+ font-family: var(--font-data);
153
+ font-variant-numeric: tabular-nums;
154
+ font-size: 1.1rem;
155
+ font-weight: 700;
156
+ color: var(--text-main);
157
+ }
158
+
159
+ .muted {
160
+ color: var(--text-muted);
161
+ font-family: var(--font-data);
162
+ font-variant-numeric: tabular-nums;
163
+ }
164
+
165
+ /* --- Buttons (hardware style) --------------------------------------- */
166
+
167
+ button {
168
+ appearance: none;
169
+ background: transparent;
170
+ border: 1px solid var(--theme-color, var(--color-teal));
171
+ color: var(--theme-color, var(--color-teal));
172
+ font-family: var(--font-data);
173
+ font-size: 0.85rem;
174
+ font-weight: 700;
175
+ text-transform: uppercase;
176
+ letter-spacing: 0.1em;
177
+ padding: 12px 16px;
178
+ min-height: 48px;
179
+ cursor: pointer;
180
+ }
181
+
182
+ button:hover,
183
+ button:active {
184
+ background-color: var(--theme-color, var(--color-teal));
185
+ color: var(--bg-base);
186
+ }
187
+
188
+ button:disabled {
189
+ border-color: var(--color-grey);
190
+ color: var(--color-grey);
191
+ cursor: not-allowed;
192
+ background: transparent;
193
+ }
194
+
195
+ select {
196
+ appearance: none;
197
+ background-color: var(--bg-panel-muted);
198
+ border: 1px solid var(--color-grey);
199
+ border-bottom: 2px solid var(--color-grey);
200
+ color: var(--text-main);
201
+ font-family: var(--font-data);
202
+ font-size: 0.9rem;
203
+ padding: 12px;
204
+ min-height: 48px;
205
+ }
206
+
207
+ select:focus {
208
+ outline: none;
209
+ border-bottom-color: var(--theme-color, var(--color-teal));
210
+ }
211
+
212
+ /* --- Tab bar --------------------------------------------------------- */
213
+
214
+ .tab-bar {
215
+ display: flex;
216
+ gap: 0;
217
+ }
218
+
219
+ .tab-bar[hidden] {
220
+ display: none;
221
+ }
222
+
223
+ .tab-bar button {
224
+ flex: 1;
225
+ border-right: none;
226
+ }
227
+
228
+ .tab-bar button:last-child {
229
+ border-right: 1px solid var(--theme-color, var(--color-teal));
230
+ }
231
+
232
+ .tab-bar button[aria-selected="true"] {
233
+ background-color: var(--theme-color, var(--color-teal));
234
+ color: var(--bg-base);
235
+ }
236
+
237
+ /* --- Data table ------------------------------------------------------- */
238
+
239
+ table.data {
240
+ width: 100%;
241
+ border-collapse: collapse;
242
+ font-family: var(--font-data);
243
+ font-variant-numeric: tabular-nums;
244
+ }
245
+
246
+ table.data th {
247
+ font-size: 0.75rem;
248
+ letter-spacing: 0.1em;
249
+ text-transform: uppercase;
250
+ color: var(--text-muted);
251
+ text-align: left;
252
+ padding: 6px 8px;
253
+ border-bottom: 1px solid rgba(102, 198, 219, 0.3);
254
+ }
255
+
256
+ table.data td {
257
+ padding: 6px 8px;
258
+ border-bottom: 1px solid rgba(102, 198, 219, 0.15);
259
+ color: var(--text-main);
260
+ }
261
+
262
+ /* --- Pseudo-console (METAREA bulletins, logs) ------------------------- */
263
+
264
+ .console {
265
+ font-family: var(--font-data);
266
+ font-size: 0.85rem;
267
+ background-color: var(--bg-panel-muted);
268
+ border: 1px solid rgba(102, 198, 219, 0.3);
269
+ padding: 8px;
270
+ max-height: 40vh;
271
+ overflow-y: auto;
272
+ white-space: pre-wrap;
273
+ word-break: break-word;
274
+ }
275
+
276
+ .console .ts {
277
+ color: var(--text-muted);
278
+ }
279
+
280
+ /* --- Layout ------------------------------------------------------------ */
281
+
282
+ .grid-auto {
283
+ display: grid;
284
+ gap: 12px;
285
+ grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
286
+ }
287
+
288
+ @media (min-width: 700px) {
289
+ body {
290
+ padding: 16px;
291
+ }
292
+ }
@@ -0,0 +1,287 @@
1
+ {
2
+ "type": "FeatureCollection",
3
+ "features": [
4
+ {
5
+ "type": "Feature",
6
+ "properties": {
7
+ "zone": 14,
8
+ "roman": "XIV",
9
+ "name": "New Zealand / South Pacific"
10
+ },
11
+ "geometry": {
12
+ "type": "MultiPolygon",
13
+ "coordinates": [
14
+ [
15
+ [
16
+ [160.0, 0.0],
17
+ [180.0, 0.0],
18
+ [180.0, -90.0],
19
+ [160.0, -90.0],
20
+ [160.0, 0.0]
21
+ ]
22
+ ],
23
+ [
24
+ [
25
+ [-180.0, 0.0],
26
+ [-120.0, 0.0],
27
+ [-120.0, -90.0],
28
+ [-180.0, -90.0],
29
+ [-180.0, 0.0]
30
+ ]
31
+ ]
32
+ ]
33
+ }
34
+ },
35
+ {
36
+ "type": "Feature",
37
+ "properties": {
38
+ "zone": 10,
39
+ "roman": "X",
40
+ "name": "Australia / Tasman Sea"
41
+ },
42
+ "geometry": {
43
+ "type": "Polygon",
44
+ "coordinates": [
45
+ [
46
+ [80.0, 0.0],
47
+ [160.0, 0.0],
48
+ [160.0, -90.0],
49
+ [80.0, -90.0],
50
+ [80.0, 0.0]
51
+ ]
52
+ ]
53
+ }
54
+ },
55
+ {
56
+ "type": "Feature",
57
+ "properties": {
58
+ "zone": 11,
59
+ "roman": "XI",
60
+ "name": "Southeast Asia / Japan"
61
+ },
62
+ "geometry": {
63
+ "type": "Polygon",
64
+ "coordinates": [
65
+ [[95.0, 0.0], [180.0, 0.0], [180.0, 60.0], [95.0, 60.0], [95.0, 0.0]]
66
+ ]
67
+ }
68
+ },
69
+ {
70
+ "type": "Feature",
71
+ "properties": {
72
+ "zone": 8,
73
+ "roman": "VIII",
74
+ "name": "India / Arabian Sea"
75
+ },
76
+ "geometry": {
77
+ "type": "Polygon",
78
+ "coordinates": [
79
+ [
80
+ [30.0, -12.0],
81
+ [95.0, -12.0],
82
+ [95.0, 30.0],
83
+ [30.0, 30.0],
84
+ [30.0, -12.0]
85
+ ]
86
+ ]
87
+ }
88
+ },
89
+ {
90
+ "type": "Feature",
91
+ "properties": {
92
+ "zone": 7,
93
+ "roman": "VII",
94
+ "name": "South Africa / Indian Ocean"
95
+ },
96
+ "geometry": {
97
+ "type": "Polygon",
98
+ "coordinates": [
99
+ [
100
+ [-20.0, -6.0],
101
+ [80.0, -6.0],
102
+ [80.0, -90.0],
103
+ [-20.0, -90.0],
104
+ [-20.0, -6.0]
105
+ ]
106
+ ]
107
+ }
108
+ },
109
+ {
110
+ "type": "Feature",
111
+ "properties": {
112
+ "zone": 9,
113
+ "roman": "IX",
114
+ "name": "Pakistan / Persian Gulf / Red Sea"
115
+ },
116
+ "geometry": {
117
+ "type": "Polygon",
118
+ "coordinates": [
119
+ [[30.0, 12.0], [80.0, 12.0], [80.0, 30.0], [30.0, 30.0], [30.0, 12.0]]
120
+ ]
121
+ }
122
+ },
123
+ {
124
+ "type": "Feature",
125
+ "properties": {
126
+ "zone": 12,
127
+ "roman": "XII",
128
+ "name": "USA West Coast / Eastern Pacific"
129
+ },
130
+ "geometry": {
131
+ "type": "MultiPolygon",
132
+ "coordinates": [
133
+ [[[180.0, 0.0], [180.0, 67.0], [180.0, 0.0]]],
134
+ [
135
+ [
136
+ [-180.0, 0.0],
137
+ [-120.0, 0.0],
138
+ [-120.0, 67.0],
139
+ [-180.0, 67.0],
140
+ [-180.0, 0.0]
141
+ ]
142
+ ]
143
+ ]
144
+ }
145
+ },
146
+ {
147
+ "type": "Feature",
148
+ "properties": {
149
+ "zone": 16,
150
+ "roman": "XVI",
151
+ "name": "Peru / Eastern Tropical Pacific"
152
+ },
153
+ "geometry": {
154
+ "type": "Polygon",
155
+ "coordinates": [
156
+ [
157
+ [-120.0, -18.0],
158
+ [-70.0, -18.0],
159
+ [-70.0, 0.0],
160
+ [-120.0, 0.0],
161
+ [-120.0, -18.0]
162
+ ]
163
+ ]
164
+ }
165
+ },
166
+ {
167
+ "type": "Feature",
168
+ "properties": {
169
+ "zone": 15,
170
+ "roman": "XV",
171
+ "name": "Chile / South-Eastern Pacific"
172
+ },
173
+ "geometry": {
174
+ "type": "Polygon",
175
+ "coordinates": [
176
+ [
177
+ [-120.0, -90.0],
178
+ [-70.0, -90.0],
179
+ [-70.0, -18.0],
180
+ [-120.0, -18.0],
181
+ [-120.0, -90.0]
182
+ ]
183
+ ]
184
+ }
185
+ },
186
+ {
187
+ "type": "Feature",
188
+ "properties": {
189
+ "zone": 6,
190
+ "roman": "VI",
191
+ "name": "Argentina / South Atlantic"
192
+ },
193
+ "geometry": {
194
+ "type": "Polygon",
195
+ "coordinates": [
196
+ [
197
+ [-70.0, -90.0],
198
+ [-20.0, -90.0],
199
+ [-20.0, -35.0],
200
+ [-70.0, -35.0],
201
+ [-70.0, -90.0]
202
+ ]
203
+ ]
204
+ }
205
+ },
206
+ {
207
+ "type": "Feature",
208
+ "properties": {
209
+ "zone": 5,
210
+ "roman": "V",
211
+ "name": "Brazil / Tropical Atlantic"
212
+ },
213
+ "geometry": {
214
+ "type": "Polygon",
215
+ "coordinates": [
216
+ [
217
+ [-50.0, -35.0],
218
+ [-20.0, -35.0],
219
+ [-20.0, 7.0],
220
+ [-50.0, 7.0],
221
+ [-50.0, -35.0]
222
+ ]
223
+ ]
224
+ }
225
+ },
226
+ {
227
+ "type": "Feature",
228
+ "properties": {
229
+ "zone": 4,
230
+ "roman": "IV",
231
+ "name": "USA East Coast / Western Atlantic"
232
+ },
233
+ "geometry": {
234
+ "type": "Polygon",
235
+ "coordinates": [
236
+ [
237
+ [-120.0, 7.0],
238
+ [-40.0, 7.0],
239
+ [-40.0, 67.0],
240
+ [-120.0, 67.0],
241
+ [-120.0, 7.0]
242
+ ]
243
+ ]
244
+ }
245
+ },
246
+ {
247
+ "type": "Feature",
248
+ "properties": {
249
+ "zone": 2,
250
+ "roman": "II",
251
+ "name": "Eastern Atlantic / Africa Coast"
252
+ },
253
+ "geometry": {
254
+ "type": "Polygon",
255
+ "coordinates": [
256
+ [[-40.0, 7.0], [35.0, 7.0], [35.0, 48.0], [-40.0, 48.0], [-40.0, 7.0]]
257
+ ]
258
+ }
259
+ },
260
+ {
261
+ "type": "Feature",
262
+ "properties": { "zone": 1, "roman": "I", "name": "UK / North Atlantic" },
263
+ "geometry": {
264
+ "type": "Polygon",
265
+ "coordinates": [
266
+ [
267
+ [-40.0, 48.0],
268
+ [45.0, 48.0],
269
+ [45.0, 75.0],
270
+ [-40.0, 75.0],
271
+ [-40.0, 48.0]
272
+ ]
273
+ ]
274
+ }
275
+ },
276
+ {
277
+ "type": "Feature",
278
+ "properties": { "zone": 3, "roman": "III", "name": "Mediterranean Sea" },
279
+ "geometry": {
280
+ "type": "Polygon",
281
+ "coordinates": [
282
+ [[-5.0, 30.0], [35.0, 30.0], [35.0, 48.0], [-5.0, 48.0], [-5.0, 30.0]]
283
+ ]
284
+ }
285
+ }
286
+ ]
287
+ }
Binary file
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en" data-mode="night">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Passage Briefing</title>
7
+ <link rel="stylesheet" href="css/visuals.css">
8
+ <script type="module" src="app.js"></script>
9
+ </head>
10
+ <body>
11
+ <passage-outlook></passage-outlook>
12
+ </body>
13
+ </html>