@flowmind/cli 0.2.1 → 0.2.2

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 CHANGED
@@ -18,7 +18,9 @@ because hooks start without your shell profile and a version manager may not put
18
18
  Codex on Windows gets a PowerShell command (`& '<node>' '<cli>' agent hook --agent codex`).
19
19
  After you upgrade Node or move the CLI, `hooks status` shows `outdated`; run `hooks install` again
20
20
  and trust the changed hooks. The hook records each agent turn under the CLI config folder.
21
- In a linked repository, the session-start hook tells the agent which project it works on.
21
+ In a linked repository, the session-start hook tells the agent which project it works on. Once 20 or more minutes of
22
+ finished agent turns are unstaged, each prompt also carries a reminder with the minutes and the
23
+ staging command. A successful `agent stage` resets the count.
22
24
  Codex runs new hooks only after you trust them once in `/hooks`. `hooks status` shows both installs,
23
25
  and `hooks uninstall` removes only the Flowmind entries.
24
26
 
@@ -36,6 +36,7 @@ flowmind agent stage --intention "<what you set out to do>" --outcome "<what cha
36
36
  ```
37
37
 
38
38
  - The CLI reads the project from `.flowmind.json` and the time from the session record. A second stage in the same session covers only the time after the first.
39
+ - After 20 minutes of unstaged agent time, each prompt in a linked repository carries a reminder with the unstaged minutes. Stage when the current unit of work is complete; a stage with explicit times also resets the count.
39
40
  - Add `--dry-run` to preview the project and minutes without staging.
40
41
  - Pass `--project`, `--minutes`, and `--started-at` only when no session record exists. Use observed times only. Never estimate time from tokens or tool calls.
41
42
  - Write the intention and the outcome as one short sentence each. Never paste transcripts, terminal output, commit messages, issue titles, emails, or secrets.
package/dist/index.js CHANGED
@@ -2609,6 +2609,7 @@ ${list}` : " No active projects exist.")
2609
2609
  // src/agent-session.ts
2610
2610
  var RETENTION_MS = 30 * 24 * 60 * 60 * 1e3;
2611
2611
  var ACTIVE_WINDOW_MS = 2 * 24 * 60 * 60 * 1e3;
2612
+ var REMINDER_MINUTES = 20;
2612
2613
  var OPEN_TURN_LIMIT_MS = 12 * 60 * 60 * 1e3;
2613
2614
  var EVENTS = /* @__PURE__ */ new Set(["session", "start", "stop", "staged"]);
2614
2615
  var sessionsDir = () => join2(dirname2(config.path), "agent-sessions");
@@ -2665,6 +2666,14 @@ function sessionContext(projectName) {
2665
2666
  "Do not use `flowmind log` for agent work."
2666
2667
  ].join(" ");
2667
2668
  }
2669
+ function unstagedReminder(projectName, minutes) {
2670
+ return [
2671
+ `Flowmind: ${minutes} minutes of agent work in this session are not staged yet for "${plainText(projectName)}".`,
2672
+ "When the current unit of work is complete, stage it with",
2673
+ '`flowmind agent stage --intention "<goal>" --outcome "<what changed>" --json`',
2674
+ "and share the review URL."
2675
+ ].join(" ");
2676
+ }
2668
2677
  async function pruneOldSessions(now) {
2669
2678
  let names;
2670
2679
  try {
@@ -2697,7 +2706,7 @@ async function handleHook(agent, raw, now = /* @__PURE__ */ new Date()) {
2697
2706
  cwd: input2.cwd,
2698
2707
  turnId: input2.turnId
2699
2708
  });
2700
- return "";
2709
+ return promptReminder(input2.sessionId, input2.cwd, now);
2701
2710
  case "Stop":
2702
2711
  case "Interrupt":
2703
2712
  await append(input2.sessionId, { event: "stop", at, turnId: input2.turnId });
@@ -2736,6 +2745,12 @@ async function recordedTime(sessionId, now = /* @__PURE__ */ new Date()) {
2736
2745
  const events = await readEventsAt(sessionFile(sessionId));
2737
2746
  return events ? measureRecordedTime(events, now) : null;
2738
2747
  }
2748
+ async function promptReminder(sessionId, cwd, now) {
2749
+ const link = await readLink(cwd);
2750
+ if (!link) return "";
2751
+ const recorded = await recordedTime(sessionId, now);
2752
+ return recorded && recorded.minutes >= REMINDER_MINUTES ? unstagedReminder(link.name, recorded.minutes) : "";
2753
+ }
2739
2754
  async function markStaged(sessionId, cutoff, proposalId) {
2740
2755
  await append(sessionId, { event: "staged", at: cutoff, proposalId });
2741
2756
  }
@@ -3069,7 +3084,7 @@ agentCommand.command("stage").description("Stage completed agent work as a proje
3069
3084
  }
3070
3085
  spinner = options.json ? null : ora("Staging agent proof...").start();
3071
3086
  const proposal = await createAgentLogProposal(input2, idempotencyKey);
3072
- if (recorded && sessionId) await markStaged(sessionId, recorded.cutoff, proposal.id);
3087
+ if (sessionId) await markStaged(sessionId, recorded?.cutoff ?? now.toISOString(), proposal.id);
3073
3088
  spinner?.succeed("Agent proof staged");
3074
3089
  if (options.json) {
3075
3090
  console.log(JSON.stringify({ idempotencyKey, proposal }));
@@ -3492,15 +3507,14 @@ function hookCommand(agent) {
3492
3507
  const quote = (value) => `'${value.replaceAll("'", "'\\''")}'`;
3493
3508
  return `${quote(node)} ${quote(cli)} ${args}`;
3494
3509
  }
3495
- var handler = (agent, timeout, background = false) => ({
3510
+ var handler = (agent, timeout) => ({
3496
3511
  type: "command",
3497
3512
  command: hookCommand(agent),
3498
- timeout,
3499
- ...background ? { async: true } : {}
3513
+ timeout
3500
3514
  });
3501
3515
  var hookEvents = (agent) => agent === "codex" ? {
3502
3516
  SessionStart: { hooks: [handler("codex", 10)] },
3503
- UserPromptSubmit: { hooks: [handler("codex", 10, true)] },
3517
+ UserPromptSubmit: { hooks: [handler("codex", 10)] },
3504
3518
  Stop: { hooks: [handler("codex", 10)] },
3505
3519
  Interrupt: { hooks: [handler("codex", 3)] }
3506
3520
  } : {
@@ -5269,7 +5283,7 @@ var shipLogCommand = new Command10("ship-log").description("Read a project ship
5269
5283
 
5270
5284
  // src/index.ts
5271
5285
  var program = new Command11();
5272
- program.name("flowmind").description("Flowmind CLI (also installed as fm)").version("0.2.1").enablePositionalOptions();
5286
+ program.name("flowmind").description("Flowmind CLI (also installed as fm)").version("0.2.2").enablePositionalOptions();
5273
5287
  program.addCommand(agentCommand);
5274
5288
  program.addCommand(authCommand);
5275
5289
  program.addCommand(logCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowmind/cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "CLI for Flowmind — proof-of-effort hour ledger",
5
5
  "homepage": "https://www.flowmind.pro",
6
6
  "repository": {