mirror of
https://github.com/getsentry/sentry-for-ai.git
synced 2026-09-14 14:28:22 +08:00
4a889f0042
Task-shaped skills will draw their reference material (per-platform SDK guides, per-signal concepts) from a single maintained library rather than duplicating it. Each shipped skill must still be self-contained, so the build copies a skill's declared references into it. Add a CONTENT_ROOT env var (default: repo root) so the same build steps can assemble an alternate skill tree, e.g. CONTENT_ROOT=skills-next. hydrate-references.py walks a skills directory: for every skill with a references.yml it brace-expands and globs the `needs:` patterns against the library, copies the matches into the skill's references/ preserving subpaths, and strips the manifest so it never ships. It runs via `uv run --script` with inline PyYAML and braceexpand dependencies. build-common.sh invokes it once per build, and only when some skill declares references, so existing skills are unaffected and the common case spawns no interpreter. Factor the steps shared across all four agent builders into build-common.sh (content-root resolution, skill copy+hydrate, commands, SKILL_TREE), sourced by each plugin-src/<agent>/build.sh.
44 lines
1.9 KiB
Bash
Executable File
44 lines
1.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# build.sh — Build the Cursor distribution of the Sentry plugin.
|
|
#
|
|
# Like Claude, Cursor consumes the plugin at the dist branch ROOT
|
|
# (`.cursor-plugin/marketplace.json` uses `source: "./"`). Cursor expects the MCP
|
|
# config as `mcp.json` (no leading dot), which is the repo's source-of-truth name,
|
|
# so it copies straight through. Claude and Codex emit the dotted `.mcp.json` from
|
|
# the same source. No skill mutation: copies the manifest (from alongside this
|
|
# script) plus the shared content from the repo root.
|
|
#
|
|
# Note: Cursor documents honoring `disable-model-invocation`, but a known Cursor
|
|
# bug currently hides plugin-delivered skills entirely. We ship the field
|
|
# as-authored; that is a Cursor-side issue, not a packaging one.
|
|
#
|
|
# Skill content (skills/, commands/, references/, SKILL_TREE.md) is read from
|
|
# CONTENT_ROOT, defaulting to the repo root. Point it at an alternate tree (e.g.
|
|
# CONTENT_ROOT=skills-next) to build a different skill set with the same steps.
|
|
#
|
|
# Usage: build.sh <TARGET_DIR> (TARGET_DIR assumed empty)
|
|
|
|
set -euo pipefail
|
|
|
|
TARGET_DIR="${1:?usage: build.sh <TARGET_DIR>}"
|
|
SRC_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
REPO_ROOT="$(cd "$SRC_DIR/../.." && pwd)"
|
|
cd "$REPO_ROOT"
|
|
source "$REPO_ROOT/scripts/build-common.sh"
|
|
resolve_content_root "$REPO_ROOT"
|
|
|
|
mkdir -p "$TARGET_DIR/.cursor-plugin"
|
|
|
|
cp "$SRC_DIR/plugin.json" "$TARGET_DIR/.cursor-plugin/plugin.json"
|
|
cp "$SRC_DIR/marketplace.json" "$TARGET_DIR/.cursor-plugin/marketplace.json"
|
|
copy_skills "$CONTENT_ROOT" "$TARGET_DIR/skills"
|
|
copy_commands "$CONTENT_ROOT" "$TARGET_DIR/commands"
|
|
copy_skill_tree "$CONTENT_ROOT" "$TARGET_DIR/SKILL_TREE.md"
|
|
rsync -a assets/ "$TARGET_DIR/assets/"
|
|
cp mcp.json "$TARGET_DIR/mcp.json"
|
|
cp "$SRC_DIR/README.md" "$TARGET_DIR/README.md"
|
|
cp LICENSE "$TARGET_DIR/LICENSE"
|
|
|
|
echo "Built Cursor dist into $TARGET_DIR (root plugin, content from $CONTENT_ROOT)."
|