life-pulse 1.0.0 → 2.0.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.
- package/LICENSE +21 -0
- package/README.md +152 -0
- package/dist/agent.d.ts +8 -5
- package/dist/agent.js +409 -362
- package/dist/analyze.d.ts +27 -1
- package/dist/archetype.d.ts +14 -0
- package/dist/archetype.js +84 -0
- package/dist/auq.d.ts +6 -4
- package/dist/auq.js +19 -55
- package/dist/cli.js +633 -172
- package/dist/collectors/calendar.js +5 -1
- package/dist/conversation.d.ts +24 -0
- package/dist/conversation.js +147 -0
- package/dist/crm.d.ts +44 -0
- package/dist/crm.js +433 -0
- package/dist/db.d.ts +4 -2
- package/dist/db.js +48 -12
- package/dist/health.d.ts +40 -0
- package/dist/health.js +170 -0
- package/dist/icloud-discovery.d.ts +31 -0
- package/dist/icloud-discovery.js +407 -0
- package/dist/incremental.d.ts +60 -0
- package/dist/incremental.js +215 -0
- package/dist/init-check.d.ts +31 -0
- package/dist/init-check.js +167 -0
- package/dist/installer.d.ts +17 -0
- package/dist/installer.js +389 -0
- package/dist/intelligence.d.ts +23 -0
- package/dist/intelligence.js +46 -0
- package/dist/knowledge.d.ts +32 -0
- package/dist/knowledge.js +177 -0
- package/dist/mcp-registry.d.ts +29 -0
- package/dist/mcp-registry.js +136 -0
- package/dist/message-loop.d.ts +53 -0
- package/dist/message-loop.js +284 -0
- package/dist/permissions.d.ts +24 -0
- package/dist/permissions.js +224 -0
- package/dist/platforms.d.ts +29 -0
- package/dist/platforms.js +272 -0
- package/dist/profile.d.ts +1 -0
- package/dist/profile.js +9 -2
- package/dist/progress.d.ts +3 -2
- package/dist/progress.js +82 -65
- package/dist/router.d.ts +35 -0
- package/dist/router.js +250 -0
- package/dist/session-progress.d.ts +99 -0
- package/dist/session-progress.js +283 -0
- package/dist/skill-loader.d.ts +54 -0
- package/dist/skill-loader.js +220 -0
- package/dist/sms-gateway.d.ts +36 -0
- package/dist/sms-gateway.js +148 -0
- package/dist/state.d.ts +18 -0
- package/dist/state.js +73 -22
- package/dist/test-enrich.d.ts +2 -0
- package/dist/test-enrich.js +78 -0
- package/dist/tools.js +418 -19
- package/dist/transport.d.ts +69 -0
- package/dist/transport.js +154 -0
- package/dist/tui.d.ts +75 -0
- package/dist/tui.js +449 -0
- package/dist/tunnel.d.ts +30 -0
- package/dist/tunnel.js +131 -0
- package/dist/watchdog.d.ts +33 -0
- package/dist/watchdog.js +147 -0
- package/package.json +24 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2026 Molly Cantillon
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# life-pulse
|
|
2
|
+
|
|
3
|
+
macOS life diagnostic — reads local data sources, generates actionable insights.
|
|
4
|
+
|
|
5
|
+
Built with [Anthropic's long-running agent patterns](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents) for persistent context across sessions.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Install globally
|
|
11
|
+
npm install -g life-pulse
|
|
12
|
+
|
|
13
|
+
# Or run directly
|
|
14
|
+
npx life-pulse
|
|
15
|
+
|
|
16
|
+
# First run: set up permissions
|
|
17
|
+
life-pulse --setup
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Features
|
|
21
|
+
|
|
22
|
+
### 🧠 Session Continuity (Anthropic Pattern)
|
|
23
|
+
Each session picks up where the last left off:
|
|
24
|
+
- Tracks what was surfaced (avoids re-showing items)
|
|
25
|
+
- Remembers user decisions (learns from your choices)
|
|
26
|
+
- Maintains pending follow-ups across sessions
|
|
27
|
+
- Builds decision pattern profile over time
|
|
28
|
+
|
|
29
|
+
Progress is stored in `~/.life-pulse/session-progress.json`.
|
|
30
|
+
|
|
31
|
+
### 📱 iCloud Discovery
|
|
32
|
+
Scans your iCloud Drive to discover apps and recommend integrations:
|
|
33
|
+
- Obsidian vaults
|
|
34
|
+
- Bear notes
|
|
35
|
+
- Things 3 tasks
|
|
36
|
+
- Day One journal
|
|
37
|
+
- And more...
|
|
38
|
+
|
|
39
|
+
"Here's what I found about you" — personalized setup.
|
|
40
|
+
|
|
41
|
+
### ⚡ Incremental Processing
|
|
42
|
+
Delta-based scanning — only processes what's changed:
|
|
43
|
+
- Tracks file modification times
|
|
44
|
+
- Remembers last scanned message ID
|
|
45
|
+
- Skips sources that haven't changed
|
|
46
|
+
- Faster subsequent runs
|
|
47
|
+
|
|
48
|
+
### 🔐 Permission Flow
|
|
49
|
+
Guided setup for macOS permissions:
|
|
50
|
+
- Full Disk Access (required)
|
|
51
|
+
- Contacts (for name resolution)
|
|
52
|
+
- Automation (for calendar/reminders)
|
|
53
|
+
- Accessibility (optional)
|
|
54
|
+
|
|
55
|
+
Direct links to System Settings privacy panels.
|
|
56
|
+
|
|
57
|
+
### 👁 Health Monitoring
|
|
58
|
+
Long-running daemon mode with health checks:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Start as daemon
|
|
62
|
+
life-pulse --daemon
|
|
63
|
+
|
|
64
|
+
# Check status
|
|
65
|
+
life-pulse --health
|
|
66
|
+
|
|
67
|
+
# Or via HTTP
|
|
68
|
+
curl http://127.0.0.1:19876/health
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Commands
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
life-pulse # Run interactive session
|
|
75
|
+
life-pulse --setup # Run first-time setup flow
|
|
76
|
+
life-pulse --status # Show session progress info
|
|
77
|
+
life-pulse --daemon # Run as background daemon
|
|
78
|
+
life-pulse --health # Check daemon health (JSON)
|
|
79
|
+
life-pulse --raw # Output raw collected data
|
|
80
|
+
life-pulse --json # Output analysis as JSON
|
|
81
|
+
life-pulse --legacy # Use single-shot LLM mode
|
|
82
|
+
life-pulse --install # Install launchd plist for morning briefs
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Environment Variables
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Required: Anthropic API key
|
|
89
|
+
export ANTHROPIC_API_KEY="sk-ant-..."
|
|
90
|
+
|
|
91
|
+
# Optional: OpenRouter for legacy mode
|
|
92
|
+
export OPENROUTER_API_KEY="..."
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Store in `~/.config/life-pulse/.env` for persistence.
|
|
96
|
+
|
|
97
|
+
## Data Sources
|
|
98
|
+
|
|
99
|
+
life-pulse reads from local macOS databases (requires Full Disk Access):
|
|
100
|
+
|
|
101
|
+
- **Messages** — iMessage/SMS conversations
|
|
102
|
+
- **Email** — Apple Mail summaries
|
|
103
|
+
- **Calendar** — Upcoming events
|
|
104
|
+
- **Contacts** — Name resolution for phone numbers
|
|
105
|
+
- **Safari/Chrome** — Browsing history
|
|
106
|
+
- **Screen Time** — App usage patterns
|
|
107
|
+
- **Notes** — Apple Notes
|
|
108
|
+
- **Reminders** — Apple Reminders
|
|
109
|
+
- **Notifications** — Recent alerts
|
|
110
|
+
- **Find My** — Device locations
|
|
111
|
+
- **Recent Files** — Recently opened documents
|
|
112
|
+
- **Shell History** — Terminal commands
|
|
113
|
+
|
|
114
|
+
All data stays local. Nothing leaves your machine except API calls to Claude.
|
|
115
|
+
|
|
116
|
+
## Architecture
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
~/.life-pulse/
|
|
120
|
+
├── session-progress.json # Cross-session state (Anthropic pattern)
|
|
121
|
+
├── daemon.pid # PID file for daemon mode
|
|
122
|
+
└── heartbeat # Last activity timestamp
|
|
123
|
+
|
|
124
|
+
~/Library/Application Support/life-pulse/
|
|
125
|
+
├── state.json # Analysis history
|
|
126
|
+
├── config.json # User preferences
|
|
127
|
+
├── platforms.json # Discovered apps/services
|
|
128
|
+
└── todos.json # Task tracking
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Design Principles
|
|
132
|
+
|
|
133
|
+
1. **Session Continuity** — Like claude-progress.txt, each run knows what happened before
|
|
134
|
+
2. **Incremental Processing** — Don't rescan what hasn't changed
|
|
135
|
+
3. **Graceful Degradation** — Works with partial permissions
|
|
136
|
+
4. **Local First** — All data stays on your machine
|
|
137
|
+
5. **User Control** — Every surfaced item gets a decision
|
|
138
|
+
|
|
139
|
+
## Development
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
git clone https://github.com/your-org/life-pulse
|
|
143
|
+
cd life-pulse
|
|
144
|
+
npm install
|
|
145
|
+
npm run dev # Run with tsx (hot reload)
|
|
146
|
+
npm run build # Compile TypeScript
|
|
147
|
+
npm run start # Run compiled version
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## License
|
|
151
|
+
|
|
152
|
+
MIT
|
package/dist/agent.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Executive Operating System — Claude Agent SDK.
|
|
3
3
|
*
|
|
4
4
|
* Architecture:
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* - Orchestrator (Opus) via SDK query() with built-in tool execution
|
|
6
|
+
* - Custom tools via in-process MCP server (life-pulse tools + ask_user)
|
|
7
|
+
* - Remote MCP servers auto-discovered from platforms (Slack, Stripe, etc.)
|
|
8
|
+
* - Workers dispatched as SDK subagents via Task tool
|
|
9
|
+
* - Workers get full Claude Code capabilities (Read, Bash, WebSearch, etc.)
|
|
8
10
|
*/
|
|
9
11
|
import type { Analysis } from './analyze.js';
|
|
10
12
|
import type { ProgressSink } from './progress.js';
|
|
11
|
-
export declare function runAgent(
|
|
13
|
+
export declare function runAgent(_apiKey: string, // SDK reads ANTHROPIC_API_KEY from env
|
|
14
|
+
progress?: ProgressSink, onCard?: (card: any) => Promise<string>): Promise<Analysis>;
|