claude-code-session-manager 0.133.1 → 0.135.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 (98) hide show
  1. package/dist/assets/AgentLibrary-DRlcF1YD.js +2 -0
  2. package/dist/assets/{AppSettings-DwnfV9-4.js → AppSettings-CBhYHKGI.js} +2 -2
  3. package/dist/assets/{Button-CObXxw7b.js → Button-DtBUGvGI.js} +1 -1
  4. package/dist/assets/{DocumentEditorPane-CgB5IuOY.js → DocumentEditorPane-C82c7Qtl.js} +1 -1
  5. package/dist/assets/{Extensions-Fuhshcl6.js → Extensions-Kn-oUD2_.js} +2 -2
  6. package/dist/assets/{History-DbUV4jxK.js → History-B4c3Uz9u.js} +2 -2
  7. package/dist/assets/{Library-COr79GyT.js → Library-1RpLT-aH.js} +1 -1
  8. package/dist/assets/{ListDetail-DY53nXya.js → ListDetail-xr0oxNkv.js} +1 -1
  9. package/dist/assets/{Panel-D7NX5iP8.js → Panel-O8XPrpJu.js} +1 -1
  10. package/dist/assets/{ProjectClaudeConfig-DuWzM8qA.js → ProjectClaudeConfig-DBGhhzg2.js} +5 -5
  11. package/dist/assets/{ProvenanceBadge-AnwE1p5X.js → ProvenanceBadge-DSaizfZL.js} +1 -1
  12. package/dist/assets/Scheduler-D2_5NyiR.js +16 -0
  13. package/dist/assets/{Settings-tt0VZCyz.js → Settings-Clgqb3Lq.js} +2 -2
  14. package/dist/assets/{SkillReferenceGraph-D_rxqWgq.js → SkillReferenceGraph-D80RA7kR.js} +1 -1
  15. package/dist/assets/{Skills-BVQPJZaF.js → Skills-DNG7tHSf.js} +10 -10
  16. package/dist/assets/{SourceChip-DC5XD8KC.js → SourceChip-D-Imzszd.js} +1 -1
  17. package/dist/assets/{SystemPrompt-XnvP0_cS.js → SystemPrompt-CGlOpUQA.js} +1 -1
  18. package/dist/assets/{TiptapBody-B_TNEADm.js → TiptapBody-CJFGfBdz.js} +28 -28
  19. package/dist/assets/{Toggle-CxQO8pGN.js → Toggle-0Ff0bPa_.js} +1 -1
  20. package/dist/assets/{ViewTabs-CEjnWPD9.js → ViewTabs-BCMYQwo_.js} +1 -1
  21. package/dist/assets/{VoiceButton-B-6gdmKe.js → VoiceButton-JzyC6DAB.js} +1 -1
  22. package/dist/assets/geist-sans-latin-300-normal-C3kkMBb6.woff2 +0 -0
  23. package/dist/assets/geist-sans-latin-400-normal-gapTbOY8.woff2 +0 -0
  24. package/dist/assets/geist-sans-latin-500-normal-uokXdC-Q.woff2 +0 -0
  25. package/dist/assets/geist-sans-latin-600-normal-DFOURf8L.woff2 +0 -0
  26. package/dist/assets/geist-sans-latin-700-normal-BmN9tIp5.woff2 +0 -0
  27. package/dist/assets/{historyTotals-dT8vcKzX.js → historyTotals-B01WPBwh.js} +1 -1
  28. package/dist/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  29. package/dist/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
  30. package/dist/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
  31. package/dist/assets/{index-5QIl5Kcd.css → index-CjQ_p5y7.css} +1 -1
  32. package/dist/assets/index-rt7pTODX.js +3116 -0
  33. package/dist/assets/newsreader-latin-400-italic-CEihAR-f.woff2 +0 -0
  34. package/dist/assets/newsreader-latin-400-normal-BFBkh4jY.woff2 +0 -0
  35. package/dist/assets/newsreader-latin-500-normal-B66TYsaK.woff2 +0 -0
  36. package/dist/assets/newsreader-latin-600-normal-30OJ_TG_.woff2 +0 -0
  37. package/dist/assets/newsreader-latin-700-normal-rIgV_oaK.woff2 +0 -0
  38. package/dist/index.html +2 -5
  39. package/dist-web/app.css +1 -1
  40. package/dist-web/app.js +409 -404
  41. package/dist-web/index.html +0 -3
  42. package/package.json +1 -1
  43. package/plugins/session-manager-dev/skills/develop/standards.md +1 -1
  44. package/scripts/scheduler-mcp-server.cjs +31 -0
  45. package/src/main/agentLibrary.cjs +27 -4
  46. package/src/main/build-info.json +4 -4
  47. package/src/main/chatRunner.cjs +9 -0
  48. package/src/main/config.cjs +22 -0
  49. package/src/main/crashDiagnostics.cjs +10 -2
  50. package/src/main/index.cjs +34 -25
  51. package/src/main/ipcSchemas.cjs +6 -0
  52. package/src/main/lib/agent-cli/agentCliEvents.cjs +8 -0
  53. package/src/main/lib/demo-video-kit/capture.cjs +4 -37
  54. package/src/main/lib/demo-video-kit/character.cjs +20 -2
  55. package/src/main/lib/demo-video-kit/checks.cjs +82 -1
  56. package/src/main/lib/demo-video-kit/frames.cjs +3 -28
  57. package/src/main/lib/demo-video-kit/playwrightLoader.cjs +67 -0
  58. package/src/main/lib/demo-video-kit/seedKit.cjs +2 -2
  59. package/src/main/lib/demo-video-kit/sound.cjs +5 -2
  60. package/src/main/lib/epic/epicMint.cjs +1 -3
  61. package/src/main/lib/epic/promptSessionsCreateEpic.cjs +37 -4
  62. package/src/main/lib/epic/restorableSessions.cjs +88 -0
  63. package/src/main/lib/feedback-remote/customerFeedbackAdminRoutes.cjs +56 -1
  64. package/src/main/lib/feedback-remote/customerFeedbackIpc.cjs +21 -3
  65. package/src/main/lib/feedback-remote/remoteAssets.cjs +25 -1
  66. package/src/main/lib/mcpToolCatalog.cjs +15 -0
  67. package/src/main/lib/persona-macro/agentPersonaSchema.cjs +10 -1
  68. package/src/main/lib/persona-macro/builtinMacros.cjs +3 -2
  69. package/src/main/lib/persona-macro/macroJobDispatch.cjs +3 -2
  70. package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +22 -0
  71. package/src/main/lib/prd/listPrdsSingleFlight.cjs +79 -0
  72. package/src/main/lib/prd/prdAgentType.cjs +17 -7
  73. package/src/main/lib/prd/prdFrontmatter.cjs +25 -1
  74. package/src/main/lib/scheduler/scheduleJobSchema.cjs +3 -0
  75. package/src/main/lib/telemetry/crashTelemetry.cjs +10 -5
  76. package/src/main/lib/telemetry/telemetryBoot.cjs +77 -4
  77. package/src/main/lib/telemetry/telemetryClient.cjs +54 -9
  78. package/src/main/lib/telemetry/telemetryConsent.cjs +3 -0
  79. package/src/main/lib/telemetry/telemetryCounters.cjs +7 -2
  80. package/src/main/lib/telemetry/telemetrySettings.cjs +5 -0
  81. package/src/main/promptSessionEvents.cjs +7 -1
  82. package/src/main/pty.cjs +2 -2
  83. package/src/main/runVerify.cjs +2 -2
  84. package/src/main/scheduler/prdParser.cjs +18 -2
  85. package/src/main/scheduler.cjs +156 -18
  86. package/src/main/seedAgentPersonas.cjs +24 -0
  87. package/src/main/seedStatus.cjs +5 -2
  88. package/src/main/telemetryIpc.cjs +1 -5
  89. package/src/main/templates/PRD_AUTHORING.md +2 -2
  90. package/src/preload/api.d.ts +37 -16
  91. package/src/preload/apiSurface.json +7 -0
  92. package/src/preload/index.cjs +3 -1
  93. package/src/seed/agents/demo-video-builder.md +7 -2
  94. package/src/seed/agents/project-home-builder.md +4 -2
  95. package/dist/assets/AgentLibrary-BTIBmZkM.js +0 -2
  96. package/dist/assets/Scheduler-BHfx0rXd.js +0 -16
  97. package/dist/assets/index-BLORXCcT.js +0 -3111
  98. package/src/main/lib/telemetry/telemetryBacklog.cjs +0 -607
