laminark 0.1.0 → 2.21.7

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 (52) hide show
  1. package/.claude-plugin/marketplace.json +15 -0
  2. package/README.md +71 -36
  3. package/package.json +7 -9
  4. package/plugin/.claude-plugin/plugin.json +1 -1
  5. package/plugin/dist/hooks/handler.d.ts +1 -3
  6. package/plugin/dist/hooks/handler.d.ts.map +1 -1
  7. package/plugin/dist/hooks/handler.js +22 -310
  8. package/plugin/dist/hooks/handler.js.map +1 -1
  9. package/plugin/dist/index.d.ts +1 -3
  10. package/plugin/dist/index.d.ts.map +1 -1
  11. package/plugin/dist/index.js +392 -1895
  12. package/plugin/dist/index.js.map +1 -1
  13. package/plugin/dist/{observations-CorAAc1A.d.mts → observations-Ch0nc47i.d.mts} +1 -23
  14. package/plugin/dist/observations-Ch0nc47i.d.mts.map +1 -0
  15. package/plugin/dist/{tool-registry-e710BvXq.mjs → tool-registry-CZ3mJ4iR.mjs} +13 -932
  16. package/plugin/dist/tool-registry-CZ3mJ4iR.mjs.map +1 -0
  17. package/plugin/hooks/hooks.json +6 -6
  18. package/plugin/scripts/README.md +1 -19
  19. package/plugin/scripts/bump-version.sh +3 -1
  20. package/plugin/scripts/ensure-deps.sh +2 -5
  21. package/plugin/scripts/install.sh +39 -115
  22. package/plugin/scripts/local-install.sh +58 -93
  23. package/plugin/scripts/setup-tmpdir.sh +65 -0
  24. package/plugin/scripts/uninstall.sh +38 -76
  25. package/plugin/scripts/update.sh +69 -20
  26. package/plugin/scripts/verify-install.sh +25 -69
  27. package/plugin/ui/activity.js +0 -12
  28. package/plugin/ui/app.js +54 -24
  29. package/plugin/ui/graph.js +186 -413
  30. package/plugin/ui/help.js +172 -876
  31. package/plugin/ui/index.html +242 -506
  32. package/plugin/ui/settings.js +17 -781
  33. package/plugin/ui/styles.css +44 -990
  34. package/plugin/ui/timeline.js +2 -2
  35. package/plugin/CLAUDE.md +0 -10
  36. package/plugin/commands/recall.md +0 -55
  37. package/plugin/commands/remember.md +0 -34
  38. package/plugin/commands/resume.md +0 -45
  39. package/plugin/commands/stash.md +0 -34
  40. package/plugin/commands/status.md +0 -33
  41. package/plugin/dist/observations-CorAAc1A.d.mts.map +0 -1
  42. package/plugin/dist/tool-registry-e710BvXq.mjs.map +0 -1
  43. package/plugin/laminark.db +0 -0
  44. package/plugin/package.json +0 -17
  45. package/plugin/scripts/dev-sync.sh +0 -58
  46. package/plugin/ui/help/activity-feed.png +0 -0
  47. package/plugin/ui/help/analysis-panel.png +0 -0
  48. package/plugin/ui/help/graph-toolbar.png +0 -0
  49. package/plugin/ui/help/graph-view.png +0 -0
  50. package/plugin/ui/help/settings.png +0 -0
  51. package/plugin/ui/help/timeline.png +0 -0
  52. package/plugin/ui/tools.js +0 -826
@@ -1,39 +1,88 @@
1
1
  #!/bin/bash
2
- # Update Laminark to the latest version via npm
2
+ # Update Laminark plugin to the latest version
3
3
 
4
4
  set -e
5
5
 
6
- echo "Laminark Updater"
7
- echo "================"
6
+ echo "Laminark Update Checker"
7
+ echo "======================="
8
8
  echo ""
9
9
 
10
- # Check if npm is available
11
- if ! command -v npm &> /dev/null; then
12
- echo "Error: npm not found"
10
+ # Check if claude CLI is available
11
+ if ! command -v claude &> /dev/null; then
12
+ echo "Error: claude CLI not found"
13
+ echo "Please install Claude Code first: https://claude.com/claude-code"
13
14
  exit 1
