@cccarv82/freya 1.0.25 → 1.0.27

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/cli/web-ui.js CHANGED
@@ -4,7 +4,16 @@
4
4
 
5
5
  (function () {
6
6
  const $ = (id) => document.getElementById(id);
7
- undefined
7
+ const state = {
8
+ lastReportPath: null,
9
+ lastText: '',
10
+ reports: [],
11
+ selectedReport: null,
12
+ lastPlan: '',
13
+ lastApplied: null,
14
+ autoApply: true,
15
+ autoRunReports: false
16
+ };
8
17
 
9
18
  function applyTheme(theme) {
10
19
  document.documentElement.setAttribute('data-theme', theme);
@@ -536,9 +545,25 @@
536
545
  setOut(header + (r.plan || ''));
537
546
  ta.value = '';
538
547
 
539
- if (r.ok === false) setPill('err', 'planner off');
540
- else setPill('ok', 'planned');
541
- setTimeout(() => setPill('ok', 'idle'), 800);
548
+ if (r.ok === false) {
549
+ setPill('err', 'planner off');
550
+ setTimeout(() => setPill('ok', 'idle'), 800);
551
+ return;
552
+ }
553
+
554
+ if (state.autoApply) {
555
+ setPill('run', 'applying…');
556
+ await applyPlan();
557
+ const a = state.lastApplied || {};
558
+ setPill('ok', `applied (${a.tasks || 0}t, ${a.blockers || 0}b)`);
559
+ if (state.autoRunReports) {
560
+ await runSuggestedReports();
561
+ }
562
+ } else {
563
+ setPill('ok', 'planned');
564
+ }
565
+
566
+ setTimeout(() => setPill('ok', 'idle'), 1200);
542
567
  } catch (e) {
543
568
  setPill('err', 'plan failed');
544
569
  }
package/cli/web.js CHANGED
@@ -1279,6 +1279,19 @@ async function cmdWeb({ port, dir, open, dev }) {
1279
1279
  }
1280
1280
  }
1281
1281
 
1282
+ // Auto-suggest reports when planner didn't include any
1283
+ // (keeps UX consistent: if you created a blocker, at least suggest blockers)
1284
+ if (!applied.reportsSuggested.length) {
1285
+ const sug = [];
1286
+ sug.push('daily');
1287
+ if (applied.blockers > 0) sug.push('blockers');
1288
+ if ((applied.tasks > 0 || applied.blockers > 0) && applyMode !== 'blockers') sug.push('status');
1289
+ applied.reportsSuggested = Array.from(new Set(sug));
1290
+ } else {
1291
+ // Dedup
1292
+ applied.reportsSuggested = Array.from(new Set(applied.reportsSuggested.map((s) => String(s).trim()).filter(Boolean)));
1293
+ }
1294
+
1282
1295
  // Persist
1283
1296
  writeJson(taskFile, taskLog);
1284
1297
  writeJson(blockerFile, blockerLog);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cccarv82/freya",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "description": "Personal AI Assistant with local-first persistence",
5
5
  "scripts": {
6
6
  "health": "node scripts/validate-data.js",