@massa-ai/claude-plugin 1.45.0 → 1.46.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "massa-ai",
3
- "version": "1.45.0",
3
+ "version": "1.46.0",
4
4
  "description": "massa-ai — semantic code search, durable memory, symbol graph, and context compression",
5
5
  "author": {
6
6
  "name": "Luiz Massa",
package/install.sh CHANGED
@@ -44,6 +44,11 @@ source "$REPO_ROOT/scripts/lib/installer-shared.sh"
44
44
  SCOPE="user"
45
45
  UNINSTALL=0
46
46
  DRY_RUN=0
47
+ # Served-plugin version on the marketplace route, filled by
48
+ # refresh_marketplace_cache and read by record_plugin_version. Declared at
49
+ # top level so routes that never refresh (file route, uninstall) cannot trip
50
+ # `set -u` (CMR R3).
51
+ PLUGIN_SERVED_VERSION=""
47
52
  # The marketplace root to register. install-harness.sh resolves this once for
48
53
  # the whole run (--plugin-source local|copy|auto); a direct invocation of this
49
54
  # script defaults to the checkout it lives in.
@@ -426,7 +431,6 @@ record_plugin_version() {
426
431
  fi
427
432
 
428
433
  local version installed_at route
429
- version="$(sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$SCRIPT_DIR/package.json" | head -n 1)"
430
434
  installed_at="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
431
435
  # installRoute (T8, design F1): installer-owned, engine-read-only. The
432
436
  # marketplace route (register_claude_plugin succeeded) serves agents in
@@ -434,6 +438,17 @@ record_plugin_version() {
434
438
  # Written on EVERY install path — an absent field is what makes the switch
435
439
  # engine refuse loud rather than guess (hosts.ts detectRoute).
436
440
  if [[ "$PLUGIN_ROUTE" -eq 1 ]]; then route="marketplace"; else route="file"; fi
441
+ # Version claim (CMR-02/03): the file route records the bundle version — it
442
+ # IS what was just copied. The marketplace route records what the CLI
443
+ # actually serves (refresh_marketplace_cache), which the version-pinned
444
+ # cache can hold BEHIND the bundle; recording the bundle version there is
445
+ # the lie that froze this host's harness gate at a stale cache. Empty
446
+ # served version → record no version at all (next run retries).
447
+ if [[ "$PLUGIN_ROUTE" -eq 1 ]]; then
448
+ version="$PLUGIN_SERVED_VERSION"
449
+ else
450
+ version="$(sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$SCRIPT_DIR/package.json" | head -n 1)"
451
+ fi
437
452
 
438
453
  # Tolerant of a corrupt/missing state file (rewrites a minimal valid one —
439
454
  # AC-8). A record-write failure warns but never fails the install: the next
@@ -458,7 +473,13 @@ const rec =
458
473
  data.platforms[host] && typeof data.platforms[host] === "object" && !Array.isArray(data.platforms[host])
459
474
  ? data.platforms[host]
460
475
  : { root, skillsOwner: "plugin", skills: [] };
461
- rec.plugin = { version, installedAt };
476
+ // An empty version means the served version was unreadable (CMR-03): keep
477
+ // any prior plugin record untouched and claim nothing new — an absent/stale
478
+ // record is what makes the next harness run retry. installRoute is still
479
+ // written below on every path.
480
+ if (version) {
481
+ rec.plugin = { version, installedAt };
482
+ }
462
483
  // installRoute is installer-owned (like plugin above); modelProfile is NEVER
463
484
  // written here — the switch engine (packages/shared/src/profile-switch/) is
464
485
  // its sole writer, and this installer only ever reads it (see
@@ -546,6 +567,77 @@ unregister_claude_plugin() {
546
567
  claude plugin marketplace remove "$PLUGIN_MARKETPLACE" </dev/null >/dev/null 2>&1 || true
547
568
  }
548
569
 
570
+ # ── Marketplace cache refresh (CMR-01..05) ──────────────────────────────────
571
+ # `claude plugin install` is an idempotent no-op on an already-installed
572
+ # plugin, and the CLI serves a version-pinned cache snapshot — so an upgraded
573
+ # bundle never reaches an already-registered host by itself (observed: cache
574
+ # pinned at 1.28.0 while the checkout walked to 1.44.0). `claude plugin
575
+ # update` re-materializes the cache from a directory-source marketplace
576
+ # (verified against the real CLI, spec R1), so run it exactly when the served
577
+ # version is OLDER than the bundle — never on equal (no-op) or newer (that
578
+ # would downgrade; mirrors the harness "never downgrades" policy).
579
+
580
+ # Prints the version Claude actually serves for $PLUGIN_ID, or "" when it
581
+ # cannot be determined. Tolerant like recorded_profile: a missing/corrupt
582
+ # registry, a legacy non-array entry shape, or an absent entry all mean
583
+ # "unknown", never a failure. Claude-specific registry format — deliberately
584
+ # NOT in installer-shared.sh (Codex's registry differs; don't generalize one
585
+ # host's file shape).
586
+ claude_served_plugin_version() {
587
+ local runner="$1"
588
+ "$runner" - "$PLUGIN_REGISTRY" "$PLUGIN_ID" <<'NODE'
589
+ const fs = require("fs");
590
+ const [, , file, id] = process.argv;
591
+ try {
592
+ const data = JSON.parse(fs.readFileSync(file, "utf8"));
593
+ const entries = data && data.plugins ? data.plugins[id] : null;
594
+ if (!Array.isArray(entries) || entries.length === 0) process.exit(0);
595
+ const rec = entries.find((e) => e && e.scope === "user") ?? entries[0];
596
+ if (rec && typeof rec.version === "string") process.stdout.write(rec.version);
597
+ } catch { /* unknown */ }
598
+ NODE
599
+ }
600
+
601
+ # Fills PLUGIN_SERVED_VERSION. Every failure path degrades with a loud
602
+ # warning and never aborts the install (I1) — an empty result makes
603
+ # record_plugin_version skip the version claim, so the next harness run
604
+ # retries instead of trusting a lie.
605
+ refresh_marketplace_cache() {
606
+ local runner=""
607
+ if command -v node &>/dev/null; then runner="node"
608
+ elif command -v bun &>/dev/null; then runner="bun"
609
+ else
610
+ echo " ⚠ node or bun required to verify the served plugin version — skipping cache refresh" >&2
611
+ return 0
612
+ fi
613
+
614
+ local served bundle
615
+ served="$(claude_served_plugin_version "$runner")"
616
+ bundle="$(installer_bundle_version "$SCRIPT_DIR/package.json")"
617
+ if [[ -z "$served" ]]; then
618
+ echo " ⚠ could not read the served plugin version from $PLUGIN_REGISTRY — not recording a version claim" >&2
619
+ return 0
620
+ fi
621
+
622
+ if [[ "$(installer_compare_versions "$runner" "$served" "$bundle")" == "-1" ]]; then
623
+ if installer_host_cli_supports claude plugin update; then
624
+ if claude plugin update "$PLUGIN_ID" </dev/null >/dev/null 2>&1; then
625
+ vecho " + refreshed marketplace cache: ${served} → ${bundle}"
626
+ else
627
+ echo " ⚠ 'claude plugin update ${PLUGIN_ID}' failed — Claude keeps serving ${served}; re-run the installer or run the update manually" >&2
628
+ fi
629
+ else
630
+ echo " ⚠ this claude CLI has no 'plugin update' — Claude keeps serving ${served}; update the CLI or reinstall the plugin" >&2
631
+ fi
632
+ # Re-read: record what the CLI serves NOW, whether or not the update
633
+ # succeeded (CMR-02 truthful record; a stale record keeps the harness
634
+ # version gate re-triggering until an update lands — self-healing).
635
+ served="$(claude_served_plugin_version "$runner")"
636
+ fi
637
+
638
+ PLUGIN_SERVED_VERSION="$served"
639
+ }
640
+
549
641
  # Strip artifacts a previous file-route install left behind. Called on the
550
642
  # plugin route, where the bundle supplies all three itself. Without this an
551
643
  # upgrading user keeps their old loose commands and merged hooks *and* gains
@@ -615,6 +707,7 @@ vecho "Installing massa-ai Claude Code plugin to: $TARGET"
615
707
  PLUGIN_ROUTE=0
616
708
  if register_claude_plugin; then
617
709
  PLUGIN_ROUTE=1
710
+ refresh_marketplace_cache
618
711
  fi
619
712
 
620
713
  command_count=0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massa-ai/claude-plugin",
3
- "version": "1.45.0",
3
+ "version": "1.46.0",
4
4
  "description": "massa-ai plugin for Claude Code — semantic code search, durable memory, symbol graph, and context compression",
5
5
  "files": [
6
6
  "agents",
@@ -59,7 +59,7 @@ npx @massa-ai/mcp-client --config-show
59
59
  npx @massa-ai/mcp-client --config-path
60
60
  npx @massa-ai/mcp-client --config-dir
61
61
  npx @massa-ai/mcp-client --config-init
62
- npx @massa-ai/mcp-client --config-set embedding.dimensions 4096
62
+ npx @massa-ai/mcp-client --config-set embedding.dimensions 2560
63
63
  ```
64
64
 
65
65
  Provider initialization supports Ollama plus `--mistral` and `--openai`