14
15
  fi
15
16
 
16
- # Check if installed
17
- CURRENT_VERSION=$(npm list -g laminark --depth=0 2>/dev/null | grep laminark@ | sed 's/.*@//' || echo "")
18
- if [ -z "$CURRENT_VERSION" ]; then
19
- echo "Laminark is not installed globally."
20
- echo "Run: ./plugin/scripts/install.sh"
17
+ # Check if plugin is installed
18
+ if ! claude plugin list 2>/dev/null | grep -q "laminark"; then
19
+ echo "Laminark is not installed."
20
+ echo "Run ./scripts/install.sh to install it."
21
21
  exit 1
22
22
  fi
23
23
 
24
+ # Get current version
25
+ CURRENT_VERSION=$(claude plugin list 2>/dev/null | grep "laminark" | awk '{print $2}' || echo "unknown")
24
26
  echo "Currently installed: v$CURRENT_VERSION"
25
- echo ""
26
- echo "Updating..."
27
- npm update -g laminark
28
27
 
29
- NEW_VERSION=$(npm list -g laminark --depth=0 2>/dev/null | grep laminark@ | sed 's/.*@//' || echo "unknown")
30
- echo ""
31
- if [ "$CURRENT_VERSION" = "$NEW_VERSION" ]; then
32
- echo "✓ Already at latest version: v$NEW_VERSION"
28
+ # Check for updates (try to get latest version from GitHub)
29
+ echo "Checking for updates..."
30
+ LATEST_VERSION=$(curl -fsSL https://api.github.com/repos/NoobyNull/Laminark/releases/latest 2>/dev/null | grep '"tag_name"' | sed -E 's/.*"v?([^"]+)".*/\1/' || echo "")
31
+
32
+ if [ -z "$LATEST_VERSION" ]; then
33
+ echo "Warning: Could not check for updates (GitHub API unavailable)"
34
+ echo ""
35
+ read -p "Force reinstall anyway? (y/N): " -n 1 -r
36
+ echo ""
37
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
38
+ echo "Update cancelled."
39
+ exit 0
40
+ fi
41
+ FORCE_UPDATE=true
33
42
  else
34
- echo " Updated: v$CURRENT_VERSION → v$NEW_VERSION"
43
+ echo "Latest available: v$LATEST_VERSION"
44
+ echo ""
45
+
46
+ # Compare versions
47
+ if [ "$CURRENT_VERSION" = "$LATEST_VERSION" ]; then
48
+ echo "You already have the latest version!"
49
+ echo ""
50
+ read -p "Reinstall anyway? (y/N): " -n 1 -r
51
+ echo ""
52
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
53
+ echo "Update cancelled."
54
+ exit 0
55
+ fi
56
+ fi
35
57
  fi
58
+
59
+ # Set up TMPDIR to avoid EXDEV errors
60
+ CLAUDE_DIR="${CLAUDE_HOME:-$HOME/.claude}"
61
+ SAFE_TMP="$CLAUDE_DIR/tmp"
62
+ mkdir -p "$SAFE_TMP"
63
+
64
+ # Reinstall the plugin
36
65
  echo ""
37
- echo "Restart your Claude Code session for changes to take effect."
66
+ echo "Updating Laminark..."
67
+ TMPDIR="$SAFE_TMP" claude plugin remove laminark 2>/dev/null || true
68
+ TMPDIR="$SAFE_TMP" claude plugin install laminark
69
+ STATUS=$?
70
+
71
+ # Clean up
72
+ rm -rf "$SAFE_TMP"
73
+
74
+ if [ $STATUS -eq 0 ]; then
75
+ NEW_VERSION=$(claude plugin list 2>/dev/null | grep "laminark" | awk '{print $2}' || echo "unknown")
76
+ echo ""
77
+ echo "✓ Laminark updated successfully!"
78
+ echo " Previous version: v$CURRENT_VERSION"
79
+ echo " Current version: v$NEW_VERSION"
80
+ echo ""
81
+ echo "Restart your Claude Code session for changes to take effect."
82
+ else
83
+ echo ""
84
+ echo "✗ Update failed with exit code $STATUS"
85
+ exit $STATUS
86
+ fi
38
87
 
39
88
  exit 0
@@ -1,87 +1,43 @@
1
1
  #!/bin/bash
2
- # Verify Laminark installation
3
- # Checks: npm global package, MCP server, hooks in settings.json
2
+ # Verify Laminark plugin installation
3
+ # Checks: plugin registered, enabled status, provides next steps
4
4
 
5
5
  set -e
6
6
 
7
7
  echo "Checking Laminark installation..."
8
8
  echo ""
9
9
 
10
- ERRORS=0
11
-
12
- # Check 1: npm global package
13
- NPM_VERSION=$(npm list -g laminark --depth=0 2>/dev/null | grep laminark@ | sed 's/.*@//' || echo "")
14
- if [ -n "$NPM_VERSION" ]; then
15
- echo "✓ npm package: v$NPM_VERSION"
16
- else
17
- # Check for npm link (dev install)
18
- if command -v laminark-server &> /dev/null; then
19
- echo "✓ laminark-server on PATH (linked)"
20
- else
21
- echo "✗ npm package not installed"
22
- ERRORS=$((ERRORS + 1))
23
- fi
24
- fi
25
-
26
- # Check 2: laminark-server binary
27
- if command -v laminark-server &> /dev/null; then
28
- echo "✓ laminark-server binary available"
29
- else
30
- echo "✗ laminark-server not found on PATH"
31
- ERRORS=$((ERRORS + 1))
32
- fi
33
-
34
- # Check 3: laminark-hook binary
35
- if command -v laminark-hook &> /dev/null; then
36
- echo "✓ laminark-hook binary available"
37
- else
38
- echo "⚠ laminark-hook not on PATH (hooks may use direct node path)"
39
- fi
40
-
41
- # Check 4: Claude CLI
10
+ # Check if claude CLI is available
42
11
  if ! command -v claude &> /dev/null; then
43
- echo "✗ claude CLI not found"
44
- ERRORS=$((ERRORS + 1))
45
- else
46
- # Check 5: MCP server registration
47
- if claude mcp list 2>/dev/null | grep -q "laminark"; then
48
- echo "✓ MCP server registered"
49
- else
50
- echo "✗ MCP server not registered"
51
- echo " Run: claude mcp add-json laminark '{\"command\":\"laminark-server\"}' -s user"
52
- ERRORS=$((ERRORS + 1))
53
- fi
12
+ echo "✗ Error: claude CLI not found"
13
+ echo " Please install Claude Code first: https://claude.com/claude-code"
14
+ exit 1
54
15
  fi
55
16
 
56
- # Check 6: Hooks in settings.json
57
- SETTINGS_FILE="${CLAUDE_HOME:-$HOME/.claude}/settings.json"
58
- if [ -f "$SETTINGS_FILE" ]; then
59
- if grep -q "laminark" "$SETTINGS_FILE"; then
60
- echo "✓ Hooks configured in settings.json"
61
- else
62
- echo "✗ No laminark hooks in settings.json"
63
- ERRORS=$((ERRORS + 1))
64
- fi
17
+ # Check if plugin is registered
18
+ if claude plugin list 2>/dev/null | grep -q "laminark"; then
19
+ echo "✓ Plugin registered: laminark"
65
20
  else
66
- echo "✗ Settings file not found: $SETTINGS_FILE"
67
- ERRORS=$((ERRORS + 1))
21
+ echo "✗ Plugin not registered"
22
+ echo " Please run: ./scripts/local-install.sh"
23
+ exit 1
68
24
  fi
69
25
 
70
- # Check 7: Data directory
71
- DATA_DIR="$HOME/.laminark"
72
- if [ -d "$DATA_DIR" ]; then
73
- echo "✓ Data directory exists: $DATA_DIR"
26
+ # Check if plugin is enabled
27
+ if claude plugin list 2>/dev/null | grep "laminark" | grep -q "enabled"; then
28
+ echo "✓ Plugin enabled"
74
29
  else
75
- echo "⚠ Data directory not yet created (will be created on first use)"
30
+ echo "⚠ Plugin registered but not enabled"
31
+ echo " Run: claude plugin enable laminark"
76
32
  fi
77
33
 
78
34
  echo ""
79
- if [ $ERRORS -eq 0 ]; then
80
- echo "Installation verified successfully!"
81
- echo ""
82
- echo "Start a new Claude Code session to use Laminark."
83
- else
84
- echo "Found $ERRORS issue(s). Run ./plugin/scripts/install.sh to fix."
85
- fi
35
+ echo "Installation verified successfully!"
36
+ echo ""
37
+ echo "Next steps:"
38
+ echo " 1. Start a new Claude Code session"
39
+ echo " 2. Check MCP tools with: /mcp"
40
+ echo " 3. Check hooks with: /hooks"
41
+ echo " 4. Try searching memories with: recall"
86
42
 
87
- exit $ERRORS
43
+ exit 0
@@ -122,12 +122,6 @@
122
122
  var config = EVENT_CONFIG[eventName];
123
123
  if (!config) return;
124
124
 
125
- // Filter out events from other projects
126
- if (detail.projectHash && window.laminarkState && window.laminarkState.currentProject &&
127
- detail.projectHash !== window.laminarkState.currentProject) {
128
- return;
129
- }
130
-
131
125
  var item = {
132
126
  icon: config.icon,
133
127
  label: config.label,
@@ -181,12 +175,6 @@
181
175
  });
