daily-focus 1.2.0-dev.7 → 1.2.0-dev.9

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/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-5I4BNHW2.js");
52
+ const { demoEnv, demoIntegrations, demoProfile, writeDemoStore } = await import("./demo-TIIXODJG.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-UI6WYRTL.js");
68
+ const { runServer } = await import("./server-WT4CQ3VX.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-NAAAV67B.js");
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-57WHZZNG.js");
172
+ await import("./init-XDMAXU2S.js");
173
173
  return;
174
174
  case "audit":
175
- await import("./audit-7YAJYHZF.js");
175
+ await import("./audit-DNTFZOHH.js");
176
176
  return;
177
177
  case "seed":
178
- await import("./seed-BLFBCHIA.js");
178
+ await import("./seed-TWT7EDXJ.js");
179
179
  return;
180
180
  case "build-calendar":
181
181
  return buildCalendar();
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  QUICK_ACTIONS
3
- } from "./chunk-SX5FPS3A.js";
3
+ } from "./chunk-KL6RU4XT.js";
4
4
  import {
5
5
  dateFromNow,
6
6
  sampleBrief,
7
7
  sampleGeneratedAt
8
- } from "./chunk-UY6HQLGE.js";
8
+ } from "./chunk-P3E2B2SD.js";
9
9
  import {
10
10
  PROFILES,
11
11
  localDateKey
12
- } from "./chunk-RNE27FQY.js";
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 }];
@@ -755,6 +737,8 @@ function demoAgentLog(profile, now) {
755
737
  ];
756
738
  return runs.flatMap(runLines);
757
739
  }
740
+ var call = (text, detail, state = "done") => ({ kind: "tool", text, detail, state });
741
+ var said = (text) => ({ kind: "message", text, detail: null, state: "done" });
758
742
  function turnLines(seed) {
759
743
  const quick = seed.action ? QUICK_ACTIONS.find((candidate) => candidate.id === seed.action) : void 0;
760
744
  const request = quick ? seed.text ? `${quick.request}
@@ -763,7 +747,7 @@ ${seed.text}` : quick.request : seed.text ?? "";
763
747
  const endedAt = new Date(new Date(seed.at).getTime() + seed.seconds * 1e3).toISOString();
764
748
  return [
765
749
  { event: "started", turn: seed.id, item: seed.item, agent: "claude", request, action: quick?.id ?? null, at: seed.at },
766
- { event: "finished", turn: seed.id, sessionId: `sample-${seed.item}`, reply: seed.reply, at: endedAt }
750
+ { event: "finished", turn: seed.id, sessionId: `sample-${seed.item}`, reply: seed.reply, steps: seed.steps, at: endedAt }
767
751
  ];
768
752
  }
