@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 +2 -2
- package/package.json +1 -1
- package/scripts/branch-switch.sh +2 -0
- package/scripts/ensure-runtime.sh +32 -0
- package/scripts/post-compact.sh +2 -0
- package/scripts/post-tool-use.sh +2 -1
- package/scripts/pre-compact.sh +2 -0
- package/scripts/session-end.sh +2 -0
- package/scripts/session-start.sh +2 -0
- package/scripts/start-mcp.sh +10 -0
- package/scripts/stop-hook.sh +2 -0
- package/scripts/user-prompt-submit.sh +2 -0
package/.mcp.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"mcpServers": {
|
|
3
3
|
"sia": {
|
|
4
|
-
"command": "
|
|
5
|
-
"args": ["
|
|
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
package/scripts/branch-switch.sh
CHANGED
|
@@ -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
|
package/scripts/post-compact.sh
CHANGED
package/scripts/post-tool-use.sh
CHANGED
|
@@ -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
|
-
|
|
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
|
package/scripts/pre-compact.sh
CHANGED
package/scripts/session-end.sh
CHANGED
package/scripts/session-start.sh
CHANGED
|
@@ -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"
|
package/scripts/stop-hook.sh
CHANGED