daily-focus 1.2.0-dev.7 → 1.2.0-dev.8
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 +0 -9
- package/SETUP.md +3 -5
- package/dist/{audit-7YAJYHZF.js → audit-DNTFZOHH.js} +3 -3
- package/dist/{chunk-4DCBCR4D.js → chunk-6SMUSPZG.js} +2 -2
- package/dist/{chunk-JQGYCWRX.js → chunk-GQ3NCWRT.js} +7 -175
- package/dist/{chunk-RNE27FQY.js → chunk-KZNY45XW.js} +0 -5
- package/dist/{chunk-UY6HQLGE.js → chunk-P3E2B2SD.js} +1 -1
- package/dist/cli.js +6 -6
- package/dist/{demo-5I4BNHW2.js → demo-6Q22AAC7.js} +2 -21
- package/dist/{init-57WHZZNG.js → init-XDMAXU2S.js} +1 -9
- package/dist/{seed-BLFBCHIA.js → seed-TWT7EDXJ.js} +3 -3
- package/dist/{server-UI6WYRTL.js → server-PIYOIUKJ.js} +87 -217
- package/dist/{service-NAAAV67B.js → service-ZUHI3VKH.js} +1 -1
- package/package.json +1 -1
- package/prompts/README.md +2 -3
- package/prompts/morning-brief-personal.md +0 -25
- package/prompts/morning-brief-work.md +0 -28
- package/public/app.js +134 -334
- package/public/style.css +5 -169
package/README.md
CHANGED
|
@@ -64,13 +64,6 @@ since you completed something that advanced your objective.
|
|
|
64
64
|
- Mark tasks **Done** when you've handled them.
|
|
65
65
|
- **Snooze** an item until a date, or **Dismiss** it if it doesn't need attention.
|
|
66
66
|
- Leave a **Note** for the next brief, such as "already replied on Slack".
|
|
67
|
-
- Press **f** for focus mode, which shows your top item and agenda.
|
|
68
|
-
- Press **p** on an item to start a focus timer. Its countdown appears in the tab
|
|
69
|
-
title, and the session becomes part of the next brief's context.
|
|
70
|
-
|
|
71
|
-
The timer keeps counting after its target time. On macOS, it ends a session when
|
|
72
|
-
you've been away from the machine, excluding the time you were away. On systems
|
|
73
|
-
without idle detection, a two-hour limit caps the recorded session.
|
|
74
67
|
|
|
75
68
|
You can undo item actions except notes. The page updates as new data arrives, and
|
|
76
69
|
the theme button switches between system, light, and dark mode.
|
|
@@ -177,8 +170,6 @@ Press **?** in the dashboard to see the shortcuts.
|
|
|
177
170
|
| `a` | Open the panel, ready to ask the assistant |
|
|
178
171
|
| `o` | Open the source link |
|
|
179
172
|
| `u` | Undo the last action |
|
|
180
|
-
| `f` | Toggle focus mode |
|
|
181
|
-
| `p` | Start / stop a focus session |
|
|
182
173
|
| `r` | Refresh the current board |
|
|
183
174
|
| `w` | Switch Jira views |
|
|
184
175
|
| `,` | Settings |
|
package/SETUP.md
CHANGED
|
@@ -148,8 +148,8 @@ Set `DAILY_FOCUS_AGENT_MODEL` and `DAILY_FOCUS_AGENT_EFFORT` if the CLI's own
|
|
|
148
148
|
defaults are not what you want for a brief; a brief is worth a high effort. If the
|
|
149
149
|
server can't find the CLI, set `DAILY_FOCUS_AGENT_BIN`.
|
|
150
150
|
|
|
151
|
-
The agent writes `items.json`. The dashboard records your actions
|
|
152
|
-
|
|
151
|
+
The agent writes `items.json`. The dashboard records your actions for the next run
|
|
152
|
+
to read.
|
|
153
153
|
|
|
154
154
|
After the first run, read its report (click "updated … ago"): it says which sources
|
|
155
155
|
it couldn't reach. To check the brief against the payload contract, run:
|
|
@@ -461,7 +461,7 @@ DAILY_FOCUS_PROFILE=personal
|
|
|
461
461
|
The dashboard then links the personal prompt, `prompts/morning-brief-personal.md`,
|
|
462
462
|
into the store as `prompt.md`, and the source list starts from a template with
|
|
463
463
|
sections for those sources. The profile also switches off
|
|
464
|
-
the Jira board
|
|
464
|
+
the Jira board, and gives the tab a green house icon instead of the blue briefcase. The pull request
|
|
465
465
|
board stays on for side projects; point it at your personal account with
|
|
466
466
|
`DAILY_FOCUS_GITHUB_ACCOUNTS`, or set `DAILY_FOCUS_GITHUB=off`.
|
|
467
467
|
|
|
@@ -522,8 +522,6 @@ matters when `DAILY_FOCUS_FREE_WINDOWS` is off.
|
|
|
522
522
|
| `DAILY_FOCUS_MIN_FREE_WINDOW` | `45` | Minutes before a gap counts as a focus window |
|
|
523
523
|
| `DAILY_FOCUS_STALE_AFTER_HOURS` | `24` | When to expect a refresh. Shows an informational message for 45 minutes before warning that the agent may not have run. Counted only in hours a run was due, so days off never trip it |
|
|
524
524
|
| `DAILY_FOCUS_AGENT_DAYS` | `1-5` | Weekdays the dashboard runs the agent on, cron-style and cron-numbered: `1-5` for Monday to Friday, `0-4` for Sunday to Thursday, `0,6` for a weekend-only run |
|
|
525
|
-
| `DAILY_FOCUS_SESSION_MINUTES` | `25` | Default focus session length |
|
|
526
|
-
| `DAILY_FOCUS_AWAY_AFTER` | `10`; `0` for personal | Minutes of an untouched machine before a session is closed at the last sign of life. `0` turns it off |
|
|
527
525
|
| `DAILY_FOCUS_GITHUB` | `on` | `off` disables the pull request board, and the ticket board stops checking GitHub; nothing is polled |
|
|
528
526
|
| `DAILY_FOCUS_GITHUB_ACCOUNTS` | *gh's active account* | Logins to poll as, comma-separated, each resolved with `gh auth token --user` |
|
|
529
527
|
| `DAILY_FOCUS_GITHUB_SCOPE` | *everything* | Organisations or `owner/repo` entries to limit the board to, comma-separated |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readSystemZone,
|
|
3
3
|
startingZone
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6SMUSPZG.js";
|
|
5
5
|
import {
|
|
6
6
|
linkState
|
|
7
7
|
} from "./chunk-QKT2FAB5.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
resolveItems,
|
|
14
14
|
runContractChecks,
|
|
15
15
|
setsStatus
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-GQ3NCWRT.js";
|
|
17
17
|
import {
|
|
18
18
|
BRIEF_REFRESH_GRACE_HOURS,
|
|
19
19
|
describeSchedule,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
resolveSchedule,
|
|
24
24
|
runsOn,
|
|
25
25
|
workingMsBetween
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-KZNY45XW.js";
|
|
27
27
|
import {
|
|
28
28
|
command
|
|
29
29
|
} from "./chunk-BC2W7NND.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
startOfLocalDay,
|
|
15
15
|
workingDaysSince,
|
|
16
16
|
workingMsBetween
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-KZNY45XW.js";
|
|
18
18
|
|
|
19
19
|
// src/fs.ts
|
|
20
20
|
import { mkdir, rename, writeFile } from "node:fs/promises";
|
|
@@ -390,172 +390,9 @@ function findLeakedPhrase(brief, focus) {
|
|
|
390
390
|
return null;
|
|
391
391
|
}
|
|
392
392
|
|
|
393
|
-
// src/sessions.ts
|
|
394
|
-
import { appendFile, mkdir as mkdir2, readFile as readFile2, unlink } from "node:fs/promises";
|
|
395
|
-
var MAX_SESSION_MINUTES = 120;
|
|
396
|
-
var MIN_LOGGABLE_MINUTES = 1;
|
|
397
|
-
async function readActive(config) {
|
|
398
|
-
try {
|
|
399
|
-
return JSON.parse(await readFile2(config.sessionFile, "utf8"));
|
|
400
|
-
} catch {
|
|
401
|
-
return null;
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
async function writeActive(config, session) {
|
|
405
|
-
await writeJsonAtomic(config.sessionFile, session);
|
|
406
|
-
}
|
|
407
|
-
async function clearActive(config) {
|
|
408
|
-
try {
|
|
409
|
-
await unlink(config.sessionFile);
|
|
410
|
-
} catch {
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
async function logSession(config, session, endedAt, endedBy) {
|
|
414
|
-
const startedAt = parseISO(session.startedAt);
|
|
415
|
-
if (!startedAt) return null;
|
|
416
|
-
const actualMinutes = Math.round((endedAt.getTime() - startedAt.getTime()) / 6e4);
|
|
417
|
-
if (actualMinutes < MIN_LOGGABLE_MINUTES) return null;
|
|
418
|
-
const entry = {
|
|
419
|
-
id: session.id,
|
|
420
|
-
title: session.title,
|
|
421
|
-
startedAt: session.startedAt,
|
|
422
|
-
endedAt: endedAt.toISOString(),
|
|
423
|
-
plannedMinutes: session.minutes,
|
|
424
|
-
actualMinutes,
|
|
425
|
-
reachedTarget: actualMinutes >= session.minutes,
|
|
426
|
-
advancesObjective: session.advancesObjective,
|
|
427
|
-
endedBy
|
|
428
|
-
};
|
|
429
|
-
await mkdir2(config.dataDir, { recursive: true });
|
|
430
|
-
await appendFile(config.sessionsLogFile, `${JSON.stringify(entry)}
|
|
431
|
-
`, "utf8");
|
|
432
|
-
return entry;
|
|
433
|
-
}
|
|
434
|
-
async function startSession(config, opts) {
|
|
435
|
-
const now = opts.now ?? /* @__PURE__ */ new Date();
|
|
436
|
-
await stopSession(config, now);
|
|
437
|
-
await writeActive(config, {
|
|
438
|
-
id: opts.id,
|
|
439
|
-
title: opts.title,
|
|
440
|
-
startedAt: now.toISOString(),
|
|
441
|
-
minutes: opts.minutes,
|
|
442
|
-
advancesObjective: opts.advancesObjective,
|
|
443
|
-
// The click that got here is itself the first evidence of a person.
|
|
444
|
-
lastActiveAt: now.toISOString()
|
|
445
|
-
});
|
|
446
|
-
}
|
|
447
|
-
async function stopSession(config, now = /* @__PURE__ */ new Date(), endedBy = "user") {
|
|
448
|
-
const active = await readActive(config);
|
|
449
|
-
if (!active) return null;
|
|
450
|
-
await logSession(config, active, now, endedBy);
|
|
451
|
-
await clearActive(config);
|
|
452
|
-
return active;
|
|
453
|
-
}
|
|
454
|
-
async function reconcileSession(config, probe, now = /* @__PURE__ */ new Date()) {
|
|
455
|
-
if (config.awayAfterMinutes <= 0) return null;
|
|
456
|
-
const active = await readActive(config);
|
|
457
|
-
if (!active) return null;
|
|
458
|
-
const startedAt = parseISO(active.startedAt);
|
|
459
|
-
if (!startedAt) {
|
|
460
|
-
await clearActive(config);
|
|
461
|
-
return null;
|
|
462
|
-
}
|
|
463
|
-
const awayAfterMs = config.awayAfterMinutes * 6e4;
|
|
464
|
-
const previous = parseISO(active.lastActiveAt) ?? startedAt;
|
|
465
|
-
if (now.getTime() - previous.getTime() > awayAfterMs) {
|
|
466
|
-
const logged = await logSession(config, active, previous, "away");
|
|
467
|
-
await clearActive(config);
|
|
468
|
-
return logged;
|
|
469
|
-
}
|
|
470
|
-
const idleSeconds = await probe();
|
|
471
|
-
const lastInput = idleSeconds === null ? now : new Date(now.getTime() - Math.max(0, idleSeconds) * 1e3);
|
|
472
|
-
const confirmed = lastInput.getTime() > previous.getTime() ? lastInput : previous;
|
|
473
|
-
if (confirmed.toISOString() !== active.lastActiveAt) {
|
|
474
|
-
await writeActive(config, { ...active, lastActiveAt: confirmed.toISOString() });
|
|
475
|
-
}
|
|
476
|
-
return null;
|
|
477
|
-
}
|
|
478
|
-
async function closeIfPastBackstop(config, active, now) {
|
|
479
|
-
if (!active) return null;
|
|
480
|
-
const startedAt = parseISO(active.startedAt);
|
|
481
|
-
const elapsed = startedAt ? (now.getTime() - startedAt.getTime()) / 6e4 : Infinity;
|
|
482
|
-
if (elapsed <= MAX_SESSION_MINUTES) return active;
|
|
483
|
-
const ceiling = new Date((startedAt?.getTime() ?? now.getTime()) + MAX_SESSION_MINUTES * 6e4);
|
|
484
|
-
await stopSession(config, ceiling, "limit");
|
|
485
|
-
return null;
|
|
486
|
-
}
|
|
487
|
-
function lastUnattendedClose(todayLog) {
|
|
488
|
-
const last = todayLog.at(-1);
|
|
489
|
-
if (!last || last.endedBy === void 0 || last.endedBy === "user") return null;
|
|
490
|
-
return {
|
|
491
|
-
id: last.id,
|
|
492
|
-
title: last.title,
|
|
493
|
-
endedAt: last.endedAt,
|
|
494
|
-
actualMinutes: last.actualMinutes,
|
|
495
|
-
reason: last.endedBy
|
|
496
|
-
};
|
|
497
|
-
}
|
|
498
|
-
async function readSessionState(config, agenda, now = /* @__PURE__ */ new Date()) {
|
|
499
|
-
const active = await closeIfPastBackstop(config, await readActive(config), now);
|
|
500
|
-
const todayLog = await readTodaysSessions(config, now);
|
|
501
|
-
const completedToday = todayLog.length;
|
|
502
|
-
const minutesToday = todayLog.reduce((sum, entry) => sum + entry.actualMinutes, 0);
|
|
503
|
-
const unattendedClose = active ? null : lastUnattendedClose(todayLog);
|
|
504
|
-
if (!active) {
|
|
505
|
-
return { active: null, completedToday, minutesToday, unattendedClose };
|
|
506
|
-
}
|
|
507
|
-
const startedAt = parseISO(active.startedAt);
|
|
508
|
-
const endsAt = new Date(startedAt.getTime() + active.minutes * 6e4);
|
|
509
|
-
const remainingSeconds = Math.round((endsAt.getTime() - now.getTime()) / 1e3);
|
|
510
|
-
const nextEvent = agenda.events.map((event) => parseISO(event.start)).filter((start) => start !== null && start.getTime() > now.getTime()).sort((a, b) => a.getTime() - b.getTime())[0];
|
|
511
|
-
return {
|
|
512
|
-
active: {
|
|
513
|
-
id: active.id,
|
|
514
|
-
title: active.title,
|
|
515
|
-
startedAt: active.startedAt,
|
|
516
|
-
advancesObjective: active.advancesObjective,
|
|
517
|
-
lastActiveAt: active.lastActiveAt,
|
|
518
|
-
endsAt: endsAt.toISOString(),
|
|
519
|
-
minutes: active.minutes,
|
|
520
|
-
remainingSeconds,
|
|
521
|
-
overrun: remainingSeconds < 0,
|
|
522
|
-
collidesWithNextEvent: nextEvent ? nextEvent.getTime() < endsAt.getTime() : false,
|
|
523
|
-
nextEventAt: nextEvent ? nextEvent.toISOString() : null
|
|
524
|
-
},
|
|
525
|
-
completedToday,
|
|
526
|
-
minutesToday,
|
|
527
|
-
unattendedClose
|
|
528
|
-
};
|
|
529
|
-
}
|
|
530
|
-
async function readSessions(config) {
|
|
531
|
-
let text;
|
|
532
|
-
try {
|
|
533
|
-
text = await readFile2(config.sessionsLogFile, "utf8");
|
|
534
|
-
} catch {
|
|
535
|
-
return [];
|
|
536
|
-
}
|
|
537
|
-
const sessions = [];
|
|
538
|
-
for (const line of text.split("\n")) {
|
|
539
|
-
if (line.trim() === "") continue;
|
|
540
|
-
try {
|
|
541
|
-
const entry = JSON.parse(line);
|
|
542
|
-
if (entry?.id && entry.startedAt) sessions.push(entry);
|
|
543
|
-
} catch {
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
return sessions;
|
|
547
|
-
}
|
|
548
|
-
async function readTodaysSessions(config, now) {
|
|
549
|
-
const all = await readSessions(config);
|
|
550
|
-
return all.filter((entry) => {
|
|
551
|
-
const started = parseISO(entry.startedAt);
|
|
552
|
-
return started !== null && started.getFullYear() === now.getFullYear() && started.getMonth() === now.getMonth() && started.getDate() === now.getDate();
|
|
553
|
-
});
|
|
554
|
-
}
|
|
555
|
-
|
|
556
393
|
// src/store.ts
|
|
557
394
|
import { createHash } from "node:crypto";
|
|
558
|
-
import { appendFile
|
|
395
|
+
import { appendFile, mkdir as mkdir2, readFile as readFile2, stat } from "node:fs/promises";
|
|
559
396
|
import { setTimeout as delay } from "node:timers/promises";
|
|
560
397
|
|
|
561
398
|
// src/agenda.ts
|
|
@@ -712,7 +549,7 @@ var Store = class {
|
|
|
712
549
|
this.config = config;
|
|
713
550
|
}
|
|
714
551
|
async ensureDataDir() {
|
|
715
|
-
await
|
|
552
|
+
await mkdir2(this.config.dataDir, { recursive: true });
|
|
716
553
|
}
|
|
717
554
|
/**
|
|
718
555
|
* Which store this is, as an opaque fingerprint: its path, and the directory's
|
|
@@ -740,7 +577,7 @@ var Store = class {
|
|
|
740
577
|
for (let attempt = 0; attempt < READ_RETRIES; attempt++) {
|
|
741
578
|
let text;
|
|
742
579
|
try {
|
|
743
|
-
text = await
|
|
580
|
+
text = await readFile2(this.config.itemsFile, "utf8");
|
|
744
581
|
} catch (err) {
|
|
745
582
|
if (err.code === "ENOENT") {
|
|
746
583
|
return {
|
|
@@ -761,7 +598,7 @@ var Store = class {
|
|
|
761
598
|
async readActions() {
|
|
762
599
|
let text;
|
|
763
600
|
try {
|
|
764
|
-
text = await
|
|
601
|
+
text = await readFile2(this.config.actionsFile, "utf8");
|
|
765
602
|
} catch (err) {
|
|
766
603
|
if (err.code === "ENOENT") return [];
|
|
767
604
|
throw err;
|
|
@@ -793,7 +630,7 @@ var Store = class {
|
|
|
793
630
|
/** Read the standing objective. Returns null when focus.md hasn't been written. */
|
|
794
631
|
async readFocus() {
|
|
795
632
|
try {
|
|
796
|
-
return parseFocus(await
|
|
633
|
+
return parseFocus(await readFile2(this.config.focusFile, "utf8"));
|
|
797
634
|
} catch (err) {
|
|
798
635
|
if (err.code === "ENOENT") return null;
|
|
799
636
|
console.warn(`[daily-focus] could not read focus.md: ${err.message}`);
|
|
@@ -806,7 +643,7 @@ var Store = class {
|
|
|
806
643
|
`;
|
|
807
644
|
const write = this.#writeQueue.then(async () => {
|
|
808
645
|
await this.ensureDataDir();
|
|
809
|
-
await
|
|
646
|
+
await appendFile(this.config.actionsFile, line, "utf8");
|
|
810
647
|
});
|
|
811
648
|
this.#writeQueue = write.catch(() => {
|
|
812
649
|
});
|
|
@@ -874,12 +711,10 @@ var Store = class {
|
|
|
874
711
|
}
|
|
875
712
|
objectiveProgress = computeObjectiveProgress(withToday, actions, now, isRunDay);
|
|
876
713
|
}
|
|
877
|
-
const session = await readSessionState(this.config, agenda, now);
|
|
878
714
|
return {
|
|
879
715
|
// toPublicFocus, not focus — the agent-only section must never be serialised.
|
|
880
716
|
focus: focus ? toPublicFocus(focus) : null,
|
|
881
717
|
objectiveProgress,
|
|
882
|
-
session,
|
|
883
718
|
schedule: {
|
|
884
719
|
days: [...schedule.days],
|
|
885
720
|
source: schedule.source,
|
|
@@ -998,9 +833,6 @@ export {
|
|
|
998
833
|
setsStatus,
|
|
999
834
|
readArchiveIndex,
|
|
1000
835
|
runContractChecks,
|
|
1001
|
-
startSession,
|
|
1002
|
-
stopSession,
|
|
1003
|
-
reconcileSession,
|
|
1004
836
|
Store,
|
|
1005
837
|
foldActionLog,
|
|
1006
838
|
resolveItems
|
|
@@ -440,15 +440,10 @@ function loadConfig(env = loadEnv()) {
|
|
|
440
440
|
schemaFile: resolve2(dataDir, "items.schema.json"),
|
|
441
441
|
schemaSource: resolve2(import.meta.dirname, "..", "schema", "items.schema.json"),
|
|
442
442
|
archiveDir: resolve2(dataDir, "archive"),
|
|
443
|
-
sessionFile: resolve2(dataDir, "session.json"),
|
|
444
|
-
sessionsLogFile: resolve2(dataDir, "sessions.jsonl"),
|
|
445
443
|
pullsFile: resolve2(dataDir, "prs.json"),
|
|
446
444
|
calendarFile: resolve2(dataDir, "calendar.json"),
|
|
447
445
|
ticketsFile: resolve2(dataDir, "tickets.json"),
|
|
448
446
|
timeZoneFile: resolve2(dataDir, "timezone.json"),
|
|
449
|
-
// The same 1 to 120 the session endpoint holds a start to.
|
|
450
|
-
sessionMinutes: envBounded("DAILY_FOCUS_SESSION_MINUTES", 25, 1, 120, env),
|
|
451
|
-
awayAfterMinutes: envBounded("DAILY_FOCUS_AWAY_AFTER", profile === "personal" ? 0 : 10, 0, 24 * 60, env),
|
|
452
447
|
port: envBounded("DAILY_FOCUS_PORT", 4321, 0, 65535, env),
|
|
453
448
|
host: envString("DAILY_FOCUS_HOST", "127.0.0.1", env),
|
|
454
449
|
freeWindows: envFlag("DAILY_FOCUS_FREE_WINDOWS", profile !== "personal", env),
|
package/dist/cli.js
CHANGED
|
@@ -49,7 +49,7 @@ function shouldOpen(flag) {
|
|
|
49
49
|
return flag && process.stdout.isTTY === true && !process.env.CI;
|
|
50
50
|
}
|
|
51
51
|
async function demo(open, profile) {
|
|
52
|
-
const { demoEnv, demoIntegrations, demoProfile, writeDemoStore } = await import("./demo-
|
|
52
|
+
const { demoEnv, demoIntegrations, demoProfile, writeDemoStore } = await import("./demo-6Q22AAC7.js");
|
|
53
53
|
const chosen = demoProfile(profile);
|
|
54
54
|
const store = await mkdtemp(join(tmpdir(), "daily-focus-demo-"));
|
|
55
55
|
process.on("exit", () => rmSync(store, { recursive: true, force: true }));
|
|
@@ -65,7 +65,7 @@ async function demo(open, profile) {
|
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
67
|
async function start(open, onStarted, options = {}) {
|
|
68
|
-
const { runServer } = await import("./server-
|
|
68
|
+
const { runServer } = await import("./server-PIYOIUKJ.js");
|
|
69
69
|
await runServer({
|
|
70
70
|
...options,
|
|
71
71
|
onStarted: (url) => {
|
|
@@ -162,20 +162,20 @@ async function main(argv) {
|
|
|
162
162
|
}
|
|
163
163
|
return start(open);
|
|
164
164
|
case "service": {
|
|
165
|
-
const { main: service } = await import("./service-
|
|
165
|
+
const { main: service } = await import("./service-ZUHI3VKH.js");
|
|
166
166
|
process.exitCode = await service(values.remove ? ["--remove"] : []);
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
169
169
|
// These three are scripts that do their work as they load, and read their
|
|
170
170
|
// own flags from the command line.
|
|
171
171
|
case "init":
|
|
172
|
-
await import("./init-
|
|
172
|
+
await import("./init-XDMAXU2S.js");
|
|
173
173
|
return;
|
|
174
174
|
case "audit":
|
|
175
|
-
await import("./audit-
|
|
175
|
+
await import("./audit-DNTFZOHH.js");
|
|
176
176
|
return;
|
|
177
177
|
case "seed":
|
|
178
|
-
await import("./seed-
|
|
178
|
+
await import("./seed-TWT7EDXJ.js");
|
|
179
179
|
return;
|
|
180
180
|
case "build-calendar":
|
|
181
181
|
return buildCalendar();
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
dateFromNow,
|
|
6
6
|
sampleBrief,
|
|
7
7
|
sampleGeneratedAt
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-P3E2B2SD.js";
|
|
9
9
|
import {
|
|
10
10
|
PROFILES,
|
|
11
11
|
localDateKey
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KZNY45XW.js";
|
|
13
13
|
import "./chunk-BC2W7NND.js";
|
|
14
14
|
|
|
15
15
|
// src/demo.ts
|
|
@@ -77,7 +77,6 @@ function demoEnv(base, store, profile) {
|
|
|
77
77
|
DAILY_FOCUS_WORK_START: "",
|
|
78
78
|
DAILY_FOCUS_WORK_END: "",
|
|
79
79
|
DAILY_FOCUS_MIN_FREE_WINDOW: "",
|
|
80
|
-
DAILY_FOCUS_SESSION_MINUTES: "",
|
|
81
80
|
DAILY_FOCUS_STALE_AFTER_HOURS: ""
|
|
82
81
|
};
|
|
83
82
|
}
|
|
@@ -606,23 +605,6 @@ function demoActions(profile, now) {
|
|
|
606
605
|
];
|
|
607
606
|
return actions.sort((a, b) => a.at.localeCompare(b.at));
|
|
608
607
|
}
|
|
609
|
-
function demoSessions(profile, now) {
|
|
610
|
-
const session = (id, title, startMinutesAgo, actualMinutes, advancesObjective, endedBy) => ({
|
|
611
|
-
id,
|
|
612
|
-
title,
|
|
613
|
-
startedAt: minutesAgo(now, startMinutesAgo),
|
|
614
|
-
endedAt: minutesAgo(now, startMinutesAgo - actualMinutes),
|
|
615
|
-
plannedMinutes: 25,
|
|
616
|
-
actualMinutes,
|
|
617
|
-
reachedTarget: actualMinutes >= 25,
|
|
618
|
-
advancesObjective,
|
|
619
|
-
endedBy
|
|
620
|
-
});
|
|
621
|
-
return profile === "work" ? [
|
|
622
|
-
session("github:pr:acme/webapp#3402", "CI failing on your PR: Add trace context to fetch instrumentation", 190, 22, false, "away"),
|
|
623
|
-
session("gtasks:task:MTU3NDkyODkwMjE2NDcx", "Write up the staging repro steps for the checkout breakage", 150, 42, true, "user")
|
|
624
|
-
] : [session("email:thread:19a0c4e2f1", "Chase Nordvarme for the loft insulation quote", 80, 18, true, "user")];
|
|
625
|
-
}
|
|
626
608
|
function runLines(seed) {
|
|
627
609
|
const endedAt = new Date(new Date(seed.startedAt).getTime() + seed.seconds * 1e3).toISOString();
|
|
628
610
|
const lines2 = [{ event: "started", run: seed.id, cli: "codex", trigger: seed.trigger, at: seed.startedAt }];
|
|
@@ -872,7 +854,6 @@ async function writeDemoStore(store, profile, now = /* @__PURE__ */ new Date())
|
|
|
872
854
|
await writeFile(join(store, "focus.md"), FOCUS[profile], "utf8");
|
|
873
855
|
await writeFile(join(store, "sources.md"), SOURCES[profile], "utf8");
|
|
874
856
|
await writeFile(join(store, "actions.jsonl"), lines(demoActions(profile, now)), "utf8");
|
|
875
|
-
await writeFile(join(store, "sessions.jsonl"), lines(demoSessions(profile, now)), "utf8");
|
|
876
857
|
await writeFile(join(store, "agent.jsonl"), lines(demoAgentLog(profile, now)), "utf8");
|
|
877
858
|
await writeFile(join(store, "assistant.jsonl"), lines(demoAssistantLog(profile, now)), "utf8");
|
|
878
859
|
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-QKT2FAB5.js";
|
|
9
9
|
import {
|
|
10
10
|
loadConfig
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-KZNY45XW.js";
|
|
12
12
|
import {
|
|
13
13
|
PACKAGED,
|
|
14
14
|
command
|
|
@@ -78,15 +78,7 @@ for (const outcome of await linkStore(config)) {
|
|
|
78
78
|
section("Files you do not own");
|
|
79
79
|
kept("items.json", "the briefing agent writes it; absent reads as no brief yet");
|
|
80
80
|
kept("actions.jsonl", "the dashboard appends to it as you action things");
|
|
81
|
-
kept("sessions.jsonl", "the dashboard appends to it as you run focus sessions");
|
|
82
81
|
kept("assistant.jsonl", "the dashboard appends to it as you ask the assistant for help");
|
|
83
|
-
if (platform() !== "darwin") {
|
|
84
|
-
section("Note");
|
|
85
|
-
kept(
|
|
86
|
-
"idle detection is macOS-only",
|
|
87
|
-
"focus sessions still work; they just fall back to the two-hour backstop instead of closing when you walk away"
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
82
|
var next = [];
|
|
91
83
|
if (wroteFocus) next.push(`Edit ${config.focusFile} \u2014 say what you are trying to achieve.`);
|
|
92
84
|
if (wroteSources) next.push(`Edit ${config.sourcesFile} \u2014 say where to look.`);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sampleBrief
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-P3E2B2SD.js";
|
|
4
4
|
import {
|
|
5
5
|
Store
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GQ3NCWRT.js";
|
|
7
7
|
import {
|
|
8
8
|
loadConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KZNY45XW.js";
|
|
10
10
|
import {
|
|
11
11
|
command
|
|
12
12
|
} from "./chunk-BC2W7NND.js";
|