769
753
  function demoAssistantLog(profile, now) {
@@ -775,6 +759,12 @@ function demoAssistantLog(profile, now) {
775
759
  action: "summarise-pr",
776
760
  at: minutesAgo(now, 46),
777
761
  seconds: 52,
762
+ steps: [
763
+ call("View the pull request", "gh pr view 3421 --repo acme/webapp --json title,body,files,reviews"),
764
+ call("Read the diff", "gh pr diff 3421 --repo acme/webapp"),
765
+ said("Four files. The recorder change is the substance; the rest is its tests and a type."),
766
+ call("Read the issue it closes", "gh issue view 3388 --repo acme/webapp --comments")
767
+ ],
778
768
  reply: [
779
769
  "**What it changes.** Session replay keeps every recorded mutation batch in an array on the recorder for the life of the tab, and only ever appends; on a tab left open for a day that is hundreds of megabytes. The change caps the buffer per tab, drops batches once the ingest endpoint has acknowledged them, and holds DOM node references through a `WeakRef` so a detached subtree can be collected.",
780
770
  "",
@@ -796,6 +786,11 @@ function demoAssistantLog(profile, now) {
796
786
  text: "Is the Safari fallback actually reachable?",
797
787
  at: minutesAgo(now, 44),
798
788
  seconds: 31,
789
+ steps: [
790
+ call("Find where the fallback is chosen", 'gh search code "WeakRef" --repo acme/webapp'),
791
+ call("Read the SDK docs on browser support", "gh api repos/acme/sdk-docs/contents/support.md", "failed"),
792
+ call("Read the webapp's copy of the support matrix", "gh api repos/acme/webapp/contents/docs/browser-support.md")
793
+ ],
799
794
  reply: "Only on Safari 14.0 and below, which the SDK\u2019s support matrix dropped in v5. Under the current matrix the branch is dead code. I would ask Alice to remove it rather than test it."
800
795
  },
801
796
  {
@@ -804,10 +799,18 @@ function demoAssistantLog(profile, now) {
804
799
  action: "draft-reply",
805
800
  at: minutesAgo(now, 38),
806
801
  seconds: 64,
802
+ steps: [
803
+ call("Gmail: get thread", '{"threadId":"18f2a9c4b7"}'),
804
+ call("Gmail: search threads", '{"query":"Q4 planning doc headcount"}'),
805
+ said("Bob wants numbers per team with a reason each. The planning doc has both."),
806
+ call("Gmail: create draft", '{"threadId":"18f2a9c4b7"}')
807
+ ],
807
808
  reply: [
808
809
  "I read the thread \u2014 four messages, Bob twice. He wants the Q4 team split: how many of the six open roles go to Platform and how many to Webapp, with a line of justification each, by the end of the week so it lands in the planning deck.",
809
810
  "",
810
- "I have created a Gmail draft on the thread, from you, proposing four Platform and two Webapp with the reasons from the planning doc, and asking whether the deck can carry a footnote that the SDK hire depends on the Q3 numbers. It is **not sent**; it is waiting on the thread when you open it."
811
+ "I have created a Gmail draft on the thread, from you, proposing four Platform and two Webapp with the reasons from the planning doc, and asking whether the deck can carry a footnote that the SDK hire depends on the Q3 numbers. It is **not sent**; it is waiting on the thread when you open it.",
812
+ "",
813
+ "Created: [Gmail draft](https://mail.google.com/mail/u/0/#drafts?compose=18f2a9c4b7)"
811
814
  ].join("\n")
812
815
  },
813
816
  {
@@ -816,6 +819,12 @@ function demoAssistantLog(profile, now) {
816
819
  action: "explain-ci",
817
820
  at: minutesAgo(now, 20),
818
821
  seconds: 58,
822
+ steps: [
823
+ call("List the checks", "gh pr checks 3402 --repo acme/webapp"),
824
+ call("Read the failing job\u2019s log", "gh run view 9182734 --repo acme/webapp --log-failed"),
825
+ said("One failure, in tracing/fetch.spec.ts. Reading the retry path it exercises."),
826
+ call("Read the retry code", "gh api repos/acme/webapp/contents/src/tracing/fetch.ts")
827
+ ],
819
828
  reply: [
820
829
  "The failing check is `unit-tests (node-20)`, in `tracing/fetch.spec.ts`:",
821
830
  "",
@@ -835,6 +844,10 @@ function demoAssistantLog(profile, now) {
835
844
  action: "summarise-pr",
836
845
  at: minutesAgo(now, 52),
837
846
  seconds: 47,
847
+ steps: [
848
+ call("View the pull request", "gh pr view 47 --repo mara-l/pedalboard --json title,body,files,commits"),
849
+ call("Read the diff", "gh pr diff 47 --repo mara-l/pedalboard")
850
+ ],
838
851
  reply: [
839
852
  "Tomas adds MIDI clock sync to the looper: the transport listens for MIDI clock at 24 pulses per quarter note and for start and stop, derives the tempo, and quantises the loop start to the next beat. +212/\u221218 across three files, with a test for the tempo derivation.",
840
853
  "",
@@ -853,7 +866,8 @@ function demoAssistantLog(profile, now) {
853
866
  action: "draft-reply",
854
867
  at: minutesAgo(now, 30),
855
868
  seconds: 41,
856
- reply: "The thread is three messages: your request on the 28th, their \u201Cwithin the week\u201D on the 29th, and nothing since. I have created a Gmail draft on it that asks, briefly and politely, whether the quote is still coming this week, and says the other quotes are in and you would like to decide by Friday. It is **not sent**; open the thread to read it."
869
+ steps: [call("Gmail: get thread", '{"threadId":"19a0c4e2f1"}'), call("Gmail: create draft", '{"threadId":"19a0c4e2f1"}')],
870
+ reply: "The thread is three messages: your request on the 28th, their \u201Cwithin the week\u201D on the 29th, and nothing since. I have created a Gmail draft on it that asks, briefly and politely, whether the quote is still coming this week, and says the other quotes are in and you would like to decide by Friday. It is **not sent**; open the thread to read it.\n\nCreated: [Gmail draft](https://mail.google.com/mail/u/0/#drafts?compose=19a0c4e2f1)"
857
871
  }
858
872
  ];
859
873
  return turns.flatMap(turnLines);
@@ -872,7 +886,6 @@ async function writeDemoStore(store, profile, now = /* @__PURE__ */ new Date())
872
886
  await writeFile(join(store, "focus.md"), FOCUS[profile], "utf8");
873
887
  await writeFile(join(store, "sources.md"), SOURCES[profile], "utf8");
874
888
  await writeFile(join(store, "actions.jsonl"), lines(demoActions(profile, now)), "utf8");
875
- await writeFile(join(store, "sessions.jsonl"), lines(demoSessions(profile, now)), "utf8");
876
889
  await writeFile(join(store, "agent.jsonl"), lines(demoAgentLog(profile, now)), "utf8");
877
890
  await writeFile(join(store, "assistant.jsonl"), lines(demoAssistantLog(profile, now)), "utf8");
878
891
  }
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-QKT2FAB5.js";
9
9
  import {
10
10
  loadConfig
11
- } from "./chunk-RNE27FQY.js";
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-UY6HQLGE.js";
3
+ } from "./chunk-P3E2B2SD.js";
4
4
  import {
5
5
  Store
6
- } from "./chunk-JQGYCWRX.js";
6
+ } from "./chunk-GQ3NCWRT.js";
7
7
  import {
8
8
  loadConfig
9
- } from "./chunk-RNE27FQY.js";
9
+ } from "./chunk-KZNY45XW.js";
10
10
  import {
11
11
  command
12
12
  } from "./chunk-BC2W7NND.js";