laminark 2.22.3 → 2.22.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "laminark",
3
- "version": "2.22.3",
3
+ "version": "2.22.4",
4
4
  "description": "Persistent adaptive memory for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "laminark",
3
3
  "description": "Persistent adaptive memory for Claude Code. Automatic observation capture, semantic search, topic detection, knowledge graph, and web visualization.",
4
- "version": "2.22.3",
4
+ "version": "2.22.4",
5
5
  "author": {
6
6
  "name": "NoobyNull"
7
7
  },
@@ -33,8 +33,10 @@ if [ -f "$DEPS_OK_SENTINEL" ]; then
33
33
  SENTINEL_VERSION=$(cat "$DEPS_OK_SENTINEL" 2>/dev/null)
34
34
  fi
35
35
 
36
- if [ "$SENTINEL_VERSION" = "$CURRENT_VERSION" ]; then
37
- # Already verified for this version — skip
36
+ NATIVE_BINDING="$PLUGIN_ROOT/node_modules/better-sqlite3/build/Release/better_sqlite3.node"
37
+
38
+ if [ "$SENTINEL_VERSION" = "$CURRENT_VERSION" ] && [ -f "$NATIVE_BINDING" ]; then
39
+ # Already verified for this version and native module exists — skip
38
40
  :
39
41
  elif ! verify_handler; then
40
42
  log_repair "Handler import failed (v$CURRENT_VERSION), installing dependencies"
@@ -47,8 +47,8 @@ echo " Version: $LATEST_VERSION"
47
47
  WORK_DIR=$(mktemp -d)
48
48
  trap 'rm -rf "$WORK_DIR"' EXIT
49
49
 
50
- npm pack laminark@"$LATEST_VERSION" --pack-destination "$WORK_DIR" --silent 2>/dev/null
51
- TARBALL=$(ls "$WORK_DIR"/laminark-*.tgz 2>/dev/null | head -1)
50
+ npm pack laminark@"$LATEST_VERSION" --pack-destination "$WORK_DIR" 2>/dev/null
51
+ TARBALL=$(find "$WORK_DIR" -name "laminark-*.tgz" -maxdepth 1 2>/dev/null | head -1)
52
52
  if [ -z "$TARBALL" ]; then
53
53
  echo "Error: failed to download package"
54
54
  exit 1
@@ -187,15 +187,64 @@ done
187
187
 
188
188
  echo " Marketplace registered."
189
189
 
190
- # Step 6: Register with Claude Code's plugin system (if CLI available and not nested)
190
+ # Step 6: Register with Claude Code's plugin system
191
+ echo ""
192
+ echo "Registering plugin..."
193
+
194
+ REGISTERED=false
195
+
196
+ # Try the CLI first (only works outside a Claude Code session)
191
197
  if command -v claude &> /dev/null && [ -z "$CLAUDECODE" ]; then
192
- echo ""
193
- echo "Registering with Claude Code..."
194
198
  claude plugin marketplace remove laminark 2>/dev/null || true
195
199
  claude plugin marketplace add "$MARKETPLACE_BASE" 2>/dev/null || true
196
200
  claude plugin uninstall laminark@laminark 2>/dev/null || true
