fix(installer): opencode .jsonc + AGENTS.md (0.7.8) (#163)
* release: 0.7.7 (multi-agent installer — Cursor, Codex, opencode) * fix(installer): opencode .jsonc + AGENTS.md (0.7.8) v0.7.7 wrote ~/.config/opencode/opencode.json, but opencode reads opencode.jsonc by default — so the codegraph MCP entry never appeared in any opencode session. Also installs AGENTS.md so opencode's model reaches for codegraph_* tools instead of native Grep. - Prefer existing .jsonc, fall back to .json, default new installs to .jsonc. - Surgical edits via jsonc-parser preserve user comments and formatting across install / re-install / uninstall round-trips. - Install AGENTS.md (global ~/.config/opencode/AGENTS.md, local ./AGENTS.md) with the shared INSTRUCTIONS_TEMPLATE — same marker-delimited approach Codex uses. - +9 opencode-specific tests covering filename precedence, comment preservation, AGENTS.md install + sibling-content preservation, uninstall reverses both files. 575/575 tests pass. Hand-verified end-to-end: opencode session calls codegraph_node + codegraph_callers for a structural query, zero Grep calls. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs: overhaul CLAUDE.md and add scripts/release.sh + Cursor rules file Replaces the old Claude-only CLAUDE.md with a comprehensive guide covering the full project architecture, multi-agent installer, test conventions, NodeKind/EdgeKind reference, and release workflow. Key additions: - Documents the layered pipeline, all module paths, and the multi-target installer (targets/, registry.ts, AgentTarget interface). - Adds the Cursor `--path` quirk and the "update all three surfaces" rule when changing MCP tool guidance. - Documents `npm run eval`, `test:eval`, and the full set of build/test commands including single-file patterns. - `scripts/release.sh` — idempotent bash script that tags the current commit, pushes the tag, and creates a GitHub Release whose notes are extracted from the matching `## [X.Y.Z]` block in CHANGELOG.md. Safe to re-run after partial failure. - `.cursor/rules/codegraph.mdc` — Cursor-specific agent instructions (tool decision table, rules of thumb, index-lag warning) written by the installer and kept in sync with server-instructions.ts and instructions-template.ts. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
7d87126ee8
commit
58c1414ce5
Executable
+70
@@ -0,0 +1,70 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tag the current commit with the version in package.json and publish a
|
||||
# matching GitHub Release whose body is the corresponding CHANGELOG.md entry.
|
||||
#
|
||||
# Run AFTER you have:
|
||||
# - bumped package.json
|
||||
# - added a `## [X.Y.Z] - YYYY-MM-DD` block at the top of CHANGELOG.md
|
||||
# - committed, pushed to origin, and run `npm publish`
|
||||
#
|
||||
# Idempotent: safe to re-run after a partial failure. Skips steps that are
|
||||
# already done (tag created, tag pushed, release published).
|
||||
#
|
||||
# Usage: ./scripts/release.sh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
VERSION=$(node -p "require('./package.json').version")
|
||||
TAG="v${VERSION}"
|
||||
|
||||
REPO=$(git remote get-url origin | sed -E 's|.*github\.com[:/]||; s|\.git$||')
|
||||
if [ -z "${REPO}" ]; then
|
||||
echo "error: could not derive owner/repo from origin remote URL" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep -q "^## \[${VERSION}\]" CHANGELOG.md; then
|
||||
echo "error: no '## [${VERSION}]' entry found in CHANGELOG.md" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
NOTES=$(awk -v v="${VERSION}" '
|
||||
/^## \[/ {
|
||||
if (p) exit
|
||||
if ($0 ~ "^## \\[" v "\\]") p = 1
|
||||
}
|
||||
p
|
||||
' CHANGELOG.md)
|
||||
|
||||
if [ -z "${NOTES}" ]; then
|
||||
echo "error: failed to extract changelog notes for ${VERSION}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if git rev-parse "${TAG}" >/dev/null 2>&1; then
|
||||
echo "✓ tag ${TAG} already exists locally"
|
||||
else
|
||||
echo "→ tagging ${TAG}"
|
||||
git tag "${TAG}"
|
||||
fi
|
||||
|
||||
if git ls-remote --exit-code --tags origin "${TAG}" >/dev/null 2>&1; then
|
||||
echo "✓ tag ${TAG} already on origin"
|
||||
else
|
||||
echo "→ pushing ${TAG} to origin"
|
||||
git push origin "${TAG}"
|
||||
fi
|
||||
|
||||
if gh release view "${TAG}" --repo "${REPO}" >/dev/null 2>&1; then
|
||||
echo "✓ release ${TAG} already published"
|
||||
else
|
||||
echo "→ creating GitHub Release ${TAG} on ${REPO}"
|
||||
gh release create "${TAG}" \
|
||||
--repo "${REPO}" \
|
||||
--title "${TAG}" \
|
||||
--notes "${NOTES}"
|
||||
fi
|
||||
|
||||
echo "done: https://github.com/${REPO}/releases/tag/${TAG}"
|
||||
Reference in New Issue
Block a user