daily-focus 0.2.0-dev.14 → 1.1.0-dev.1
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/README.md +7 -1
- package/dist/{audit-DTXVAT5Z.js → audit-W3O6CLOF.js} +4 -6
- package/dist/chunk-F3EHZWRS.js +456 -0
- package/dist/{chunk-IFAGJFOT.js → chunk-OPASVYLR.js} +79 -6
- package/dist/chunk-Q5OKXJXT.js +404 -0
- package/dist/{chunk-NAD6PRZT.js → chunk-UM2EPNWR.js} +5 -7
- package/dist/cli.js +25 -31
- package/dist/demo-HTFKCJJ5.js +859 -0
- package/dist/{init-BMFPWMXL.js → init-DEVCAQZZ.js} +1 -2
- package/dist/{seed-GCT7Z3IV.js → seed-SMKNFYTC.js} +4 -5
- package/dist/{server-ANIS2MXU.js → server-JJVEH4ME.js} +26 -477
- package/dist/{service-NEQVCWI5.js → service-6ZFOHPWN.js} +1 -2
- package/package.json +1 -1
- package/public/app.js +20 -5
- package/dist/chunk-K2VT4JBR.js +0 -81
- package/dist/chunk-UAR65OCG.js +0 -179
- package/dist/sample-QDEXFFRY.js +0 -7
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
import {
|
|
2
|
+
localDateKey
|
|
3
|
+
} from "./chunk-OPASVYLR.js";
|
|
4
|
+
|
|
5
|
+
// src/sample.ts
|
|
6
|
+
function timeOn(now, hour, minute = 0) {
|
|
7
|
+
return new Date(now.getFullYear(), now.getMonth(), now.getDate(), hour, minute).toISOString();
|
|
8
|
+
}
|
|
9
|
+
function dateFromNow(now, days) {
|
|
10
|
+
return localDateKey(new Date(now.getFullYear(), now.getMonth(), now.getDate() + days));
|
|
11
|
+
}
|
|
12
|
+
function sampleGeneratedAt(now) {
|
|
13
|
+
const morning = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 6, 36).getTime();
|
|
14
|
+
const earlier = now.getTime() - 4 * 6e4;
|
|
15
|
+
const start = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 10).getTime();
|
|
16
|
+
return new Date(Math.max(start, Math.min(morning, earlier))).toISOString();
|
|
17
|
+
}
|
|
18
|
+
function sampleBrief(now = /* @__PURE__ */ new Date(), profile = "work") {
|
|
19
|
+
return profile === "personal" ? personalBrief(now) : workBrief(now);
|
|
20
|
+
}
|
|
21
|
+
function workBrief(now) {
|
|
22
|
+
const at = (hour, minute = 0) => timeOn(now, hour, minute);
|
|
23
|
+
const daysFromNow = (days) => dateFromNow(now, days);
|
|
24
|
+
const items = [
|
|
25
|
+
{
|
|
26
|
+
id: "workday:task:compliance-training-2026",
|
|
27
|
+
source: "workday",
|
|
28
|
+
kind: "task",
|
|
29
|
+
title: "Complete annual security & compliance training",
|
|
30
|
+
detail: "Workday has sent three reminders. Due end of day \u2014 after that it escalates to your manager.",
|
|
31
|
+
url: "https://wd5.myworkday.com/acme/d/task/compliance-2026",
|
|
32
|
+
priority: 1,
|
|
33
|
+
due: daysFromNow(0),
|
|
34
|
+
firstSeen: daysFromNow(-6),
|
|
35
|
+
tags: ["deadline"]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: "github:pr:acme/webapp#3421",
|
|
39
|
+
source: "github",
|
|
40
|
+
kind: "task",
|
|
41
|
+
title: "Review requested: Fix session replay memory leak on long-lived tabs",
|
|
42
|
+
detail: "Alice asked you directly 2 days ago; nobody else has looked. 4 files, +180/\u221262. Merging this is what unblocks the staging checkout path.",
|
|
43
|
+
url: "https://github.com/acme/webapp/pull/3421",
|
|
44
|
+
priority: 2,
|
|
45
|
+
firstSeen: daysFromNow(-2),
|
|
46
|
+
people: ["@alice"],
|
|
47
|
+
tags: ["review-requested"],
|
|
48
|
+
advancesObjective: true
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "email:thread:18f2a9c4b7",
|
|
52
|
+
source: "email",
|
|
53
|
+
kind: "task",
|
|
54
|
+
title: "Re: Q4 headcount plan \u2014 Bob is waiting on your input",
|
|
55
|
+
detail: "They asked for the team split on Monday and followed up yesterday. Nothing sent back yet.",
|
|
56
|
+
url: "https://mail.google.com/mail/u/0/#inbox/18f2a9c4b7",
|
|
57
|
+
priority: 3,
|
|
58
|
+
firstSeen: daysFromNow(-3),
|
|
59
|
+
people: ["bob@acme.example"]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: "gtasks:task:MTU3NDkyODkwMjE2NDcx",
|
|
63
|
+
source: "tasks",
|
|
64
|
+
kind: "task",
|
|
65
|
+
title: "Write up the staging repro steps for the checkout breakage",
|
|
66
|
+
detail: "Your own note, and the only item here nobody else will ever chase. 42 minutes on it this morning.",
|
|
67
|
+
due: daysFromNow(1),
|
|
68
|
+
firstSeen: daysFromNow(-4),
|
|
69
|
+
advancesObjective: true
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: "workday:expense:berlin-offsite",
|
|
73
|
+
source: "workday",
|
|
74
|
+
kind: "task",
|
|
75
|
+
title: "Submit the expense report for the Berlin offsite",
|
|
76
|
+
detail: "Receipts are attached in Workday; the report has sat in draft since the trip.",
|
|
77
|
+
url: "https://wd5.myworkday.com/acme/d/expense/berlin-offsite",
|
|
78
|
+
due: daysFromNow(5),
|
|
79
|
+
firstSeen: daysFromNow(-8)
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: "github:pr:acme/webapp#3402",
|
|
83
|
+
source: "github",
|
|
84
|
+
kind: "task",
|
|
85
|
+
title: "CI failing on your PR: Add trace context to fetch instrumentation",
|
|
86
|
+
detail: "`unit-tests (node-20)` is red. The failure is in `tracing/fetch.spec.ts`, which your diff touches \u2014 likely yours, not flaky infra.",
|
|
87
|
+
url: "https://github.com/acme/webapp/pull/3402",
|
|
88
|
+
firstSeen: daysFromNow(-1),
|
|
89
|
+
tags: ["ci-failing"]
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: "github:pr:acme/webapp#3395",
|
|
93
|
+
source: "github",
|
|
94
|
+
kind: "task",
|
|
95
|
+
title: "Open 3 days with no review: Bump chrome-launcher to 1.2.0",
|
|
96
|
+
url: "https://github.com/acme/webapp/pull/3395",
|
|
97
|
+
firstSeen: daysFromNow(-3),
|
|
98
|
+
tags: ["awaiting-review"]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: "github:pr:acme/webapp#3430",
|
|
102
|
+
source: "github",
|
|
103
|
+
kind: "task",
|
|
104
|
+
title: "Draft PR is green \u2014 ready to mark for review?",
|
|
105
|
+
detail: "You opened this last night as a draft. All checks passed 40 minutes ago.",
|
|
106
|
+
url: "https://github.com/acme/webapp/pull/3430",
|
|
107
|
+
firstSeen: daysFromNow(0),
|
|
108
|
+
tags: ["draft", "ci-green"]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: "jira:PROJ-8842",
|
|
112
|
+
source: "jira",
|
|
113
|
+
kind: "task",
|
|
114
|
+
title: "PROJ-8842 still open \u2014 all 2 linked PRs are merged",
|
|
115
|
+
detail: "Assigned to you. Both PRs merged last week; the ticket never moved to Done.",
|
|
116
|
+
url: "https://acme.atlassian.net/browse/PROJ-8842",
|
|
117
|
+
firstSeen: daysFromNow(-5)
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: "atlassian:page:sdk-sampling-design",
|
|
121
|
+
source: "atlassian",
|
|
122
|
+
kind: "task",
|
|
123
|
+
title: "Comment on the SDK sampling design doc \u2014 Dana asked for your review by Wednesday",
|
|
124
|
+
detail: "Two open questions are addressed to you in the margin, on the per-tab budget and the default rate.",
|
|
125
|
+
url: "https://acme.atlassian.net/wiki/spaces/PLAT/pages/8812001/SDK+sampling+design",
|
|
126
|
+
due: daysFromNow(2),
|
|
127
|
+
firstSeen: daysFromNow(-1),
|
|
128
|
+
people: ["@dana"]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: "slack:msg:C04ABCDE/1757480412.118",
|
|
132
|
+
source: "slack",
|
|
133
|
+
kind: "task",
|
|
134
|
+
title: "#webapp-dev: Chris asked whether v6 can drop IE11 shims",
|
|
135
|
+
detail: "Direct question to you, 19 hours ago, still unanswered in-thread.",
|
|
136
|
+
url: "https://acme.slack.com/archives/C04ABCDE/p1757480412118",
|
|
137
|
+
firstSeen: daysFromNow(-1),
|
|
138
|
+
people: ["@chris"]
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: "email:thread:18f30bb211",
|
|
142
|
+
source: "email",
|
|
143
|
+
kind: "task",
|
|
144
|
+
title: "Travel: approve your Dublin flight option before 17:00",
|
|
145
|
+
detail: "The held fare expires this evening. Two options attached.",
|
|
146
|
+
url: "https://mail.google.com/mail/u/0/#inbox/18f30bb211",
|
|
147
|
+
due: daysFromNow(0),
|
|
148
|
+
firstSeen: daysFromNow(0),
|
|
149
|
+
tags: ["travel"]
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: "email:thread:18f31c0d9e",
|
|
153
|
+
source: "email",
|
|
154
|
+
kind: "task",
|
|
155
|
+
title: "Renew the Chrome Web Store developer registration",
|
|
156
|
+
detail: "Google\u2019s reminder; the registration runs out at the end of the month.",
|
|
157
|
+
url: "https://mail.google.com/mail/u/0/#inbox/18f31c0d9e",
|
|
158
|
+
due: daysFromNow(20),
|
|
159
|
+
firstSeen: daysFromNow(-3)
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
id: "calendar:event:standup",
|
|
163
|
+
source: "calendar",
|
|
164
|
+
kind: "event",
|
|
165
|
+
title: "Webapp standup",
|
|
166
|
+
start: at(9, 30),
|
|
167
|
+
end: at(9, 45),
|
|
168
|
+
url: "https://meet.google.com/abc-defg-hij"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
id: "calendar:event:1on1",
|
|
172
|
+
source: "calendar",
|
|
173
|
+
kind: "event",
|
|
174
|
+
title: "1:1 with Alice",
|
|
175
|
+
start: at(11, 0),
|
|
176
|
+
end: at(11, 30)
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
id: "calendar:event:design-review",
|
|
180
|
+
source: "calendar",
|
|
181
|
+
kind: "event",
|
|
182
|
+
title: "Design review: search indexing v3",
|
|
183
|
+
start: at(11, 15),
|
|
184
|
+
end: at(12, 0)
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
id: "calendar:event:lunch-and-learn",
|
|
188
|
+
source: "calendar",
|
|
189
|
+
kind: "event",
|
|
190
|
+
title: "Lunch & learn: tracing in production (optional)",
|
|
191
|
+
start: at(12, 30),
|
|
192
|
+
end: at(13, 0),
|
|
193
|
+
blocking: false
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
id: "calendar:event:sync",
|
|
197
|
+
source: "calendar",
|
|
198
|
+
kind: "event",
|
|
199
|
+
title: "Platform \u2194 Infra sync",
|
|
200
|
+
start: at(15, 0),
|
|
201
|
+
end: at(16, 0)
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: "calendar:holiday:us-labor-day",
|
|
205
|
+
source: "calendar",
|
|
206
|
+
kind: "info",
|
|
207
|
+
title: "US public holiday today \u2014 most American colleagues are off",
|
|
208
|
+
detail: "Expect slow replies from colleagues there.",
|
|
209
|
+
firstSeen: daysFromNow(0)
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
id: "calendar:holiday:local-national-day",
|
|
213
|
+
source: "calendar",
|
|
214
|
+
kind: "info",
|
|
215
|
+
title: `Local public holiday in 9 days (${daysFromNow(9)}) \u2014 office closed`,
|
|
216
|
+
firstSeen: daysFromNow(0)
|
|
217
|
+
}
|
|
218
|
+
];
|
|
219
|
+
return {
|
|
220
|
+
version: 1,
|
|
221
|
+
generatedAt: sampleGeneratedAt(now),
|
|
222
|
+
generatedBy: "codex (sample data)",
|
|
223
|
+
date: localDateKey(now),
|
|
224
|
+
headline: "Two things are genuinely time-boxed today: the **compliance training**, due tonight, and the Dublin fare that expires at 17:00. Alice\u2019s review request on `webapp#3421` is the one thing here that moves the objective, and 12:00\u201315:00 is your only real focus block for it.",
|
|
225
|
+
items
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
function personalBrief(now) {
|
|
229
|
+
const at = (hour, minute = 0) => timeOn(now, hour, minute);
|
|
230
|
+
const daysFromNow = (days) => dateFromNow(now, days);
|
|
231
|
+
const items = [
|
|
232
|
+
{
|
|
233
|
+
id: "eboks:message:4417820931",
|
|
234
|
+
source: "eboks",
|
|
235
|
+
kind: "task",
|
|
236
|
+
title: "Pay the daycare invoice before Friday",
|
|
237
|
+
detail: "Letter from the kommune in e-Boks: 3,250 kr. A late fee is added after the due date.",
|
|
238
|
+
priority: 1,
|
|
239
|
+
due: daysFromNow(3),
|
|
240
|
+
firstSeen: daysFromNow(-2),
|
|
241
|
+
tags: ["payment", "deadline"]
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
id: "email:thread:19a0c4e2f1",
|
|
245
|
+
source: "email",
|
|
246
|
+
kind: "task",
|
|
247
|
+
title: "Chase Nordvarme for the loft insulation quote",
|
|
248
|
+
detail: "They promised it \u201Cwithin the week\u201D nine days ago. Nothing since, and the other two quotes are in.",
|
|
249
|
+
url: "https://mail.google.com/mail/u/0/#inbox/19a0c4e2f1",
|
|
250
|
+
priority: 2,
|
|
251
|
+
firstSeen: daysFromNow(-5),
|
|
252
|
+
people: ["tilbud@nordvarme.example"],
|
|
253
|
+
advancesObjective: true
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
id: "messages:thread:chat8812/5C1F0A2E-77B4",
|
|
257
|
+
source: "messages",
|
|
258
|
+
kind: "task",
|
|
259
|
+
title: "Reply to Jonas about Saturday\u2019s dinner \u2014 he asked for a time",
|
|
260
|
+
detail: "Asked on Tuesday; the group has gone quiet since.",
|
|
261
|
+
priority: 3,
|
|
262
|
+
firstSeen: daysFromNow(-1),
|
|
263
|
+
people: ["Jonas"],
|
|
264
|
+
tags: ["reply-owed"]
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
id: "eboks:message:4417911204",
|
|
268
|
+
source: "eboks",
|
|
269
|
+
kind: "task",
|
|
270
|
+
title: "Check the deductions on your annual tax assessment",
|
|
271
|
+
detail: "Skattestyrelsen\u2019s assessment is ready. Corrections are accepted until the deadline; after that the figure stands.",
|
|
272
|
+
due: daysFromNow(20),
|
|
273
|
+
firstSeen: daysFromNow(-5),
|
|
274
|
+
tags: ["deadline"]
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
id: "email:thread:19a0d1b7c3",
|
|
278
|
+
source: "email",
|
|
279
|
+
kind: "task",
|
|
280
|
+
title: "Sign Noa\u2019s field-trip permission slip by Thursday",
|
|
281
|
+
detail: "The school sent the form on Monday; it needs a signature and a packed lunch note.",
|
|
282
|
+
url: "https://mail.google.com/mail/u/0/#inbox/19a0d1b7c3",
|
|
283
|
+
due: daysFromNow(2),
|
|
284
|
+
firstSeen: daysFromNow(-1),
|
|
285
|
+
people: ["Noa\u2019s school"]
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
id: "email:thread:19a0b9f0a2",
|
|
289
|
+
source: "email",
|
|
290
|
+
kind: "task",
|
|
291
|
+
title: "Confirm Ida\u2019s dentist appointment on the 14th",
|
|
292
|
+
detail: "Tandl\xE6gehuset asks for a reply; otherwise the slot is released on Friday.",
|
|
293
|
+
url: "https://mail.google.com/mail/u/0/#inbox/19a0b9f0a2",
|
|
294
|
+
firstSeen: daysFromNow(-3),
|
|
295
|
+
people: ["Tandl\xE6gehuset"]
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
id: "messages:thread:chat7731/9A3D4B6C-1E22",
|
|
299
|
+
source: "messages",
|
|
300
|
+
kind: "task",
|
|
301
|
+
title: "Send Priya the photos from the cabin weekend \u2014 you said you would",
|
|
302
|
+
firstSeen: daysFromNow(-4),
|
|
303
|
+
people: ["Priya"],
|
|
304
|
+
tags: ["promised"]
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
id: "reminders:item:9E1B7C3D-2A44",
|
|
308
|
+
source: "reminders",
|
|
309
|
+
kind: "task",
|
|
310
|
+
title: "Book the car\u2019s service before the inspection in November",
|
|
311
|
+
detail: "From your Home list. The garage takes about two weeks to find a slot.",
|
|
312
|
+
due: daysFromNow(25),
|
|
313
|
+
firstSeen: daysFromNow(-9)
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
id: "reminders:list:3F0C9A11-6D2E",
|
|
317
|
+
source: "reminders",
|
|
318
|
+
kind: "info",
|
|
319
|
+
title: "Home list: 7 reminders, nothing touched since May \u2014 worth five minutes to prune",
|
|
320
|
+
firstSeen: daysFromNow(-2)
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
id: "github:pr:mara-l/pedalboard#47",
|
|
324
|
+
source: "github",
|
|
325
|
+
kind: "task",
|
|
326
|
+
title: "A contributor\u2019s pull request on pedalboard has waited 6 days: Add MIDI clock sync",
|
|
327
|
+
detail: "Tomas\u2019s first contribution. A review, even a short one, is what keeps a contributor around.",
|
|
328
|
+
url: "https://github.com/mara-l/pedalboard/pull/47",
|
|
329
|
+
firstSeen: daysFromNow(-3),
|
|
330
|
+
people: ["@tomas-k"],
|
|
331
|
+
tags: ["review-requested"]
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
id: "calendar:event:sam-away",
|
|
335
|
+
source: "calendar",
|
|
336
|
+
kind: "event",
|
|
337
|
+
title: "Sam away \u2014 back Thursday",
|
|
338
|
+
start: daysFromNow(0)
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
id: "calendar:event:daycare-pickup",
|
|
342
|
+
source: "calendar",
|
|
343
|
+
kind: "event",
|
|
344
|
+
title: "Pick up Ida from daycare",
|
|
345
|
+
start: at(16, 15),
|
|
346
|
+
end: at(16, 45)
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
id: "calendar:event:insurance-call",
|
|
350
|
+
source: "calendar",
|
|
351
|
+
kind: "event",
|
|
352
|
+
title: "Call with the insurance adjuster about the water damage",
|
|
353
|
+
start: at(16, 30),
|
|
354
|
+
end: at(17, 0)
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
id: "calendar:event:football",
|
|
358
|
+
source: "calendar",
|
|
359
|
+
kind: "event",
|
|
360
|
+
title: "Noa\u2019s football practice \u2014 Jonas drives this week",
|
|
361
|
+
start: at(17, 0),
|
|
362
|
+
end: at(18, 0),
|
|
363
|
+
blocking: false
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
id: "calendar:event:parcel",
|
|
367
|
+
source: "calendar",
|
|
368
|
+
kind: "event",
|
|
369
|
+
title: "Parcel: new router, delivery window",
|
|
370
|
+
start: at(18, 0),
|
|
371
|
+
end: at(21, 0),
|
|
372
|
+
blocking: false
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
id: "calendar:event:book-club",
|
|
376
|
+
source: "calendar",
|
|
377
|
+
kind: "event",
|
|
378
|
+
title: "Book club at Priya\u2019s",
|
|
379
|
+
start: at(20, 0),
|
|
380
|
+
end: at(21, 30)
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
id: "calendar:holiday:autumn-break",
|
|
384
|
+
source: "calendar",
|
|
385
|
+
kind: "info",
|
|
386
|
+
title: `School autumn holiday starts in 9 days (${daysFromNow(9)}) \u2014 Noa is off all week`,
|
|
387
|
+
firstSeen: daysFromNow(0)
|
|
388
|
+
}
|
|
389
|
+
];
|
|
390
|
+
return {
|
|
391
|
+
version: 1,
|
|
392
|
+
generatedAt: sampleGeneratedAt(now),
|
|
393
|
+
generatedBy: "codex (sample data)",
|
|
394
|
+
date: localDateKey(now),
|
|
395
|
+
headline: "Two things have real deadlines: the **daycare invoice** on Friday and Noa\u2019s permission slip on Thursday. Sam is away until Thursday, so the evening is yours after the 16:15 pickup \u2014 and the insulation quote has now been quiet for nine days.",
|
|
396
|
+
items
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
export {
|
|
401
|
+
dateFromNow,
|
|
402
|
+
sampleGeneratedAt,
|
|
403
|
+
sampleBrief
|
|
404
|
+
};
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BRIEF_REFRESH_GRACE_HOURS,
|
|
3
|
-
describeSchedule,
|
|
4
|
-
nextRunDate,
|
|
5
|
-
resolveSchedule,
|
|
6
|
-
runsOn
|
|
7
|
-
} from "./chunk-IFAGJFOT.js";
|
|
8
|
-
import {
|
|
9
3
|
calendarDaysBetween,
|
|
4
|
+
describeSchedule,
|
|
10
5
|
isDateOnly,
|
|
11
6
|
isSameLocalDay,
|
|
12
7
|
isWorkingDay,
|
|
13
8
|
localDateKey,
|
|
14
9
|
localTimeZone,
|
|
10
|
+
nextRunDate,
|
|
15
11
|
parseISO,
|
|
12
|
+
resolveSchedule,
|
|
13
|
+
runsOn,
|
|
16
14
|
startOfLocalDay,
|
|
17
15
|
workingDaysSince,
|
|
18
16
|
workingMsBetween
|
|
19
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-OPASVYLR.js";
|
|
20
18
|
|
|
21
19
|
// src/fs.ts
|
|
22
20
|
import { mkdir, rename, writeFile } from "node:fs/promises";
|
package/dist/cli.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
// src/cli.ts
|
|
10
10
|
import { execFile, spawn } from "node:child_process";
|
|
11
11
|
import { rmSync } from "node:fs";
|
|
12
|
-
import { cp, mkdir, mkdtemp
|
|
12
|
+
import { cp, mkdir, mkdtemp } from "node:fs/promises";
|
|
13
13
|
import { tmpdir } from "node:os";
|
|
14
14
|
import { join } from "node:path";
|
|
15
15
|
import { parseArgs, promisify } from "node:util";
|
|
@@ -18,7 +18,8 @@ var HELP = `Daily Focus: a dashboard for deciding what to work on today.
|
|
|
18
18
|
|
|
19
19
|
Usage
|
|
20
20
|
daily-focus [options] start the dashboard and open it in your browser
|
|
21
|
-
daily-focus --demo look around with sample data, in a throwaway store
|
|
21
|
+
daily-focus --demo look around with sample data, in a throwaway store;
|
|
22
|
+
add --profile personal to see the personal profile
|
|
22
23
|
daily-focus service [--remove] keep it running in the background (macOS)
|
|
23
24
|
daily-focus init create the store with templates to edit by hand
|
|
24
25
|
daily-focus audit [--against <items.json>]
|
|
@@ -30,7 +31,7 @@ Options
|
|
|
30
31
|
--data <dir> the store (default ~/.daily-focus)
|
|
31
32
|
--port <port> the port to listen on (default 4321)
|
|
32
33
|
--host <host> the address to listen on (default 127.0.0.1)
|
|
33
|
-
--profile <name> work or personal, for a new store
|
|
34
|
+
--profile <name> work or personal, for a new store or the demo
|
|
34
35
|
--no-open don't open the browser
|
|
35
36
|
--exit-with-stdin stop when standard input closes, for an app running it as a child
|
|
36
37
|
-v, --version print the version
|
|
@@ -47,33 +48,26 @@ function openInBrowser(url) {
|
|
|
47
48
|
function shouldOpen(flag) {
|
|
48
49
|
return flag && process.stdout.isTTY === true && !process.env.CI;
|
|
49
50
|
}
|
|
50
|
-
async function demo(open) {
|
|
51
|
+
async function demo(open, profile) {
|
|
52
|
+
const { demoEnv, demoIntegrations, demoProfile, writeDemoStore } = await import("./demo-HTFKCJJ5.js");
|
|
53
|
+
const chosen = demoProfile(profile);
|
|
51
54
|
const store = await mkdtemp(join(tmpdir(), "daily-focus-demo-"));
|
|
52
55
|
process.on("exit", () => rmSync(store, { recursive: true, force: true }));
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
DAILY_FOCUS_CALENDAR: "off"
|
|
64
|
-
});
|
|
65
|
-
const { sampleBrief } = await import("./sample-QDEXFFRY.js");
|
|
66
|
-
await writeFile(join(store, "items.json"), `${JSON.stringify(sampleBrief(), null, 2)}
|
|
67
|
-
`);
|
|
68
|
-
await start(open, (url) => {
|
|
69
|
-
console.log(`
|
|
70
|
-
The demo is at ${url}, with sample data in a throwaway store.`);
|
|
71
|
-
console.log(" Nothing is connected and nothing runs. Stop it with Ctrl+C; the store goes with it.\n");
|
|
72
|
-
});
|
|
56
|
+
await writeDemoStore(store, chosen);
|
|
57
|
+
await start(
|
|
58
|
+
open,
|
|
59
|
+
(url) => {
|
|
60
|
+
console.log(`
|
|
61
|
+
The demo is at ${url}, with sample data in a throwaway store (the ${chosen} profile).`);
|
|
62
|
+
console.log(" Nothing is connected and nothing runs. Stop it with Ctrl+C; the store goes with it.\n");
|
|
63
|
+
},
|
|
64
|
+
{ env: demoEnv(process.env, store, chosen), integrations: demoIntegrations(chosen) }
|
|
65
|
+
);
|
|
73
66
|
}
|
|
74
|
-
async function start(open, onStarted) {
|
|
75
|
-
const { runServer } = await import("./server-
|
|
67
|
+
async function start(open, onStarted, options = {}) {
|
|
68
|
+
const { runServer } = await import("./server-JJVEH4ME.js");
|
|
76
69
|
await runServer({
|
|
70
|
+
...options,
|
|
77
71
|
onStarted: (url) => {
|
|
78
72
|
onStarted?.(url);
|
|
79
73
|
if (shouldOpen(open)) openInBrowser(url);
|
|
@@ -157,7 +151,7 @@ async function main(argv) {
|
|
|
157
151
|
switch (command) {
|
|
158
152
|
case void 0:
|
|
159
153
|
case "start":
|
|
160
|
-
if (values.demo) return demo(open);
|
|
154
|
+
if (values.demo) return demo(open, values.profile);
|
|
161
155
|
if (IN_NPX_CACHE) {
|
|
162
156
|
console.log(" Running from npx. To keep it running in the background, install it:");
|
|
163
157
|
console.log(" npm install -g daily-focus, then daily-focus service.\n");
|
|
@@ -168,20 +162,20 @@ async function main(argv) {
|
|
|
168
162
|
}
|
|
169
163
|
return start(open);
|
|
170
164
|
case "service": {
|
|
171
|
-
const { main: service } = await import("./service-
|
|
165
|
+
const { main: service } = await import("./service-6ZFOHPWN.js");
|
|
172
166
|
process.exitCode = await service(values.remove ? ["--remove"] : []);
|
|
173
167
|
return;
|
|
174
168
|
}
|
|
175
169
|
// These three are scripts that do their work as they load, and read their
|
|
176
170
|
// own flags from the command line.
|
|
177
171
|
case "init":
|
|
178
|
-
await import("./init-
|
|
172
|
+
await import("./init-DEVCAQZZ.js");
|
|
179
173
|
return;
|
|
180
174
|
case "audit":
|
|
181
|
-
await import("./audit-
|
|
175
|
+
await import("./audit-W3O6CLOF.js");
|
|
182
176
|
return;
|
|
183
177
|
case "seed":
|
|
184
|
-
await import("./seed-
|
|
178
|
+
await import("./seed-SMKNFYTC.js");
|
|
185
179
|
return;
|
|
186
180
|
case "build-calendar":
|
|
187
181
|
return buildCalendar();
|