197
- claude plugin install laminark@laminark 2>/dev/null || true
198
- echo " Registered."
201
+ if claude plugin install laminark@laminark 2>/dev/null; then
202
+ REGISTERED=true
203
+ echo " Registered via CLI."
204
+ fi
205
+ fi
206
+
207
+ # Fallback: write registration files directly (CLI may fail silently)
208
+ if [ "$REGISTERED" = false ]; then
209
+ INSTALLED_FILE="$CLAUDE_HOME/plugins/installed_plugins.json"
210
+ mkdir -p "$CLAUDE_HOME/plugins"
211
+
212
+ node -e '
213
+ const fs = require("fs");
214
+ const path = process.argv[1];
215
+ const version = process.argv[2];
216
+
217
+ let data = { version: 2, plugins: {} };
218
+ if (fs.existsSync(path)) {
219
+ try { data = JSON.parse(fs.readFileSync(path, "utf8")); } catch {}
220
+ }
221
+
222
+ data.plugins.laminark = {
223
+ marketplace: "laminark",
224
+ version: version,
225
+ enabled: true
226
+ };
227
+
228
+ fs.writeFileSync(path, JSON.stringify(data, null, 2) + "\n");
229
+ ' "$INSTALLED_FILE" "$LATEST_VERSION"
230
+
231
+ # Enable in settings.json
232
+ node -e '
233
+ const fs = require("fs");
234
+ const settingsPath = process.argv[1];
235
+
236
+ let settings = {};
237
+ if (fs.existsSync(settingsPath)) {
238
+ try { settings = JSON.parse(fs.readFileSync(settingsPath, "utf8")); } catch {}
239
+ }
240
+
241
+ if (!settings.enabledPlugins) settings.enabledPlugins = {};
242
+ settings.enabledPlugins["laminark@laminark"] = true;
243
+
244
+ fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n");
245
+ ' "$SETTINGS_FILE"
246
+
247
+ echo " Registered via direct file write."
199
248
  fi
200
249
 
201
250
  # Clean up old version caches
@@ -62,8 +62,8 @@ WORK_DIR=$(mktemp -d)
62
62
  trap 'rm -rf "$WORK_DIR"' EXIT
63
63
 
64
64
  echo "Downloading v$LATEST_VERSION..."
65
- npm pack laminark@"$LATEST_VERSION" --pack-destination "$WORK_DIR" --silent 2>/dev/null
66
- TARBALL=$(ls "$WORK_DIR"/laminark-*.tgz 2>/dev/null | head -1)
65
+ npm pack laminark@"$LATEST_VERSION" --pack-destination "$WORK_DIR" 2>/dev/null
66
+ TARBALL=$(find "$WORK_DIR" -name "laminark-*.tgz" -maxdepth 1 2>/dev/null | head -1)
67
67
  if [ -z "$TARBALL" ]; then
68
68
  echo "Error: failed to download package"
69
69
  exit 1
@@ -147,6 +147,45 @@ fi
147
147
  # Remove orphan marker if present
148
148
  rm -f "$NEW_CACHE/.orphaned_at"
149
149
 
150
+ # Update version in installed_plugins.json
151
+ INSTALLED_FILE="$CLAUDE_HOME/plugins/installed_plugins.json"
152
+ if [ -f "$INSTALLED_FILE" ]; then
153
+ node -e '
154
+ const fs = require("fs");
155
+ const path = process.argv[1];
156
+ const version = process.argv[2];
157
+
158
+ let data = { version: 2, plugins: {} };
159
+ try { data = JSON.parse(fs.readFileSync(path, "utf8")); } catch {}
160
+
161
+ if (!data.plugins.laminark) {
162
+ data.plugins.laminark = { marketplace: "laminark", enabled: true };
163
+ }
164
+ data.plugins.laminark.version = version;
165
+
166
+ fs.writeFileSync(path, JSON.stringify(data, null, 2) + "\n");
167
+ ' "$INSTALLED_FILE" "$LATEST_VERSION"
168
+ log "Plugin registry updated."
169
+ fi
170
+
171
+ # Ensure plugin is enabled in settings.json
172
+ SETTINGS_FILE="$CLAUDE_HOME/settings.json"
173
+ if [ -f "$SETTINGS_FILE" ]; then
174
+ node -e '
175
+ const fs = require("fs");
176
+ const settingsPath = process.argv[1];
177
+
178
+ let settings = {};
179
+ try { settings = JSON.parse(fs.readFileSync(settingsPath, "utf8")); } catch {}
180
+
181
+ if (!settings.enabledPlugins) settings.enabledPlugins = {};
182
+ if (!settings.enabledPlugins["laminark@laminark"]) {
183
+ settings.enabledPlugins["laminark@laminark"] = true;
184
+ fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n");
185
+ }
186
+ ' "$SETTINGS_FILE"
187
+ fi
188
+
150
189
  echo ""
151
190
  echo "Updated: v$CURRENT_VERSION → v$LATEST_VERSION"
152
191
  echo ""