182
176
  });
183
177
 
184
- // Clear feed when project changes
185
- var projectSelect = document.getElementById('project-selector');
186
- if (projectSelect) {
187
- projectSelect.addEventListener('change', clearFeed);
188
- }
189
-
190
178
  renderFeed();
191
179
  }
192
180
 
package/plugin/ui/app.js CHANGED
@@ -14,7 +14,6 @@ window.laminarkState = {
14
14
  timeline: null,
15
15
  graphInitialized: false,
16
16
  timelineInitialized: false,
17
- toolsInitialized: false,
18
17
  currentProject: null,
19
18
  };
20
19
 
@@ -226,30 +225,52 @@ function connectSSE() {
226
225
  recordEventReceived();
227
226
  });
228
227
 
229
- // Helper: dispatch SSE events that belong to the currently selected project.
230
- // Events with a mismatched projectHash are dropped; events without projectHash
231
- // are allowed through (server may not always tag them, e.g. older builds).
232
- function dispatchIfCurrentProject(eventName, data) {
233
- if (data.projectHash && data.projectHash !== window.laminarkState.currentProject) return;
234
- document.dispatchEvent(new CustomEvent(eventName, { detail: data }));
235
- }
236
-
237
228
  eventSource.addEventListener('new_observation', function (e) {
238
229
  var data = JSON.parse(e.data);
239
230
  recordEventReceived();
240
- dispatchIfCurrentProject('laminark:new_observation', data);
231
+ document.dispatchEvent(new CustomEvent('laminark:new_observation', { detail: data }));
241
232
  });
