* fix(claude-code): fix plugin installation and release workflow - Fix plugin.json author field (string → object) to pass claude plugin validate - Add hindsight-integrations/.claude-plugin/marketplace.json so users can install via: claude plugin marketplace add vectorize-io/hindsight --sparse hindsight-integrations - Update README and install.sh with correct two-command install flow - Fix release-integration.yml: add explicit package.json check for typescript type and add plugin type for integrations with neither pyproject.toml nor package.json (prevents claude-code from incorrectly falling into the typescript build path) - Add CHANGELOG.md for the claude-code integration * remove install.sh — users install via claude plugin commands directly * test(claude-code): add 116 unit tests for plugin hooks and lib modules * feat(claude-code): user settings.json at CLAUDE_PLUGIN_DATA for stable config Plugin now checks CLAUDE_PLUGIN_DATA/settings.json after the versioned plugin default, giving users a path that persists across updates: ~/.claude/plugins/data/hindsight-memory-hindsight/settings.json Loading order: defaults → plugin settings.json → user settings.json → env vars * fix(claude-code): use ~/.hindsight/claude-code.json for user config Matches the ~/.openclaw/openclaw.json convention. Removes the confusing CLAUDE_PLUGIN_DATA path whose name depends on marketplace+plugin identifiers. * docs(claude-code): add ToS hint for claude-code LLM provider option * fix(claude-code): set author to Hindsight Team in plugin.json * ci: add test-claude-code-integration job to run plugin unit tests
111 lines
3.9 KiB
YAML
111 lines
3.9 KiB
YAML
name: Release Integration
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'integrations/**'
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
id-token: write # for PyPI trusted publishing
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Extract integration info
|
|
id: info
|
|
run: |
|
|
# refs/tags/integrations/litellm/v0.1.0 → integration=litellm, version=0.1.0
|
|
TAG="${GITHUB_REF#refs/tags/}"
|
|
INTEGRATION=$(echo "$TAG" | cut -d'/' -f2)
|
|
VERSION=$(echo "$TAG" | cut -d'/' -f3 | sed 's/^v//')
|
|
echo "integration=$INTEGRATION" >> $GITHUB_OUTPUT
|
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
|
echo "Integration: $INTEGRATION, Version: $VERSION"
|
|
|
|
- name: Detect integration type
|
|
id: type
|
|
run: |
|
|
if [ -f "hindsight-integrations/${{ steps.info.outputs.integration }}/pyproject.toml" ]; then
|
|
echo "type=python" >> $GITHUB_OUTPUT
|
|
elif [ -f "hindsight-integrations/${{ steps.info.outputs.integration }}/package.json" ]; then
|
|
echo "type=typescript" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "type=plugin" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
# ── Python integrations (litellm, pydantic-ai, crewai) ──────────────────
|
|
|
|
- name: Install uv
|
|
if: steps.type.outputs.type == 'python'
|
|
uses: astral-sh/setup-uv@v7
|
|
with:
|
|
enable-cache: true
|
|
|
|
- name: Set up Python
|
|
if: steps.type.outputs.type == 'python'
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version-file: ".python-version"
|
|
|
|
- name: Build Python package
|
|
if: steps.type.outputs.type == 'python'
|
|
working-directory: ./hindsight-integrations/${{ steps.info.outputs.integration }}
|
|
run: uv build --out-dir dist
|
|
|
|
- name: Publish Python package to PyPI
|
|
if: steps.type.outputs.type == 'python'
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
with:
|
|
packages-dir: ./hindsight-integrations/${{ steps.info.outputs.integration }}/dist
|
|
skip-existing: true
|
|
|
|
# ── TypeScript integrations (ai-sdk, chat, openclaw) ────────────────────
|
|
|
|
# ── Plugin integrations (claude-code) — no package to publish ───────────
|
|
|
|
- name: Plugin release
|
|
if: steps.type.outputs.type == 'plugin'
|
|
run: |
|
|
echo "Plugin integration ${{ steps.info.outputs.integration }} v${{ steps.info.outputs.version }} — no package to publish."
|
|
echo "Users install via: claude plugin marketplace add vectorize-io/hindsight --sparse hindsight-integrations"
|
|
|
|
# ── TypeScript integrations (ai-sdk, chat, openclaw) ────────────────────
|
|
|
|
- name: Set up Node.js
|
|
if: steps.type.outputs.type == 'typescript'
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '22'
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
- name: Install dependencies
|
|
if: steps.type.outputs.type == 'typescript'
|
|
working-directory: ./hindsight-integrations/${{ steps.info.outputs.integration }}
|
|
run: npm ci
|
|
|
|
- name: Build TypeScript package
|
|
if: steps.type.outputs.type == 'typescript'
|
|
working-directory: ./hindsight-integrations/${{ steps.info.outputs.integration }}
|
|
run: npm run build
|
|
|
|
- name: Publish TypeScript package to npm
|
|
if: steps.type.outputs.type == 'typescript'
|
|
working-directory: ./hindsight-integrations/${{ steps.info.outputs.integration }}
|
|
run: |
|
|
set +e
|
|
OUTPUT=$(npm publish --access public 2>&1)
|
|
EXIT_CODE=$?
|
|
echo "$OUTPUT"
|
|
if [ $EXIT_CODE -ne 0 ]; then
|
|
if echo "$OUTPUT" | grep -q "cannot publish over"; then
|
|
echo "Package version already published, skipping..."
|
|
exit 0
|
|
fi
|
|
exit $EXIT_CODE
|
|
fi
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|