@@ -51,7 +51,7 @@ const BUILTIN_MACROS = Object.freeze([
51
51
  tag: 'project-home-builder',
52
52
  surface: 'project-home',
53
53
  projects: ['*'],
54
- builtinVersion: 7,
54
+ builtinVersion: 8,
55
55
  job: Object.freeze({
56
56
  estimateMinutes: 60,
57
57
  entryKind: 'video',
@@ -64,9 +64,10 @@ const BUILTIN_MACROS = Object.freeze([
64
64
  "Generate a character and cute animated JavaScript video: a 30-second demo of this project as one self-contained HTML/JavaScript animation. Ground everything in what you read in the repository — invent an original mascot character whose look, name and personality match the project's theme and purpose, and tell the project's real goals and key features through it. The character, story and visuals must match the project's theme and purpose as read from the repository. Write the narration script first (hook, problem, solution, three features, call to action), then build every scene to match its line, with fun dynamic elements per the persona. Use the style named on a 'Video style: <name>' line in the additional instructions — Professional, Fun, Animated whiteboard, or Kinetic typography — otherwise pick the one that best fits the project. Narrate with Kokoro (kokoro-onnx) using a natural female (af_heart) or male (am_michael) voice per the audio policy in the persona. Save it with a single project_demo_video_write call passing htmlPath.",
65
65
  "Generate a character and cute animated JavaScript video: a demo of this project as one self-contained HTML/JavaScript animation, 60 seconds long when the additional instructions carry a 'Video length: 60' line and 30 seconds otherwise. Ground everything in what you read in the repository — invent an original mascot character whose look, name and personality match the project's theme and purpose, and tell the project's real goals and key features through it. The character, story and visuals must match the project's theme and purpose as read from the repository. Write the narration script first (hook, problem, solution, key features, call to action), then build every keystone to match its lines, with the pacing and fun dynamic elements per the persona. Use the style named on a 'Video style: <name>' line in the additional instructions — Professional, Fun, Animated whiteboard, or Kinetic typography — otherwise pick the one that best fits the project. Narrate with Kokoro (kokoro-onnx) using a natural female (af_heart) or male (am_michael) voice per the audio policy in the persona. Save it with a single project_demo_video_write call passing htmlPath.",
66
66
  "Generate a character and cute animated JavaScript video as one self-contained HTML/JavaScript animation, 60 seconds long when the additional instructions carry a 'Video length: 60' line and 30 seconds otherwise. The video kind is named on a 'Video kind: <name>' line in the additional instructions: Blog post (a video that presents the blog post named on the 'Video target:' line — a post path in this repository or a URL; read it and tell its real content) or Feature (a video about the feature named on the 'Video target:' line, found in the repository); with no Video kind line, make a Project demo of the whole project's main goals and key features. Ground everything in what you read in the repository (and the target) — invent an original mascot character whose look, name and personality match the subject's theme and purpose, and tell its real story through it. Write the narration script first (hook, problem, solution, key points, call to action), then build every keystone to match its lines, with the pacing and fun dynamic elements per the persona. Use the style named on a 'Video style: <name>' line in the additional instructions — Professional, Fun, Animated whiteboard, or Kinetic typography — otherwise pick the one that best fits. Narrate with Kokoro (kokoro-onnx) using a natural female (af_heart) or male (am_michael) voice per the audio policy in the persona. Save it with a single project_video_write call passing the htmlPath and the id on the 'Entry id' line.",
67
+ "Generate a character and cute animated JavaScript video as one self-contained HTML/JavaScript animation, 60 seconds long when the additional instructions carry a 'Video length: 60' line and 30 seconds otherwise; a 'Video length: 30' line means 30 seconds. The video kind is named on a 'Video kind: <name>' line in the additional instructions: Blog post (a video that presents the blog post named on the 'Video target:' line — a post path in this repository or a URL; read it and tell its real content) or Feature (a video about the feature named on the 'Video target:' line, found in the repository); with no Video kind line, make a Project demo of the whole project's main goals and key features. A 'Video kind: Project demo' line means that same whole-project demo. Ground everything in what you read in the repository (and the target) — invent an original mascot character whose look, name and personality match the subject's theme and purpose, and tell its real story through it. A 'Character: off' line means no mascot: make a type-led animation in the chosen style that tells the same real story through moving type and shapes, skip the character wherever the persona uses one (design, _character, project_character_write, lip-sync, the character self-check) and save meta.character as null; a 'Character: on' line or no Character line keeps the mascot. Write the narration script first (hook, problem, solution, key points, call to action), then build every keystone to match its lines, with the pacing and fun dynamic elements per the persona. Use the style named on a 'Video style: <name>' line in the additional instructions — Professional, Fun, Animated whiteboard, or Kinetic typography — otherwise pick the one that best fits. A 'Video style: Auto' line means the same: pick the style that best fits. Narrate with Kokoro (kokoro-onnx) using a natural female (af_heart) or male (am_michael) voice per the audio policy in the persona. Save it with a single project_video_write call passing the htmlPath and the id on the 'Entry id' line.",
67
68
  ]),
68
69
  prompt:
69
- "Generate a character and cute animated JavaScript video as one self-contained HTML/JavaScript animation, 60 seconds long when the additional instructions carry a 'Video length: 60' line and 30 seconds otherwise; a 'Video length: 30' line means 30 seconds. The video kind is named on a 'Video kind: <name>' line in the additional instructions: Blog post (a video that presents the blog post named on the 'Video target:' line — a post path in this repository or a URL; read it and tell its real content) or Feature (a video about the feature named on the 'Video target:' line, found in the repository); with no Video kind line, make a Project demo of the whole project's main goals and key features. A 'Video kind: Project demo' line means that same whole-project demo. Ground everything in what you read in the repository (and the target) — invent an original mascot character whose look, name and personality match the subject's theme and purpose, and tell its real story through it. A 'Character: off' line means no mascot: make a type-led animation in the chosen style that tells the same real story through moving type and shapes, skip the character wherever the persona uses one (design, _character, project_character_write, lip-sync, the character self-check) and save meta.character as null; a 'Character: on' line or no Character line keeps the mascot. Write the narration script first (hook, problem, solution, key points, call to action), then build every keystone to match its lines, with the pacing and fun dynamic elements per the persona. Use the style named on a 'Video style: <name>' line in the additional instructions — Professional, Fun, Animated whiteboard, or Kinetic typography — otherwise pick the one that best fits. A 'Video style: Auto' line means the same: pick the style that best fits. Narrate with Kokoro (kokoro-onnx) using a natural female (af_heart) or male (am_michael) voice per the audio policy in the persona. Save it with a single project_video_write call passing the htmlPath and the id on the 'Entry id' line.",
70
+ "Generate a cute animated JavaScript video with an original mascot character unless a Character: off line says otherwise, as one self-contained HTML/JavaScript animation, 60 seconds long when the additional instructions carry a 'Video length: 60' line and 30 seconds otherwise; a 'Video length: 30' line means 30 seconds. The video kind is named on a 'Video kind: <name>' line in the additional instructions: Blog post (a video that presents the blog post named on the 'Video target:' line — a post path in this repository or a URL; read it and tell its real content) or Feature (a video about the feature named on the 'Video target:' line, found in the repository); with no Video kind line, make a Project demo of the whole project's main goals and key features. A 'Video kind: Project demo' line means that same whole-project demo. Ground everything in what you read in the repository (and the target) — invent an original mascot character whose look, name and personality match the subject's theme and purpose, and tell its real story through it. A 'Character: off' line means no mascot: make a type-led animation in the chosen style that tells the same real story through moving type and shapes, skip the character wherever the persona uses one (design, _character, project_character_write, lip-sync, the character self-check) and save meta.character as null; a 'Character: on' line or no Character line keeps the mascot. Write the narration script first (hook, problem, solution, key points, call to action), then build every keystone to match its lines, with the pacing and fun dynamic elements per the persona. Use the style named on a 'Video style: <name>' line in the additional instructions — Professional, Fun, Animated whiteboard, or Kinetic typography — otherwise pick the one that best fits. A 'Video style: Auto' line means the same: pick the style that best fits. Narrate with Kokoro (kokoro-onnx) using a natural female (af_heart) or male (am_michael) voice per the audio policy in the persona. Save it with a single project_video_write call passing the htmlPath and the id on the 'Entry id' line.",
70
71
  }),
71
72
  Object.freeze({
72
73
  id: 'builtin-review-md-network',
@@ -112,11 +112,12 @@ async function dispatchMacroJob(
112
112
  goal,
113
113
  acceptanceCriteria: [
114
114
  `${artifactPaths[0]} is written during this run by the save tool your persona names, never by hand.`,
115
- 'Nothing in the repository is committed.',
115
+ 'Nothing in the repository is committed. No commit is the expected result: once the gate is green, end with SCHEDULER_VERDICT: PASS, never FAIL for the missing commit.',
116
116
  ],
117
117
  implementationNotes:
118
118
  `Work as the ${macro.agentName} persona (your system prompt) end to end. This build was started from Project Home and no one is watching: never stop to ask. `
119
- + 'Build outside the repository (mktemp -d under ~/.cache). SM_PROJECT_ROOT is the project main checkout; the save tool writes there, so omit its cwd.',
119
+ + 'Build outside the repository (mktemp -d under ~/.cache). SM_PROJECT_ROOT is the project main checkout; the save tool writes there, so omit its cwd. '
120
+ + 'This build is artifact-only (deliverable: artifact) and lands no commit by design: a green gate with no commit means SCHEDULER_VERDICT: PASS.',
120
121
  gate: absPaths.map((p) => buildGate(p, t)),
121
122
  };
122
123
  if (typeof effort === 'string' && PRD_EFFORT_LEVELS.includes(effort)) input.effort = effort;
@@ -259,6 +259,17 @@ const SHIPPED_PERSONA_SEEDS = deepFreeze({
259
259
  effort: "medium",
260
260
  },
261
261
  },
262
+ {
263
+ commit: "seed-v6-no-commit-pass",
264
+ bodySha256: "69890c9b83fb8f2f3a10ab2e0b6a932c3f86be9d7c1d40276113d08fc4d5ba28",
265
+ fm: {
266
+ description: "Reads a project and writes ONE Knowledge Page (Overview by default, or How it works, FAQ, or a custom topic) for its Project Home tab, then saves it with a single project_page_write call.",
267
+ tools: "Read, Grep, Glob, Bash, Write, Edit, mcp__session-manager-scheduler__project_home_write, mcp__session-manager-scheduler__project_page_write",
268
+ title: "Project Home — Builder",
269
+ model: "sonnet",
270
+ effort: "medium",
271
+ },
272
+ },
262
273
  ],
263
274
  "validator": [
264
275
  {
@@ -499,6 +510,17 @@ const SHIPPED_PERSONA_SEEDS = deepFreeze({
499
510
  effort: "max",
500
511
  },
501
512
  },
513
+ {
514
+ commit: "persona-stop-on-kit-failure",
515
+ bodySha256: "a7c0865ff50d55941a559dbae2d4e066545641e5925d7e68784002c39638ce5b",
516
+ fm: {
517
+ description: "30-second or 1-minute self-contained HTML/JS demo video for Project Home, saved via project_video_write.",
518
+ tools: "Read, Grep, Glob, Bash, Write, Edit, mcp__session-manager-scheduler__project_demo_video_write, mcp__session-manager-scheduler__project_video_write, mcp__session-manager-scheduler__project_character_write",
519
+ title: "Project Home — Demo Video",
520
+ model: "opus",
521
+ effort: "max",
522
+ },
523
+ },
502
524
  ],
503
525
  "blender-artist": [
504
526
  {
@@ -0,0 +1,79 @@
1
+ /**
2
+ * listPrdsSingleFlight.cjs — single-flight wrapper + string flattening for
3
+ * scheduler.cjs's listPrdsInternal() (PRD 3063).
4
+ *
5
+ * Why: the 2026-11-08 main-process heap snapshot held ~21 overlapping
6
+ * machine-wide `schedule:list-prds` scans at once; 1.62 GB of the 1.75 GB
7
+ * live heap was PRD file text kept alive by V8 sliced strings (title,
8
+ * dependsOn, ...) that each scan's entries pointed into. Two fixes live here:
9
+ *
10
+ * - createSingleFlight(fn, keyOf): concurrent calls with the same key share
11
+ * ONE in-flight promise; the slot clears when it settles (resolve OR
12
+ * reject), so the next call starts a fresh scan / retries a failure.
13
+ * - flatString / flattenPrdEntry: copy every string that came from file text
14
+ * into a fresh flat string, so an entry never retains the parsed file.
15
+ *
16
+ * Pure — no fs, no electron — so it is unit-testable under vitest.
17
+ */
18
+ 'use strict';
19
+
20
+ const MACHINE_WIDE_KEY = '*';
21
+
22
+ /**
23
+ * @param {(arg: any) => Promise<any>} fn
24
+ * @param {(arg: any) => string} keyOf
25
+ */
26
+ function createSingleFlight(fn, keyOf) {
27
+ const inFlight = new Map();
28
+ function shared(arg) {
29
+ const key = keyOf(arg);
30
+ const existing = inFlight.get(key);
31
+ if (existing) return existing;
32
+ // fn may throw synchronously; the async IIFE turns that into a rejection.
33
+ const p = (async () => fn(arg))();
34
+ inFlight.set(key, p);
35
+ // Clear AFTER set (a sync throw would otherwise run cleanup before the
36
+ // slot exists and strand a rejected promise in it). Registered before any
37
+ // caller's await, so the slot is gone by the time a caller resumes.
38
+ const clear = () => { if (inFlight.get(key) === p) inFlight.delete(key); };
39
+ p.then(clear, clear);
40
+ return p;
41
+ }
42
+ shared.inFlight = inFlight;
43
+ return shared;
44
+ }
45
+
46
+ /** Key for a list-prds call: normalized non-empty cwd, else the machine-wide key. */
47
+ function listKeyFor(cwd) {
48
+ return typeof cwd === 'string' && cwd.length > 0 ? cwd : MACHINE_WIDE_KEY;
49
+ }
50
+
51
+ /**
52
+ * Return a flat copy of `s` that shares no backing store with its parent
53
+ * (a Buffer round-trip always materializes a new sequential string).
54
+ * Non-strings pass through untouched.
55
+ */
56
+ function flatString(s) {
57
+ if (typeof s !== 'string') return s;
58
+ if (s.length === 0) return '';
59
+ return Buffer.from(s, 'utf8').toString('utf8');
60
+ }
61
+
62
+ /** Flatten every string field, and every string item of every array field, in place. */
63
+ function flattenPrdEntry(entry) {
64
+ if (!entry || typeof entry !== 'object') return entry;
65
+ for (const k of Object.keys(entry)) {
66
+ const v = entry[k];
67
+ if (typeof v === 'string') entry[k] = flatString(v);
68
+ else if (Array.isArray(v)) entry[k] = v.map((x) => flatString(x));
69
+ }
70
+ return entry;
71
+ }
72
+
73
+ module.exports = {
74
+ MACHINE_WIDE_KEY,
75
+ createSingleFlight,
76
+ listKeyFor,
77
+ flatString,
78
+ flattenPrdEntry,
79
+ };
@@ -21,25 +21,35 @@ const fs = require('node:fs');
21
21
  /** PRD execution's documented default persona (dev-lead.md's own frontmatter role). */
22
22
  const DEFAULT_PRD_AGENT_TYPE = 'dev-lead';
23
23
 
24
- // READ side of the FK — logged at most once per (cwd, agentType) so a hot
25
- // reconcile/list pass re-parsing the same on-disk PRD every tick doesn't
26
- // flood opsErrorLog's daily file. Mirrors agentModelResolve.cjs's
24
+ // READ side of the FK — logged at most once per agentType per process so a
25
+ // hot reconcile/list pass re-parsing the same on-disk PRDs every tick (across
26
+ // many cwds — job worktrees each count as one) doesn't flood opsErrorLog's
27
+ // daily file or the remote warns chart. Mirrors agentModelResolve.cjs's
27
28
  // loggedDanglingPersonas set.
28
29
  const loggedDanglingAgentTypes = new Set();
29
30
 
31
+ /** True when the PRD being read is archived — a retired persona there is expected, not a warn. */
32
+ function isArchivedPrd(deps) {
33
+ if (deps.archived === true) return true;
34
+ const p = typeof deps.filePath === 'string' ? deps.filePath.replace(/\\/g, '/') : '';
35
+ return p.includes('/prds-archived/');
36
+ }
37
+
30
38
  /**
31
39
  * Read-time tolerance check: a PRD on disk whose persona was renamed or
32
40
  * deleted after the PRD was written must still load. Never throws — logs at
33
- * most once via opsErrorLog when `agentType` is set but unresolvable.
41
+ * most once per agentType per process via opsErrorLog when `agentType` is set
42
+ * but unresolvable. Silent for archived PRDs (`deps.archived === true`, or
43
+ * `deps.filePath` under `prds-archived/`): their personas are routinely retired.
34
44
  */
35
45
  function reportDanglingAgentTypeOnce(cwd, agentType, deps = {}) {
36
46
  if (!cwd || !agentType) return;
37
47
  try {
48
+ if (isArchivedPrd(deps)) return;
49
+ if (loggedDanglingAgentTypes.has(agentType)) return;
38
50
  const checkPersonaExists = deps.personaExists || personaFileExists;
39
51
  if (checkPersonaExists(cwd, agentType, deps)) return;
40
- const key = `${cwd}::${agentType}`;
41
- if (loggedDanglingAgentTypes.has(key)) return;
42
- loggedDanglingAgentTypes.add(key);
52
+ loggedDanglingAgentTypes.add(agentType);
43
53
  // Required lazily, same rationale as agentModelResolve.cjs's
44
54
  // logDanglingPersonaOnce: pay for this leaf module only on the (rare)
45
55
  // miss path.
@@ -125,6 +125,22 @@ function parseInlineList(raw) {
125
125
  .filter((s) => s.length > 0);
126
126
  }
127
127
 
128
+ /**
129
+ * The one definition of an artifact-only PRD: `deliverable: artifact` plus a
130
+ * non-empty `artifactPaths` list. Used by runVerify's artifact exemption,
131
+ * executeJob's finish-protocol variant and the scheduler's queue-row checks —
132
+ * keep every caller on this predicate so the copies cannot drift apart.
133
+ *
134
+ * @param {{ deliverable?: unknown, artifactPaths?: unknown } | null | undefined} decl
135
+ * @returns {boolean}
136
+ */
137
+ function isArtifactOnlyDeclaration(decl) {
138
+ if (decl == null || typeof decl !== 'object') return false;
139
+ return decl.deliverable === 'artifact'
140
+ && Array.isArray(decl.artifactPaths)
141
+ && decl.artifactPaths.length > 0;
142
+ }
143
+
128
144
  function arraysEqual(a, b) {
129
145
  if (!Array.isArray(a) || !Array.isArray(b)) return false;
130
146
  return a.length === b.length && a.every((v, i) => v === b[i]);
@@ -322,4 +338,12 @@ function serializePrdFile(fm, body) {
322
338
  return `---\n${fmText}\n---\n${body}`;
323
339
  }
324
340
 
325
- module.exports = { splitFrontmatter, parsePrdFile, serializePrdFile, RECOGNIZED_KEYS, PRD_EFFORT_LEVELS };
341
+ module.exports = {
342
+ splitFrontmatter,
343
+ parsePrdFile,
344
+ serializePrdFile,
345
+ parseInlineList,
346
+ isArtifactOnlyDeclaration,
347
+ RECOGNIZED_KEYS,
348
+ PRD_EFFORT_LEVELS,
349
+ };
@@ -95,6 +95,9 @@ const ScheduleJobSchema = z
95
95
  epicId: z.string().nullable().optional(),
96
96
  // Macro press this job's PRD came from (PRD frontmatter `macroId`).
97
97
  macroId: z.string().nullable().optional(),
98
+ // PRD frontmatter artifact-only declaration (`deliverable: artifact` + `artifactPaths`).
99
+ deliverable: z.literal('artifact').nullable().optional(),
100
+ artifactPaths: z.array(z.string()).nullable().optional(),
98
101
  // PRD frontmatter `effort` — a per-run level from a macro press (outranks the persona's).
99
102
  effort: z.string().nullable().optional(),
100
103
  statusHistory: z.array(ScheduleJobStatusHistoryEntrySchema).optional(),
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * Named 'crash.<reason>' so an OOM report (reason: 'oom'), a renderer segfault
12
12
  * (reason: 'crashed'), and the unclean-shutdown postmortem (reason:
13
- * 'unclean-shutdown') are distinguishable in aggregate without parsing free
13
+ * 'unclean-shutdown:<likelyCause>', e.g. 'unclean-shutdown:os-restart') are distinguishable in aggregate without parsing free
14
14
  * text. telemetryClient.reportError already stamps the full attribution
15
15
  * (appVersion/platform/arch/machineDigest) on every record — that's the
16
16
  * whole reason this module exists: these reports are frequently the ONLY
@@ -45,16 +45,21 @@ const isNum = (v) => typeof v === 'number' && Number.isFinite(v);
45
45
  /**
46
46
  * Turns the previous run's evidence into a likely cause. Launcher evidence
47
47
  * (stderr tail, exit record) outranks the sample-based rules. silentGapSec is
48
- * accepted for the caller's meta but does not change the verdict.
49
- * @param {{ lastLoopDelayMaxMs?: unknown, lastTotalMb?: unknown, silentGapSec?: unknown, exitRecord?: { signal?: unknown } | null, stderrTail?: unknown }} [sample]
50
- * @returns {string} 'compositor-disconnect' | `signal:<NAME>` | 'main-hang' | 'memory-pressure' | 'unknown'
48
+ * accepted for the caller's meta but does not change the verdict. When the
49
+ * machine's uptime (bootUptimeSec) is shorter than the age of the last sample
50
+ * (lastSampleAgeSec), the OS booted after the app last ran — a reboot or power
51
+ * loss, not an app crash — so that is 'os-restart' (ranked below
52
+ * memory-pressure, above 'unknown').
53
+ * @param {{ lastLoopDelayMaxMs?: unknown, lastTotalMb?: unknown, silentGapSec?: unknown, bootUptimeSec?: unknown, lastSampleAgeSec?: unknown, exitRecord?: { signal?: unknown } | null, stderrTail?: unknown }} [sample]
54
+ * @returns {string} 'compositor-disconnect' | `signal:<NAME>` | 'main-hang' | 'memory-pressure' | 'os-restart' | 'unknown'
51
55
  */
52
- function classifyUncleanShutdown({ lastLoopDelayMaxMs, lastTotalMb, exitRecord, stderrTail } = {}) {
56
+ function classifyUncleanShutdown({ lastLoopDelayMaxMs, lastTotalMb, bootUptimeSec, lastSampleAgeSec, exitRecord, stderrTail } = {}) {
53
57
  if (typeof stderrTail === 'string' && stderrTail.includes('Fatal Wayland communication error')) return 'compositor-disconnect';
54
58
  const sig = exitRecord && exitRecord.signal;
55
59
  if (typeof sig === 'string' && /^[A-Z0-9]{2,16}$/.test(sig)) return `signal:${sig}`;
56
60
  if (isNum(lastLoopDelayMaxMs) && lastLoopDelayMaxMs >= HANG_LOOP_DELAY_MS) return 'main-hang';
57
61
  if (isNum(lastTotalMb) && lastTotalMb >= MEMORY_PRESSURE_MB) return 'memory-pressure';
62
+ if (isNum(bootUptimeSec) && isNum(lastSampleAgeSec) && bootUptimeSec < lastSampleAgeSec) return 'os-restart';
58
63
  return 'unknown';
59
64
  }
60
65
 
@@ -25,9 +25,29 @@ function resolveDeps(deps = {}) {
25
25
  buildMachineProfile: deps.buildMachineProfile || require('../machineProfile.cjs').buildMachineProfile,
26
26
  telemetryCounters: deps.telemetryCounters || require('./telemetryCounters.cjs'),
27
27
  getSeedStatus: deps.getSeedStatus || (() => require('../../seedStatus.cjs').getSeedStatus()),
28
+ fsp: deps.fsp || require('node:fs/promises'),
29
+ homedir: deps.homedir || require('node:os').homedir,
28
30
  };
29
31
  }
30
32
 
33
+ /**
34
+ * removeLegacyWatermarks({ fsp, homedir }) — one-shot migration for the
35
+ * retired errors-<date>.jsonl backlog replay: its delivery
36
+ * watermarks file has no reader any more. Best-effort: resolves true when a
37
+ * file was removed, false otherwise (absent, unreadable home, EACCES, ...).
38
+ * Never throws — telemetry housekeeping must not break boot.
39
+ */
40
+ async function removeLegacyWatermarks({ fsp, homedir } = {}) {
41
+ try {
42
+ const path = require('node:path');
43
+ const file = path.join(homedir(), '.claude', 'session-manager', 'telemetry-watermarks.json');
44
+ await fsp.unlink(file);
45
+ return true;
46
+ } catch {
47
+ return false;
48
+ }
49
+ }
50
+
31
51
  /**
32
52
  * Maps getSeedStatus() to enum-only strings (never the fix text or a path).
33
53
  * Any failure or malformed shape yields null — never a throw.
@@ -49,6 +69,16 @@ function buildSeeds(getSeedStatus) {
49
69
  }
50
70
  }
51
71
 
72
+ /**
73
+ * seedsJson(seeds) — the single serialization of a buildSeeds() result that is
74
+ * persisted as telemetrySettings.lastSeedsReported and compared against it.
75
+ * Both upsert paths (bootSequence, reportSeedsIfChanged) use this so they
76
+ * write the identical string. A null seeds snapshot yields null.
77
+ */
78
+ function seedsJson(seeds) {
79
+ return seeds ? JSON.stringify(seeds) : null;
80
+ }
81
+
52
82
  /**
53
83
  * bootSequence({ now, appVersion, installChannel, deps }) — call once per
54
84
  * process from app.whenReady.
@@ -63,7 +93,9 @@ function buildSeeds(getSeedStatus) {
63
93
  * the 30-day liveness heartbeat). lastMachineReportAt/Version are only
64
94
  * persisted when reportInstall() reports success — a failed/dropped
65
95
  * upsert stays due so the next boot retries, rather than being marked
66
- * done regardless of outcome.
96
+ * done regardless of outcome. On acceptance it also persists
97
+ * lastSeedsReported (seedsJson of the seeds it sent), so
98
+ * reportSeedsIfChanged skips an identical re-send.
67
99
  * This lands in bilko.run's app_installs table (the sole source for
68
100
  * every install-shaped number on the site). It replaces the former
69
101
  * track('install.machine', profile) call, which duplicated the same
@@ -71,10 +103,12 @@ function buildSeeds(getSeedStatus) {
71
103
  * destination for a machine profile.
72
104
  * 4. app.launch — one counter event per boot, via telemetryCounters so the
73
105
  * shape lives in exactly one place across every counter this PRD adds.
106
+ * 5. removeLegacyWatermarks — deletes the retired backlog's watermarks file
107
+ * if one is still on disk (best-effort, never throws).
74
108
  */
75
109
  async function bootSequence({ now = Date.now(), appVersion, installChannel, deps: depsOverride } = {}) {
76
110
  const deps = resolveDeps(depsOverride);
77
- const { telemetrySettings, telemetryClient, buildMachineProfile, telemetryCounters, getSeedStatus } = deps;
111
+ const { telemetrySettings, telemetryClient, buildMachineProfile, telemetryCounters, getSeedStatus, fsp, homedir } = deps;
78
112
 
79
113
  const settings = await telemetrySettings.load();
80
114
  const versionChanged = settings.lastMachineReportVersion !== appVersion;
@@ -85,17 +119,56 @@ async function bootSequence({ now = Date.now(), appVersion, installChannel, deps
85
119
  }
86
120
 
87
121
  if (telemetrySettings.isMachineReportDue(settings, { now, appVersion })) {
88
- const profile = { ...(await buildMachineProfile()), seeds: buildSeeds(getSeedStatus) };
122
+ const seeds = buildSeeds(getSeedStatus);
123
+ const profile = { ...(await buildMachineProfile()), seeds };
89
124
  const reportResult = await telemetryClient.reportInstall(profile);
90
125
  if (reportResult && reportResult.accepted) {
126
+ // Record the seeds this upsert delivered so reportSeedsIfChanged does not
127
+ // re-send an identical install record once the seeders settle.
128
+ const sentSeedsJson = seedsJson(seeds);
91
129
  await telemetrySettings.save({
92
130
  lastMachineReportAt: new Date(now).toISOString(),
93
131
  lastMachineReportVersion: appVersion,
132
+ ...(sentSeedsJson ? { lastSeedsReported: sentSeedsJson } : {}),
94
133
  });
95
134
  }
96
135
  }
97
136
 
98
137
  telemetryCounters.trackAppLaunch({ installChannel, appVersion });
138
+
139
+ await removeLegacyWatermarks({ fsp, homedir });
140
+ }
141
+
142
+ /**
143
+ * reportSeedsIfChanged({ deps }) — call once the boot seeders settle.
144
+ *
145
+ * bootSequence snapshots getSeedStatus() before the seeders finish, so a fresh
146
+ * install's first upsert reports every step 'pending', and the next upsert
147
+ * would only come on a version bump or the 30-day heartbeat. This re-sends the
148
+ * install record whenever the settled seeds differ from the last ones an
149
+ * upsert delivered (telemetrySettings.lastSeedsReported, JSON of the 3 enum
150
+ * values). lastSeedsReported is persisted only when reportInstall() reports
151
+ * accepted, so a dropped/failed upsert retries on the next settle.
152
+ * Resolves { sent, accepted }.
153
+ */
154
+ async function reportSeedsIfChanged({ deps: depsOverride } = {}) {
155
+ const deps = resolveDeps(depsOverride);
156
+ const { telemetrySettings, telemetryClient, buildMachineProfile, getSeedStatus } = deps;
157
+
158
+ const seeds = buildSeeds(getSeedStatus);
159
+ if (!seeds) return { sent: false, accepted: false };
160
+ const currentSeedsJson = seedsJson(seeds);
161
+
162
+ const settings = await telemetrySettings.load();
163
+ if (settings && settings.lastSeedsReported === currentSeedsJson) return { sent: false, accepted: false };
164
+
165
+ const profile = { ...(await buildMachineProfile()), seeds };
166
+ const reportResult = await telemetryClient.reportInstall(profile);
167
+ const accepted = !!(reportResult && reportResult.accepted);
168
+ if (accepted) {
169
+ await telemetrySettings.save({ lastSeedsReported: currentSeedsJson });
170
+ }
171
+ return { sent: true, accepted };
99
172
  }
100
173
 
101
- module.exports = { bootSequence, buildSeeds };
174
+ module.exports = { bootSequence, buildSeeds, removeLegacyWatermarks, reportSeedsIfChanged };
@@ -84,6 +84,7 @@ const S = {
84
84
  disabledForProcess: false,
85
85
  dedupedAppends: 0,
86
86
  evictedCount: 0,
87
+ rejectedCount: 0,
87
88
  recent: [],
88
89
  errSeen: new Map(),
89
90
  dailyTimer: null,
@@ -478,6 +479,9 @@ async function track(name, props) {
478
479
  const wire = {
479
480
  app: 'session-manager',
480
481
  name: safeStr(name, 200),
482
+ // Captured at track time so the server can date the event by when it
483
+ // happened, not when a (possibly days-late) flush delivered it.
484
+ ts: Date.now(),
481
485
  props: meta,
482
486
  session_id: S.sessionId,
483
487
  visitor_id: S.settings.installId,
@@ -660,6 +664,13 @@ function describeFailureStatus(status) {
660
664
  return status === 0 ? 'network error' : `HTTP ${status}`;
661
665
  }
662
666
 
667
+ /**
668
+ * Classifies a failed send and applies its side effects. Returns:
669
+ * - 'backoff' — 429 / network / 5xx: retryable; stop the flush, keep the batch.
670
+ * - 'disabled' — 401 / 403: auth contract broken; stop sending for this process, keep the batch.
671
+ * - 'rejected' — any other 4xx: this batch is poison; the caller drops it and moves on,
672
+ * so it doesn't block other channels or fail again every boot.
673
+ */
663
674
  function applyFailureBackoff(status, channel) {
664
675
  if (status === 429 || status === 0 || status >= 500) {
665
676
  S.consecutiveFailures += 1;
@@ -667,14 +678,25 @@ function applyFailureBackoff(status, channel) {
667
678
  S.backoffUntil = Date.now() + ms;
668
679
  S.lastError = { status, message: describeFailureStatus(status), at: Date.now() };
669
680
  logWarn('telemetry send failed', { channel, status, consecutiveFailures: S.consecutiveFailures, backoffMs: ms });
670
- return;
681
+ return 'backoff';
671
682
  }
672
- if (status >= 400 && status < 500) {
673
- // Malformed-contract circuit breaker (includes 401) — not retried.
683
+ S.lastError = { status, message: describeFailureStatus(status), at: Date.now() };
684
+ if (status === 401 || status === 403) {
674
685
  S.disabledForProcess = true;
675
- S.lastError = { status, message: describeFailureStatus(status), at: Date.now() };
676
- logWarn('telemetry disabled for process', { status });
686
+ logWarn('telemetry disabled for process', { channel, status });
687
+ return 'disabled';
688
+ }
689
+ return 'rejected';
690
+ }
691
+
692
+ /** Drops a server-rejected (non-retryable 4xx) batch from the queue. */
693
+ function rejectRecords(records, channel, status, result) {
694
+ for (const r of records) {
695
+ removeFromQueue(r.recordId);
696
+ result.rejected.push(r.recordId);
677
697
  }
698
+ S.rejectedCount += records.length;
699
+ logWarn('telemetry batch rejected by server; dropped', { channel, status, count: records.length });
678
700
  }
679
701
 
680
702
  /**
@@ -692,7 +714,7 @@ function flush(reason) {
692
714
 
693
715
  async function flushImpl(reason) {
694
716
  const safeReason = VALID_REASONS.has(reason) ? reason : 'manual';
695
- const result = { sent: [], failed: [], reason: safeReason };
717
+ const result = { sent: [], failed: [], rejected: [], reason: safeReason };
696
718
  try {
697
719
  await ensureInit();
698
720
  if (!telemetrySettings.isEnabled(S.settings)) return result;
@@ -704,12 +726,15 @@ async function flushImpl(reason) {
704
726
  if (byChannel[r.channel]) byChannel[r.channel].push(r);
705
727
  }
706
728
 
729
+ // Highest-value channels first so a backoff on bulk events never starves crash reports.
707
730
  let sawFailure = false;
708
- for (const channel of ['event', 'log', 'error', 'install']) {
731
+ for (const channel of ['error', 'install', 'log', 'event']) {
709
732
  if (sawFailure) break;
733
+ if (!telemetrySettings.isEnabled(S.settings)) break;
710
734
  const records = byChannel[channel];
711
735
  if (channel === 'install') {
712
736
  for (const r of records) {
737
+ if (!telemetrySettings.isEnabled(S.settings)) break;
713
738
  const res = await sendSingle('install', r.wire);
714
739
  if (res.ok) {
715
740
  S.consecutiveFailures = 0;
@@ -719,8 +744,11 @@ async function flushImpl(reason) {
719
744
  addToSent(r.recordId);
720
745
  result.sent.push(r.recordId);
721
746
  } else {
747
+ if (applyFailureBackoff(res.status, channel) === 'rejected') {
748
+ rejectRecords([r], channel, res.status, result);
749
+ continue;
750
+ }
722
751
  result.failed.push(r.recordId);
723
- applyFailureBackoff(res.status, channel);
724
752
  sawFailure = true;
725
753
  break;
726
754
  }
@@ -728,6 +756,8 @@ async function flushImpl(reason) {
728
756
  continue;
729
757
  }
730
758
  for (let i = 0; i < records.length; i += MAX_BATCH) {
759
+ // Re-check per batch: an opt-out landing mid-flush stops further sends.
760
+ if (!telemetrySettings.isEnabled(S.settings)) break;
731
761
  const batch = records.slice(i, i + MAX_BATCH);
732
762
  const res = await sendBatch(channel, batch.map((r) => r.wire));
733
763
  if (res.ok) {
@@ -740,8 +770,11 @@ async function flushImpl(reason) {
740
770
  result.sent.push(r.recordId);
741
771
  }
742
772
  } else {
773
+ if (applyFailureBackoff(res.status, channel) === 'rejected') {
774
+ rejectRecords(batch, channel, res.status, result);
775
+ continue;
776
+ }
743
777
  for (const r of batch) result.failed.push(r.recordId);
744
- applyFailureBackoff(res.status, channel);
745
778
  sawFailure = true;
746
779
  break;
747
780
  }
@@ -762,6 +795,16 @@ async function flushImpl(reason) {
762
795
  return result;
763
796
  }
764
797
 
798
+ /**
799
+ * Pushes a freshly-saved settings object into the live client so a consent
800
+ * change (telemetryConsent.applyConsentUpdate) takes effect at once — without
801
+ * it the client keeps checking the copy it cached at init, so an opt-out
802
+ * would still accept and send until restart.
803
+ */
804
+ function applySettings(cfg) {
805
+ if (cfg && typeof cfg === 'object') S.settings = cfg;
806
+ }
807
+
765
808
  function shutdown() {
766
809
  if (S.dailyTimer) {
767
810
  clearInterval(S.dailyTimer);
@@ -775,6 +818,7 @@ function status() {
775
818
  sentCount: S.sentIds.size,
776
819
  dedupedAppends: S.dedupedAppends,
777
820
  evictedCount: S.evictedCount,
821
+ rejectedCount: S.rejectedCount,
778
822
  disabledForProcess: S.disabledForProcess,
779
823
  consecutiveFailures: S.consecutiveFailures,
780
824
  backoffUntil: S.backoffUntil,
@@ -829,6 +873,7 @@ module.exports = {
829
873
  reportError,
830
874
  reportInstall,
831
875
  flush,
876
+ applySettings,
832
877
  shutdown,
833
878
  status,
834
879
  recentRecords,
@@ -25,6 +25,9 @@ async function applyConsentUpdate(cfg, depsOverride) {
25
25
  const deps = resolveDeps(depsOverride);
26
26
  const before = await deps.telemetrySettings.load();
27
27
  const saved = await deps.telemetrySettings.save(cfg);
28
+ // Live client caches settings at init; push the saved copy so opt-out
29
+ // stops ingest + egress immediately and a re-enable resumes in-process.
30
+ if (typeof deps.telemetryClient.applySettings === 'function') deps.telemetryClient.applySettings(saved);
28
31
  if (before.enabled && !saved.enabled) {
29
32
  await deps.telemetryClient.clearQueue();
30
33
  }
@@ -25,8 +25,13 @@ function trackAppLaunch({ installChannel, appVersion } = {}, deps) {
25
25
  track('app.launch', { installChannel: installChannel || null, appVersion: appVersion || null }, deps);
26
26
  }
27
27
 
28
- function trackSessionOpen(deps) {
29
- track('session.open', {}, deps);
28
+ // Which view opened the session: a fresh PTY spawn ('terminal', pty.cjs) or a
29
+ // Chat turn that starts a brand-new CLI session via --session-id ('chat',
30
+ // chatRunner.cjs). Closed set — anything else is sent as null.
31
+ const SESSION_SURFACES = ['terminal', 'chat'];
32
+
33
+ function trackSessionOpen({ surface } = {}, deps) {
34
+ track('session.open', { surface: SESSION_SURFACES.includes(surface) ? surface : null }, deps);
30
35
  }
31
36
 
32
37
  // Enum mappers — user-authored values never leave the machine; only the closed
@@ -10,6 +10,7 @@
10
10
  * lastMachineReportAt: string|null,
11
11
  * lastMachineReportVersion: string,
12
12
  * lastDailyFlushAt: string|null,
13
+ * lastSeedsReported: string|null, // JSON of the 3 seed enum values last accepted by an install upsert
13
14
  * schemaVersion: 1
14
15
  * }
15
16
  *
@@ -40,6 +41,7 @@ const DEFAULTS = Object.freeze({
40
41
  lastMachineReportAt: null,
41
42
  lastMachineReportVersion: '',
42
43
  lastDailyFlushAt: null,
44
+ lastSeedsReported: null,
43
45
  schemaVersion: SCHEMA_VERSION,
44
46
  });
45
47
 
@@ -67,6 +69,7 @@ function isValid(cfg) {
67
69
  if (cfg.lastMachineReportAt !== null && typeof cfg.lastMachineReportAt !== 'string') return false;
68
70
  if (typeof cfg.lastMachineReportVersion !== 'string') return false;
69
71
  if (cfg.lastDailyFlushAt !== null && typeof cfg.lastDailyFlushAt !== 'string') return false;
72
+ if (cfg.lastSeedsReported !== undefined && cfg.lastSeedsReported !== null && typeof cfg.lastSeedsReported !== 'string') return false;
70
73
  if (cfg.schemaVersion !== SCHEMA_VERSION) return false;
71
74
  return true;
72
75
  }
@@ -80,6 +83,7 @@ function normalize(cfg) {
80
83
  lastMachineReportAt: typeof cfg.lastMachineReportAt === 'string' ? cfg.lastMachineReportAt : null,
81
84
  lastMachineReportVersion: typeof cfg.lastMachineReportVersion === 'string' ? cfg.lastMachineReportVersion : '',
82
85
  lastDailyFlushAt: typeof cfg.lastDailyFlushAt === 'string' ? cfg.lastDailyFlushAt : null,
86
+ lastSeedsReported: typeof cfg.lastSeedsReported === 'string' ? cfg.lastSeedsReported : null,
83
87
  schemaVersion: SCHEMA_VERSION,
84
88
  };
85
89
  }
@@ -185,6 +189,7 @@ module.exports = {
185
189
  save,
186
190
  storePath,
187
191
  isValid,
192
+ normalize,
188
193
  isEnabled,
189
194
  resolveEndpoint,
190
195
  isDailyFlushDue,