242
233
 
243
234
  eventSource.addEventListener('entity_updated', function (e) {
244
235
  var data = JSON.parse(e.data);
245
236
  recordEventReceived();
246
- dispatchIfCurrentProject('laminark:entity_updated', data);
237
+ document.dispatchEvent(new CustomEvent('laminark:entity_updated', { detail: data }));
247
238
  });
248
239
 
249
240
  eventSource.addEventListener('topic_shift', function (e) {
250
241
  var data = JSON.parse(e.data);
251
242
  recordEventReceived();
252
- dispatchIfCurrentProject('laminark:topic_shift', data);
243
+ document.dispatchEvent(new CustomEvent('laminark:topic_shift', { detail: data }));
244
+ });
245
+
246
+ eventSource.addEventListener('session_start', function (e) {
247
+ var data = JSON.parse(e.data);
248
+ recordEventReceived();
249
+ document.dispatchEvent(new CustomEvent('laminark:session_start', { detail: data }));
250
+ });
251
+
252
+ eventSource.addEventListener('session_end', function (e) {
253
+ var data = JSON.parse(e.data);
254
+ recordEventReceived();
255
+ document.dispatchEvent(new CustomEvent('laminark:session_end', { detail: data }));
256
+ });
257
+
258
+ eventSource.addEventListener('path_started', function (e) {
259
+ var data = JSON.parse(e.data);
260
+ recordEventReceived();
261
+ document.dispatchEvent(new CustomEvent('laminark:path_started', { detail: data }));
262
+ });
263
+
264
+ eventSource.addEventListener('path_waypoint', function (e) {
265
+ var data = JSON.parse(e.data);
266
+ recordEventReceived();
267
+ document.dispatchEvent(new CustomEvent('laminark:path_waypoint', { detail: data }));
268
+ });
269
+
270
+ eventSource.addEventListener('path_resolved', function (e) {
271
+ var data = JSON.parse(e.data);
272
+ recordEventReceived();
273
+ document.dispatchEvent(new CustomEvent('laminark:path_resolved', { detail: data }));
253
274
  });
