diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json index d7bff5f..8c88745 100644 --- a/.agents/plugins/marketplace.json +++ b/.agents/plugins/marketplace.json @@ -6,7 +6,7 @@ "plugins": [ { "name": "simulator", - "version": "2.4.0", + "version": "2.4.1", "source": { "source": "local", "path": "./plugins/simulator" diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 4179577..16ef33a 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -9,7 +9,7 @@ "name": "simulator", "source": "./plugins/simulator", "description": "Simulator.Company platform assistant. Exposes the Simulator REST API as an MCP server and provides skills for managing actors, forms, graph structures, and financial accounts.", - "version": "2.4.0", + "version": "2.4.1", "author": { "name": "Simulator.Company", "url": "https://simulator.company" diff --git a/.gitignore b/.gitignore index 00e45be..d49606c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,7 @@ dump.rdb # Runtime overlays under .kiro/ are generated from the canonical skills tree — # committing them would only invite drift. /dist/ + +# Kiro +.env +.kiro diff --git a/CHANGELOG.md b/CHANGELOG.md index e1ef795..2b446fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [2.4.1] + +### Fixed +- **Kiro MCP server path resolution in a dev checkout.** `.mcp.kiro.json`'s `${KIRO_PLUGIN_ROOT:-$PWD/.kiro/..}` fallback resolved to the repo root (not `plugins/simulator/`) when a developer opened the repo directly in Kiro without running `install-kiro.sh`, so the server tried (and failed) to run `/mcp-server/run.sh`. It now probes for `mcp-server/run.sh` at that path and falls back to `plugins/simulator/` when missing. `install-kiro.sh` also now `sed`-resolves the same fallback to the absolute plugin path when generating a workspace's `mcp.json`, instead of a plain copy, so an external workspace's config no longer depends on `KIRO_PLUGIN_ROOT` at all. README's Kiro install instructions updated to match. + ## [2.4.0] ### Added diff --git a/README.md b/README.md index 529c0c1..2b266d9 100644 --- a/README.md +++ b/README.md @@ -90,10 +90,10 @@ Kiro has no marketplace command and does not resolve the `$CLAUDE_PLUGIN_ROOT` t ```bash git clone https://github.com/corezoid/simulator-ai-plugin cd simulator-ai-plugin -plugins/simulator/scripts/install-kiro.sh [workspace-dir] # defaults to $KIRO_WORKSPACE_DIR or the current dir +sh plugins/simulator/scripts/install-kiro.sh . # installs into the current dir; pass another workspace-dir instead of `.` to target elsewhere ``` -This writes the MCP entry to `/.kiro/settings/mcp.json`, symlinks the steering file into `.kiro/steering/`, and hard-copies each skill into `.kiro/skills//` with `$CLAUDE_PLUGIN_ROOT` replaced by the absolute plugin path. Open the workspace in Kiro and the MCP server, skills, and steering are picked up automatically. The plugin is also published to [kiro.dev/powers](https://kiro.dev/powers) — see [`POWER.md`](POWER.md). +This writes the MCP entry to `/.kiro/settings/mcp.json` with the plugin path resolved to an absolute path (no reliance on `KIRO_PLUGIN_ROOT` or workspace layout), symlinks the steering file into `.kiro/steering/`, and hard-copies each skill into `.kiro/skills//` with `$CLAUDE_PLUGIN_ROOT` replaced the same way. Open the workspace in Kiro and the MCP server, skills, and steering are picked up automatically. `.mcp.kiro.json` also self-heals if Kiro loads it directly without the script ever having run — it probes for `mcp-server/run.sh` next to its workspace-root guess and falls back to `plugins/simulator/` when that guess misses. The plugin is also published to [kiro.dev/powers](https://kiro.dev/powers) — see [`POWER.md`](POWER.md). ### Updating diff --git a/plugins/simulator/.claude-plugin/plugin.json b/plugins/simulator/.claude-plugin/plugin.json index fc8c0bb..84a14ab 100644 --- a/plugins/simulator/.claude-plugin/plugin.json +++ b/plugins/simulator/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "simulator", - "version": "2.4.0", + "version": "2.4.1", "description": "Simulator.Company platform assistant. Exposes the Simulator REST API as an MCP server and provides skills for managing actors, forms, graph structures, and financial accounts.", "author": { "name": "Simulator.Company", diff --git a/plugins/simulator/.codex-plugin/plugin.json b/plugins/simulator/.codex-plugin/plugin.json index fc8c0bb..84a14ab 100644 --- a/plugins/simulator/.codex-plugin/plugin.json +++ b/plugins/simulator/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "simulator", - "version": "2.4.0", + "version": "2.4.1", "description": "Simulator.Company platform assistant. Exposes the Simulator REST API as an MCP server and provides skills for managing actors, forms, graph structures, and financial accounts.", "author": { "name": "Simulator.Company", diff --git a/plugins/simulator/.kiro-plugin/plugin.json b/plugins/simulator/.kiro-plugin/plugin.json index 246e9ac..4d8b26a 100644 --- a/plugins/simulator/.kiro-plugin/plugin.json +++ b/plugins/simulator/.kiro-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "simulator", - "version": "2.4.0", + "version": "2.4.1", "description": "Simulator.Company platform assistant. Exposes the Simulator REST API as an MCP server and provides skills for managing actors, forms, graph structures, and financial accounts.", "author": { "name": "Simulator.Company", diff --git a/plugins/simulator/.mcp.kiro.json b/plugins/simulator/.mcp.kiro.json index 28b18a8..9e42a69 100644 --- a/plugins/simulator/.mcp.kiro.json +++ b/plugins/simulator/.mcp.kiro.json @@ -2,7 +2,7 @@ "mcpServers": { "simulator": { "command": "sh", - "args": ["-c", "export PLUGIN_ROOT=\"${KIRO_PLUGIN_ROOT:-$PWD/.kiro/..}\"; export SIMULATOR_WORK_DIR=\"$PWD\"; exec sh \"$PLUGIN_ROOT/mcp-server/run.sh\""] + "args": ["-c", "PLUGIN_ROOT=\"${KIRO_PLUGIN_ROOT:-$PWD/.kiro/..}\"; [ -f \"$PLUGIN_ROOT/mcp-server/run.sh\" ] || PLUGIN_ROOT=\"$PLUGIN_ROOT/plugins/simulator\"; [ -f \"$PLUGIN_ROOT/mcp-server/run.sh\" ] || { echo \"ERROR: cannot locate mcp-server/run.sh (checked KIRO_PLUGIN_ROOT and the plugins/simulator fallback under $PLUGIN_ROOT)\" >&2; exit 1; }; export PLUGIN_ROOT SIMULATOR_WORK_DIR=\"$PWD\"; exec sh \"$PLUGIN_ROOT/mcp-server/run.sh\""] } } } diff --git a/plugins/simulator/scripts/install-kiro.sh b/plugins/simulator/scripts/install-kiro.sh index 5bc845a..725ae3f 100755 --- a/plugins/simulator/scripts/install-kiro.sh +++ b/plugins/simulator/scripts/install-kiro.sh @@ -37,8 +37,13 @@ fi mkdir -p "$KIRO_DIR/settings" "$KIRO_DIR/steering" "$KIRO_DIR/skills" -# 1) MCP entry — always plain copy (workspace-local edits must not leak back). -cp "$PLUGIN_ROOT/.mcp.kiro.json" "$KIRO_DIR/settings/mcp.json" +# 1) MCP entry — resolve the KIRO_PLUGIN_ROOT fallback to the known absolute +# plugin path so the generated mcp.json works without the env var being set. +# Escape \, & and our # delimiter so a stray one of those in PLUGIN_ROOT +# (e.g. a `#` in the clone path) can't corrupt the sed replacement. +PLUGIN_ROOT_ESCAPED="$(printf '%s\n' "$PLUGIN_ROOT" | sed 's/[\&#]/\\&/g')" +sed 's#\${KIRO_PLUGIN_ROOT:-\$PWD/.kiro/..}#'"$PLUGIN_ROOT_ESCAPED"'#g' \ + "$PLUGIN_ROOT/.mcp.kiro.json" > "$KIRO_DIR/settings/mcp.json" # 2) Steering — small, stable, no token substitution needed. Symlink on POSIX, # hard-copy on Windows shells.