@ilivemylife/graph-sdk 1.0.6 → 1.0.8

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
@@ -39,43 +39,38 @@ SDK for [iLiveMyLife](https://iLiveMyLife.io) Knowledge Graph.
39
39
  - **Node.js 18+** — [download](https://nodejs.org/)
40
40
  - **iLiveMyLife account** — sign up at [iLiveMyLife.io](https://iLiveMyLife.io)
41
41
 
42
- ## Installation
42
+ ## Getting Started
43
+
44
+ ### 1. Install
43
45
 
44
46
  ```bash
45
- npm install @ilivemylife/graph-sdk
47
+ npm install -g @ilivemylife/graph-sdk
46
48
  ```
47
49
 
48
- ## Authentication
50
+ ### 2. Login
49
51
 
50
- You need an access token to use the SDK.
51
-
52
- **Option 1: CLI Login (recommended)**
53
52
  ```bash
54
- npx ilml login
55
- # Prompts for email and password in terminal
56
- # Token saved to ~/.ilivemylife/config.json
57
- # After this, CLI commands work automatically
58
- # For SDK, pass token explicitly: createGraphClient({ token })
53
+ ilml login
54
+ ilml doctor # verify installation
59
55
  ```
60
56
 
61
- **Option 2: Programmatic login (for bots and automations)**
62
- ```javascript
63
- const response = await fetch('https://api.ilivemylife.io/api/v1/login', {
64
- method: 'POST',
65
- headers: { 'Content-Type': 'application/json' },
66
- body: JSON.stringify({ email: 'you@example.com', password: '...' })
67
- });
68
- const token = response.headers.get('access-token');
57
+ Token saved to `~/.ilivemylife/config.json`. For per-project accounts, see [Token Priority](#token-priority).
69
58
 
70
- const graph = createGraphClient({ token });
59
+ ### 3. Add to AI tools (optional)
60
+
61
+ ```bash
62
+ # Claude Code (global — available in all projects)
63
+ claude mcp add --scope user ilml -- npx -y @ilivemylife/graph-sdk
64
+
65
+ # Claude Code (current project only)
66
+ claude mcp add ilml -- npx -y @ilivemylife/graph-sdk
71
67
  ```
72
68
 
73
- **Option 3: Browser DevTools (manual)**
74
- 1. Open https://app.ilivemylife.io and log in
75
- 2. Open DevTools (F12) → Network tab
76
- 3. Make any action (refresh page, open a node)
77
- 4. Click any GraphQL request → Headers tab
78
- 5. Copy `access-token` value, use it as: `createGraphClient({ token: 'copied-value' })`
69
+ For Cursor, Windsurf, Claude Desktop — see [MCP Setup](#mcp-server-ai-assistant-integration).
70
+
71
+ ---
72
+
73
+ ## Authentication Details
79
74
 
80
75
  ### Config File
81
76
 
@@ -94,22 +89,18 @@ After `ilml login`, config is saved as JSON:
94
89
  }
95
90
  ```
96
91
 
97
- - `token` — access token for API requests
98
- - `user` — your account info (cached for display in CLI)
99
- - `rootItemId` — your "My Life" root node ID
100
-
101
92
  ### Token Priority
102
93
 
103
- The SDK and CLI resolve tokens in this order (first found wins):
94
+ The SDK, CLI, and MCP server resolve tokens in this order (first found wins):
104
95
 
105
96
  | Priority | Source | How to set |
106
97
  |----------|--------|------------|
107
98
  | 1 | Local config | `ilml login --local` → `.ilivemylife/config.json` in project dir |
108
- | 2 | `.env` file | Create `.env` with `ILML_TOKEN=your-token` in project dir |
99
+ | 2 | `.env` file | `ILML_TOKEN=your-token` in project dir |
109
100
  | 3 | Global config | `ilml login` → `~/.ilivemylife/config.json` |
110
101
  | 4 | Environment variable | `export ILML_TOKEN=your-token` |
111
102
 
112
- This lets you use different accounts per project:
103
+ Use different accounts per project:
113
104
  ```bash
114
105
  # Global account (default)
115
106
  ilml login
@@ -117,11 +108,27 @@ ilml login
117
108
  # Project-specific account (overrides global)
118
109
  cd my-project
119
110
  ilml login --local
111
+ ```
112
+
113
+ ### Other Authentication Methods
120
114
 
121
- # Or via .env file
122
- echo "ILML_TOKEN=project-specific-token" > .env
115
+ **Programmatic login (for bots and automations):**
116
+ ```javascript
117
+ const response = await fetch('https://api.ilivemylife.io/api/v1/login', {
118
+ method: 'POST',
119
+ headers: { 'Content-Type': 'application/json' },
120
+ body: JSON.stringify({ email: 'you@example.com', password: '...' })
121
+ });
122
+ const token = response.headers.get('access-token');
123
+ const graph = createGraphClient({ token });
123
124
  ```
124
125
 
126
+ **Browser DevTools (manual):**
127
+ 1. Open https://app.ilivemylife.io and log in
128
+ 2. Open DevTools (F12) → Network tab
129
+ 3. Click any GraphQL request → Headers tab
130
+ 4. Copy `access-token` value
131
+
125
132
  ## Finding Node IDs
126
133
 
127
134
  Node IDs are visible in the URL when viewing a node:
@@ -608,34 +615,56 @@ project-b/.env # ILML_TOKEN=xxx
608
615
 
609
616
  ### Setup
610
617
 
611
- **Claude Code (quick):**
618
+ **Prerequisites:** Run `ilml login` first (see [Getting Started](#getting-started)).
619
+
620
+ **Claude Code:**
612
621
  ```bash
613
- claude mcp add --env ILML_TOKEN=your-token ilml -- ilml-mcp
622
+ # Global (available in all projects)
623
+ claude mcp add --scope user ilml -- ilml-mcp
624
+
625
+ # Or current project only
626
+ claude mcp add ilml -- ilml-mcp
627
+ ```
628
+
629
+ If you didn't install globally (`npm install -g`), use npx:
630
+ ```bash
631
+ claude mcp add --scope user ilml -- npx -y @ilivemylife/graph-sdk
614
632
  ```
615
633
 
616
- **Claude Code (manual)** — add to `~/.claude/settings.json`:
634
+ **Other AI tools** — add to config file:
617
635
 
618
636
  ```json
619
637
  {
620
638
  "mcpServers": {
621
639
  "ilml": {
622
- "command": "ilml-mcp",
623
- "env": { "ILML_TOKEN": "your-token" }
640
+ "command": "npx",
641
+ "args": ["-y", "@ilivemylife/graph-sdk"]
624
642
  }
625
643
  }
626
644
  }
627
645
  ```
628
646
 
629
- **Other AI tools** — same JSON content, different config file:
647
+ Or if installed globally:
648
+ ```json
649
+ {
650
+ "mcpServers": {
651
+ "ilml": {
652
+ "command": "ilml-mcp"
653
+ }
654
+ }
655
+ }
656
+ ```
630
657
 
631
658
  | AI Tool | Config Path |
632
659
  |---------|------------|
633
- | Claude Code | `~/.claude/settings.json` or `claude mcp add` |
660
+ | Claude Code | `claude mcp add` (recommended) or `~/.claude/settings.json` |
634
661
  | Claude Desktop | macOS: `~/Library/Application Support/Claude/claude_desktop_config.json` |
635
662
  | | Windows: `%APPDATA%\Claude\claude_desktop_config.json` |
636
663
  | Cursor | `~/.cursor/mcp.json` |
637
664
  | Windsurf | `~/.codeium/windsurf/mcp_config.json` |
665
+ | IntelliJ IDEA | Settings → Tools → AI Assistant → Model Context Protocol (MCP) |
638
666
 
667
+ Token is resolved automatically: local config > .env > global config > ILML_TOKEN env var.
639
668
  Restart your AI tool after adding the config.
640
669
 
641
670
  ### Available Tools
@@ -691,23 +720,6 @@ import type {
691
720
 
692
721
  ---
693
722
 
694
- ## Publishing New Versions
695
-
696
- ```bash
697
- # First time: login to npm
698
- npm login
699
-
700
- # First publish
701
- npm publish --access public
702
-
703
- # Update versions:
704
- npm run release:patch # 1.0.0 → 1.0.1 (bug fixes)
705
- npm run release:minor # 1.0.0 → 1.1.0 (new features)
706
- npm run release:major # 1.0.0 → 2.0.0 (breaking changes)
707
- ```
708
-
709
- ---
710
-
711
723
  ## License
712
724
 
713
725
  © 2026 Ilya Sorokin. All rights reserved.
package/dist/cli.mjs CHANGED
@@ -523,7 +523,7 @@ function createApolloClient(options) {
523
523
  const { token, httpUrl, wsUrl, enableSubscriptions, webSocketImpl } = options;
524
524
  const requestHeaders = {
525
525
  "access-token": token,
526
- "x-client": `sdk/${"1.0.6"}`
526
+ "x-client": `sdk/${"1.0.8"}`
527
527
  };
528
528
  const httpLink = createHttpLink({
529
529
  uri: httpUrl,
@@ -536,7 +536,7 @@ function createApolloClient(options) {
536
536
  if (enableSubscriptions) {
537
537
  const wsClientOptions = {
538
538
  url: wsUrl,
539
- connectionParams: { "access-token": token, "x-client": `sdk/${"1.0.6"}` }
539
+ connectionParams: { "access-token": token, "x-client": `sdk/${"1.0.8"}` }
540
540
  };
541
541
  if (webSocketImpl) {
542
542
  wsClientOptions.webSocketImpl = webSocketImpl;
@@ -2383,7 +2383,7 @@ async function cmdUpdate() {
2383
2383
  const { execSync } = await import("child_process");
2384
2384
  console.log("Checking for updates...");
2385
2385
  try {
2386
- const currentVersion = "1.0.6";
2386
+ const currentVersion = "1.0.8";
2387
2387
  let latestVersion;
2388
2388
  try {
2389
2389
  const result = execSync("npm view @ilivemylife/graph-sdk version", { encoding: "utf-8" }).trim();
@@ -2413,7 +2413,7 @@ async function cmdDoctor() {
2413
2413
  console.log("\u2550".repeat(60));
2414
2414
  let issues = 0;
2415
2415
  console.log(`
2416
- [Version] ${"1.0.6"}`);
2416
+ [Version] ${"1.0.8"}`);
2417
2417
  const localConfigPath = findLocalConfigFile();
2418
2418
  const globalExists = existsSync2(GLOBAL_CONFIG_FILE);
2419
2419
  console.log("\n[Config Files]");
@@ -2604,11 +2604,11 @@ async function cmdUninstall() {
2604
2604
  console.log("\u2550".repeat(60));
2605
2605
  }
2606
2606
  function showVersion() {
2607
- console.log(`@ilivemylife/graph-sdk v${"1.0.6"}`);
2607
+ console.log(`@ilivemylife/graph-sdk v${"1.0.8"}`);
2608
2608
  }
2609
2609
  function showHelp() {
2610
2610
  console.log(`
2611
- @ilivemylife/graph-sdk v${"1.0.6"}
2611
+ @ilivemylife/graph-sdk v${"1.0.8"}
2612
2612
  CLI for iLiveMyLife Knowledge Graph
2613
2613
 
2614
2614
  USAGE
package/dist/client.cjs CHANGED
@@ -623,7 +623,7 @@ function createApolloClient(options) {
623
623
  const { token, httpUrl, wsUrl, enableSubscriptions, webSocketImpl } = options;
624
624
  const requestHeaders = {
625
625
  "access-token": token,
626
- "x-client": `sdk/${"1.0.6"}`
626
+ "x-client": `sdk/${"1.0.8"}`
627
627
  };
628
628
  const httpLink = createHttpLink({
629
629
  uri: httpUrl,
@@ -636,7 +636,7 @@ function createApolloClient(options) {
636
636
  if (enableSubscriptions) {
637
637
  const wsClientOptions = {
638
638
  url: wsUrl,
639
- connectionParams: { "access-token": token, "x-client": `sdk/${"1.0.6"}` }
639
+ connectionParams: { "access-token": token, "x-client": `sdk/${"1.0.8"}` }
640
640
  };
641
641
  if (webSocketImpl) {
642
642
  wsClientOptions.webSocketImpl = webSocketImpl;
package/dist/client.mjs CHANGED
@@ -550,7 +550,7 @@ function createApolloClient(options) {
550
550
  const { token, httpUrl, wsUrl, enableSubscriptions, webSocketImpl } = options;
551
551
  const requestHeaders = {
552
552
  "access-token": token,
553
- "x-client": `sdk/${"1.0.6"}`
553
+ "x-client": `sdk/${"1.0.8"}`
554
554
  };
555
555
  const httpLink = createHttpLink({
556
556
  uri: httpUrl,
@@ -563,7 +563,7 @@ function createApolloClient(options) {
563
563
  if (enableSubscriptions) {
564
564
  const wsClientOptions = {
565
565
  url: wsUrl,
566
- connectionParams: { "access-token": token, "x-client": `sdk/${"1.0.6"}` }
566
+ connectionParams: { "access-token": token, "x-client": `sdk/${"1.0.8"}` }
567
567
  };
568
568
  if (webSocketImpl) {
569
569
  wsClientOptions.webSocketImpl = webSocketImpl;
@@ -540,7 +540,7 @@ function createApolloClient(options) {
540
540
  const { token, httpUrl, wsUrl, enableSubscriptions, webSocketImpl } = options;
541
541
  const requestHeaders = {
542
542
  "access-token": token,
543
- "x-client": `sdk/${"1.0.6"}`
543
+ "x-client": `sdk/${"1.0.8"}`
544
544
  };
545
545
  const httpLink = createHttpLink({
546
546
  uri: httpUrl,
@@ -553,7 +553,7 @@ function createApolloClient(options) {
553
553
  if (enableSubscriptions) {
554
554
  const wsClientOptions = {
555
555
  url: wsUrl,
556
- connectionParams: { "access-token": token, "x-client": `sdk/${"1.0.6"}` }
556
+ connectionParams: { "access-token": token, "x-client": `sdk/${"1.0.8"}` }
557
557
  };
558
558
  if (webSocketImpl) {
559
559
  wsClientOptions.webSocketImpl = webSocketImpl;
@@ -1278,6 +1278,43 @@ When adding item, set \`refId\` to target node ID. The new node becomes a shortc
1278
1278
  - Nodes can have shareable invite links
1279
1279
  - Users in node see each other's icons
1280
1280
  - Privacy controlled via tags (private, wallet, etc.)
1281
+ `,
1282
+ lifebot: `
1283
+ # Lifebot (AI Assistant)
1284
+
1285
+ Lifebot is the built-in AI assistant in iLiveMyLife. Understanding how to interact with it is important.
1286
+
1287
+ ## Enabling Lifebot on a Node
1288
+
1289
+ - Add \`assist\` tag to the node \u2014 this enables Lifebot for that node
1290
+ - Without \`assist\` tag, Lifebot will NOT respond to messages
1291
+ - Exception: personal/root nodes may have Lifebot enabled by default
1292
+
1293
+ ## Messaging Lifebot
1294
+
1295
+ ### Guaranteeing a Response
1296
+ - Use \`@Lifebot\` mention in message text \u2014 guarantees Lifebot will respond
1297
+ - Without mention, Lifebot may decide the message isn't addressed to him
1298
+ - In collaborative nodes with multiple users, \`@Lifebot\` is especially important
1299
+
1300
+ ### The \`lifebot\` Parameter
1301
+ - \`lifebot: "on"\` \u2014 this is the DEFAULT, does nothing special
1302
+ - \`lifebot: "off"\` \u2014 explicitly disables Lifebot for this specific message
1303
+ - The parameter exists to DISABLE Lifebot when needed, not to enable it
1304
+
1305
+ ## graph_ask_lifebot vs graph_add_message
1306
+
1307
+ | Method | Behavior |
1308
+ |--------|----------|
1309
+ | \`graph_ask_lifebot\` | Synchronous \u2014 waits for response, returns it directly. May timeout. |
1310
+ | \`graph_add_message\` | Asynchronous \u2014 sends message, Lifebot responds later. Read with \`graph_messages\`. |
1311
+
1312
+ ## Best Practices
1313
+
1314
+ 1. Always add \`assist\` tag when creating nodes where Lifebot should respond
1315
+ 2. Use \`@Lifebot\` in collaborative/shared nodes
1316
+ 3. For immediate answers, use \`graph_ask_lifebot\`
1317
+ 4. For fire-and-forget, use \`graph_add_message\` and check response later
1281
1318
  `
1282
1319
  };
1283
1320
  async function isHighPrivacyNodeOrRef(graph, item) {
@@ -1308,7 +1345,7 @@ function getGraphInfo(topic) {
1308
1345
  if (!topic || topic === "all") {
1309
1346
  return Object.values(GRAPH_KNOWLEDGE).join("\n---\n");
1310
1347
  }
1311
- return GRAPH_KNOWLEDGE[topic] || `Unknown topic: ${topic}. Available: markers, tags, links, privacy, all`;
1348
+ return GRAPH_KNOWLEDGE[topic] || `Unknown topic: ${topic}. Available: markers, tags, links, privacy, lifebot, all`;
1312
1349
  }
1313
1350
  var server = new Server(
1314
1351
  {
@@ -1639,8 +1676,8 @@ To enable markers on parent: tags: ["#markerList#0000018190aaf813-a61a6f263e6a00
1639
1676
  properties: {
1640
1677
  topic: {
1641
1678
  type: "string",
1642
- enum: ["markers", "tags", "links", "privacy", "all"],
1643
- description: "Topic to get info about: markers (status system), tags (special tags), links (references), privacy (access control), all (everything)"
1679
+ enum: ["markers", "tags", "links", "privacy", "lifebot", "all"],
1680
+ description: "Topic to get info about: markers (status system), tags (special tags), links (references), privacy (access control), lifebot (AI assistant), all (everything)"
1644
1681
  }
1645
1682
  },
1646
1683
  required: []
@@ -2017,6 +2054,30 @@ function cleanup() {
2017
2054
  process.on("SIGTERM", cleanup);
2018
2055
  process.on("SIGINT", cleanup);
2019
2056
  async function main() {
2057
+ if (process.argv.includes("--help") || process.argv.includes("-h")) {
2058
+ console.log(`iLiveMyLife Graph MCP Server v${VERSION}
2059
+
2060
+ Usage: ilml-mcp
2061
+
2062
+ This is an MCP server for AI assistants (Claude Code, Cursor, etc).
2063
+ It runs as a long-lived process and communicates via stdin/stdout.
2064
+
2065
+ Setup:
2066
+ 1. Install and login:
2067
+ npm install -g @ilivemylife/graph-sdk
2068
+ ilml login
2069
+
2070
+ 2. Add to Claude Code:
2071
+ claude mcp add --scope user ilml -- ilml-mcp
2072
+
2073
+ 3. Or without global install:
2074
+ claude mcp add --scope user ilml -- npx -y @ilivemylife/graph-sdk
2075
+
2076
+ Token is resolved from: local config > .env > global config > ILML_TOKEN env var
2077
+
2078
+ More info: https://www.npmjs.com/package/@ilivemylife/graph-sdk`);
2079
+ process.exit(0);
2080
+ }
2020
2081
  const transport = new StdioServerTransport();
2021
2082
  await server.connect(transport);
2022
2083
  console.error("iLiveMyLife Graph MCP Server running");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ilivemylife/graph-sdk",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "SDK and CLI for iLiveMyLife Knowledge Graph",
5
5
  "license": "UNLICENSED",
6
6
  "engines": {