254
275
 
255
276
  eventSource.onerror = function () {
@@ -298,10 +319,6 @@ async function initProjectSelector() {
298
319
 
299
320
  select.addEventListener('change', function () {
300
321
  window.laminarkState.currentProject = select.value;
301
- // Clear any pending batch updates from the previous project
302
- if (window.laminarkGraph && window.laminarkGraph.clearBatchQueue) {
303
- window.laminarkGraph.clearBatchQueue();
304
- }
305
322
  // Reload all data for the new project
306
323
  if (window.laminarkGraph && window.laminarkState.graphInitialized) {
307
324
  window.laminarkGraph.loadGraphData();
@@ -366,11 +383,6 @@ function initNavigation() {
366
383
  window.laminarkGraph.loadGraphData();
367
384
  window.laminarkState.graphInitialized = true;
368
385
  }
369
- } else if (targetView === 'tools-view' && !window.laminarkState.toolsInitialized) {
370
- if (window.laminarkTools) {
371
- window.laminarkTools.initTools('tools-view');
372
- window.laminarkState.toolsInitialized = true;
373
- }
374
386
  }
375
387
  });
376
388
  });
@@ -1469,8 +1481,7 @@ document.addEventListener('DOMContentLoaded', async function () {
1469
1481
  document.addEventListener('laminark:entity_updated', function (e) {
1470
1482
  if (!window.laminarkGraph) return;
1471
1483
  var data = e.detail;
1472
- // Only add entities belonging to the currently selected project
1473
- if (data && data.id && data.projectHash && data.projectHash === window.laminarkState.currentProject) {
1484
+ if (data && data.id) {
1474
1485
  window.laminarkGraph.queueBatchUpdate({
1475
1486
  type: 'addNode',
1476
1487
  data: {
@@ -1485,13 +1496,32 @@ document.addEventListener('DOMContentLoaded', async function () {
1485
1496
  });
1486
1497
 
1487
1498
  document.addEventListener('laminark:new_observation', function () {
1488
- // Refresh observation counts by reloading graph data (already project-filtered at SSE dispatch)
1499
+ // Refresh observation counts by reloading graph data
1489
1500
  if (window.laminarkGraph) {
1490
1501
  var filters = getActiveFilters();
1491
1502
  window.laminarkGraph.loadGraphData(filters ? { type: filters.join(',') } : undefined);
1492
1503
  }
1493
1504
  });
1494
1505
 
1506
+ // Path overlay event handlers (Plan 02 adds the graph overlay functions)
1507
+ document.addEventListener('laminark:path_started', function (e) {
1508
+ if (window.laminarkGraph && window.laminarkGraph.addPathOverlay) {
1509
+ window.laminarkGraph.addPathOverlay(e.detail);
1510
+ }
1511
+ });
1512
+
1513
+ document.addEventListener('laminark:path_waypoint', function (e) {
1514
+ if (window.laminarkGraph && window.laminarkGraph.updatePathOverlay) {
1515
+ window.laminarkGraph.updatePathOverlay(e.detail);
1516
+ }
1517
+ });
1518
+
1519
+ document.addEventListener('laminark:path_resolved', function (e) {
1520
+ if (window.laminarkGraph && window.laminarkGraph.resolvePathOverlay) {
1521
+ window.laminarkGraph.resolvePathOverlay(e.detail);
1522
+ }
1523
+ });
1524
+
1495
1525
  // Filter change handler for graph (legacy listener)
1496
1526
  document.addEventListener('laminark:filter_change', function () {
1497
1527
  // Filter changes now handled directly in initFilters via graph.filterByType/resetFilters