@rkarim08/sia 1.0.1 → 1.0.2

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/.mcp.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "mcpServers": {
3
3
  "sia": {
4
- "command": "bun",
5
- "args": ["run", "${CLAUDE_PLUGIN_ROOT}/scripts/start-mcp.ts"],
4
+ "command": "bash",
5
+ "args": ["${CLAUDE_PLUGIN_ROOT}/scripts/start-mcp.sh"],
6
6
  "env": {
7
7
  "SIA_HOME": "${CLAUDE_PLUGIN_DATA}",
8
8
  "CLAUDE_PLUGIN_DATA": "${CLAUDE_PLUGIN_DATA}",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rkarim08/sia",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Persistent graph memory for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -7,6 +7,8 @@ set -euo pipefail
7
7
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
8
8
  PLUGIN_ROOT="$(dirname "$SCRIPT_DIR")"
9
9
 
10
+ source "$PLUGIN_ROOT/scripts/ensure-runtime.sh" "$PLUGIN_ROOT"
11
+
10
12
  SIA_LOG_DIR="${CLAUDE_PLUGIN_DATA:-${HOME}/.sia}/logs"
11
13
  mkdir -p "$SIA_LOG_DIR"
12
14
 
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env bash
2
+ # Ensures bun is installed and plugin dependencies are present.
3
+ # Called by .mcp.json and all hook scripts before running TypeScript.
4
+ # Exits silently on success; prints to stderr on failure.
5
+ set -euo pipefail
6
+
7
+ PLUGIN_ROOT="${1:-.}"
8
+
9
+ # 1. Check for bun
10
+ if ! command -v bun &>/dev/null; then
11
+ # Try common install locations
12
+ if [ -f "$HOME/.bun/bin/bun" ]; then
13
+ export PATH="$HOME/.bun/bin:$PATH"
14
+ else
15
+ # Auto-install bun
16
+ echo "[sia] bun not found — installing..." >&2
17
+ curl -fsSL https://bun.sh/install | bash >/dev/null 2>&1
18
+ export PATH="$HOME/.bun/bin:$PATH"
19
+ if ! command -v bun &>/dev/null; then
20
+ echo "[sia] ERROR: failed to install bun. Install manually: https://bun.sh" >&2
21
+ exit 1
22
+ fi
23
+ echo "[sia] bun installed successfully" >&2
24
+ fi
25
+ fi
26
+
27
+ # 2. Check for node_modules
28
+ if [ ! -d "$PLUGIN_ROOT/node_modules" ]; then
29
+ echo "[sia] installing dependencies..." >&2
30
+ (cd "$PLUGIN_ROOT" && bun install --production 2>/dev/null)
31
+ echo "[sia] dependencies installed" >&2
32
+ fi
@@ -5,4 +5,6 @@ set -euo pipefail
5
5
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
6
6
  PLUGIN_ROOT="$(dirname "$SCRIPT_DIR")"
7
7
 
8
+ source "$PLUGIN_ROOT/scripts/ensure-runtime.sh" "$PLUGIN_ROOT"
9
+
8
10
  exec bun run "$PLUGIN_ROOT/src/hooks/plugin-post-compact.ts" 2>/dev/null
@@ -6,5 +6,6 @@ set -euo pipefail
6
6
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
7
7
  PLUGIN_ROOT="$(dirname "$SCRIPT_DIR")"
8
8
 
9
- # Pass stdin through to the handler
9
+ source "$PLUGIN_ROOT/scripts/ensure-runtime.sh" "$PLUGIN_ROOT"
10
+
10
11
  exec bun run "$PLUGIN_ROOT/src/hooks/plugin-post-tool-use.ts" 2>/dev/null
@@ -5,4 +5,6 @@ set -euo pipefail
5
5
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
6
6
  PLUGIN_ROOT="$(dirname "$SCRIPT_DIR")"
7
7
 
8
+ source "$PLUGIN_ROOT/scripts/ensure-runtime.sh" "$PLUGIN_ROOT"
9
+
8
10
  exec bun run "$PLUGIN_ROOT/src/hooks/plugin-pre-compact.ts" 2>/dev/null
@@ -5,4 +5,6 @@ set -euo pipefail
5
5
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
6
6
  PLUGIN_ROOT="$(dirname "$SCRIPT_DIR")"
7
7
 
8
+ source "$PLUGIN_ROOT/scripts/ensure-runtime.sh" "$PLUGIN_ROOT"
9
+
8
10
  exec bun run "$PLUGIN_ROOT/src/hooks/plugin-session-end.ts" 2>/dev/null
@@ -5,4 +5,6 @@ set -euo pipefail
5
5
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
6
6
  PLUGIN_ROOT="$(dirname "$SCRIPT_DIR")"
7
7
 
8
+ source "$PLUGIN_ROOT/scripts/ensure-runtime.sh" "$PLUGIN_ROOT"
9
+
8
10
  exec bun run "$PLUGIN_ROOT/src/hooks/plugin-session-start.ts" 2>/dev/null
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env bash
2
+ # MCP server entry point — ensures runtime + deps, then starts the server.
3
+ set -euo pipefail
4
+
5
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
6
+ PLUGIN_ROOT="$(dirname "$SCRIPT_DIR")"
7
+
8
+ source "$PLUGIN_ROOT/scripts/ensure-runtime.sh" "$PLUGIN_ROOT"
9
+
10
+ exec bun run "$PLUGIN_ROOT/scripts/start-mcp.ts"
@@ -5,4 +5,6 @@ set -euo pipefail
5
5
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
6
6
  PLUGIN_ROOT="$(dirname "$SCRIPT_DIR")"
7
7
 
8
+ source "$PLUGIN_ROOT/scripts/ensure-runtime.sh" "$PLUGIN_ROOT"
9
+
8
10
  exec bun run "$PLUGIN_ROOT/src/hooks/plugin-stop.ts" 2>/dev/null
@@ -5,4 +5,6 @@ set -euo pipefail
5
5
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
6
6
  PLUGIN_ROOT="$(dirname "$SCRIPT_DIR")"
7
7
 
8
+ source "$PLUGIN_ROOT/scripts/ensure-runtime.sh" "$PLUGIN_ROOT"
9
+
8
10
  exec bun run "$PLUGIN_ROOT/src/hooks/plugin-user-prompt-submit.ts" 2>/dev/null