life-pulse 2.2.1 → 2.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/dist/cli.js +4 -5
- package/dist/intelligence.js +2 -0
- package/dist/tui.d.ts +1 -6
- package/dist/tui.js +2 -26
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -6,7 +6,7 @@ import { saveState, saveDecisions } from './state.js';
|
|
|
6
6
|
// ProgressRenderer unused — removed
|
|
7
7
|
import { InkProgress } from './ui/progress.js';
|
|
8
8
|
import { addTodo, resolveTodos, pruneOld } from './todo.js';
|
|
9
|
-
import { renderGreeting, renderContextLine, renderCRMList, pickCard, renderSection, renderSectionHeader, renderHandled, renderDivider, renderBrief, renderArchetype, Spinner,
|
|
9
|
+
import { renderGreeting, renderContextLine, renderCRMList, pickCard, renderSection, renderSectionHeader, renderHandled, renderDivider, renderBrief, renderArchetype, Spinner, destroyUI, GRN, MAG, CYN, RED, AMB, MID } from './tui.js';
|
|
10
10
|
import { needsDiscovery, discoverPlatforms, savePlatforms } from './platforms.js';
|
|
11
11
|
import { generateArchetype } from './archetype.js';
|
|
12
12
|
import { runPermissionFlow, getMissingPermissions } from './permissions.js';
|
|
@@ -368,10 +368,9 @@ async function main() {
|
|
|
368
368
|
process.exit(1);
|
|
369
369
|
}
|
|
370
370
|
const interactive = process.stdin.isTTY && !jsonMode && !legacyMode;
|
|
371
|
-
// ── Fire
|
|
372
|
-
const weatherP = interactive ? fetchWeather() : Promise.resolve(null);
|
|
371
|
+
// ── Fire calendar fetch early ──
|
|
373
372
|
const calendarP = interactive ? fetchCalendarContext() : Promise.resolve('');
|
|
374
|
-
// ── Instant greeting + context line
|
|
373
|
+
// ── Instant greeting + context line ──
|
|
375
374
|
let userName;
|
|
376
375
|
try {
|
|
377
376
|
userName = getUserName();
|
|
@@ -379,7 +378,7 @@ async function main() {
|
|
|
379
378
|
catch { }
|
|
380
379
|
if (interactive) {
|
|
381
380
|
renderGreeting(userName);
|
|
382
|
-
|
|
381
|
+
renderContextLine();
|
|
383
382
|
}
|
|
384
383
|
const spinner = interactive ? new Spinner() : undefined;
|
|
385
384
|
// ── First-run: permissions → discovery → archetype ──
|
package/dist/intelligence.js
CHANGED
|
@@ -28,6 +28,8 @@ export function loadContactSummaries() {
|
|
|
28
28
|
export function saveContactSummaries(threads) {
|
|
29
29
|
ensureDir();
|
|
30
30
|
const store = loadContactSummaries();
|
|
31
|
+
if (!store.summaries)
|
|
32
|
+
store.summaries = {};
|
|
31
33
|
const now = appleNow();
|
|
32
34
|
for (const t of threads) {
|
|
33
35
|
if (!t.relationship)
|
package/dist/tui.d.ts
CHANGED
|
@@ -14,13 +14,8 @@ export declare const GRN: import("chalk").ChalkInstance;
|
|
|
14
14
|
export declare const MAG: import("chalk").ChalkInstance;
|
|
15
15
|
export declare const CYN: import("chalk").ChalkInstance;
|
|
16
16
|
export declare const HD: import("chalk").ChalkInstance;
|
|
17
|
-
export interface Weather {
|
|
18
|
-
city: string;
|
|
19
|
-
temp: string;
|
|
20
|
-
}
|
|
21
|
-
export declare function fetchWeather(): Promise<Weather | null>;
|
|
22
17
|
export declare function renderGreeting(name?: string): void;
|
|
23
|
-
export declare function renderContextLine(
|
|
18
|
+
export declare function renderContextLine(): void;
|
|
24
19
|
export declare function renderCRMList(contacts: {
|
|
25
20
|
name: string;
|
|
26
21
|
lastMsg: {
|
package/dist/tui.js
CHANGED
|
@@ -17,23 +17,6 @@ export const GRN = C.ok;
|
|
|
17
17
|
export const MAG = C.accent;
|
|
18
18
|
export const CYN = C.info;
|
|
19
19
|
export const HD = C.hd;
|
|
20
|
-
export async function fetchWeather() {
|
|
21
|
-
try {
|
|
22
|
-
const res = await fetch('https://wttr.in/?format=%l|%t', {
|
|
23
|
-
signal: AbortSignal.timeout(3000),
|
|
24
|
-
headers: { 'User-Agent': 'curl' },
|
|
25
|
-
});
|
|
26
|
-
const text = (await res.text()).trim();
|
|
27
|
-
const [loc, temp] = text.split('|');
|
|
28
|
-
if (!loc || !temp)
|
|
29
|
-
return null;
|
|
30
|
-
const city = loc.split(',')[0].trim();
|
|
31
|
-
return { city, temp: temp.trim().replace('+', '') };
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
20
|
// ─── Routing: Ink (interactive) vs plain (piped/launchd) ───
|
|
38
21
|
const USE_INK = process.stdin.isTTY;
|
|
39
22
|
// Helper: output a line through the right channel
|
|
@@ -57,20 +40,13 @@ export function renderGreeting(name) {
|
|
|
57
40
|
}
|
|
58
41
|
}
|
|
59
42
|
// ─── Context line ───
|
|
60
|
-
export
|
|
61
|
-
const weather = weatherP ? await Promise.race([
|
|
62
|
-
weatherP,
|
|
63
|
-
new Promise(r => setTimeout(() => r(null), 3000)),
|
|
64
|
-
]) : null;
|
|
43
|
+
export function renderContextLine() {
|
|
65
44
|
const d = new Date();
|
|
66
45
|
const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
|
67
46
|
const h12 = (d.getHours() % 12) || 12;
|
|
68
47
|
const min = d.getMinutes().toString().padStart(2, '0');
|
|
69
48
|
const ampm = d.getHours() >= 12 ? 'PM' : 'AM';
|
|
70
|
-
|
|
71
|
-
if (weather)
|
|
72
|
-
line += ` · ${weather.city} · ${weather.temp}`;
|
|
73
|
-
out(` ${C.dim(line)}`);
|
|
49
|
+
out(` ${C.dim(`${days[d.getDay()]} · ${h12}:${min} ${ampm}`)}`);
|
|
74
50
|
out('');
|
|
75
51
|
}
|
|
76
52
|
// ─── CRM List ───
|