From 062b85674e3c5a0004d69ede2010db852cb0f8d1 Mon Sep 17 00:00:00 2001 From: vreshch Date: Sat, 20 Jun 2026 21:16:17 +0200 Subject: [PATCH 1/2] chore: publish setup - depend on @agentage/memory-core@^0.0.1, drop private, add publish workflow --- .github/workflows/publish.yml | 79 +++++++++++++++++++++++++++++++++++ package-lock.json | 47 +++++++++++---------- package.json | 6 ++- 3 files changed, 108 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..d614d53 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,79 @@ +name: Publish Package + +# Publishes @agentage/mcp-memory to npm. Manual (workflow_dispatch) or on a release +# commit to master; never on an ordinary push. Requires an NPM_TOKEN repo secret. +# (No --provenance: it 404s a first-ever publish; add it back once the package exists.) + +on: + push: + branches: [master] + paths: + - 'package.json' + workflow_dispatch: + +permissions: + contents: write + +env: + NODE_VERSION: '22' + +jobs: + release-gate: + name: Release gate + runs-on: ubuntu-latest + outputs: + is-release: ${{ steps.check.outputs.is-release }} + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 5 + - id: check + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "is-release=true" >> "$GITHUB_OUTPUT"; exit 0 + fi + MSG=$(git log -1 --pretty=%s) + if echo "$MSG" | grep -qE "(^Release v|^chore: prepare release|^chore\(release\))"; then + echo "is-release=true" >> "$GITHUB_OUTPUT" + else + echo "is-release=false" >> "$GITHUB_OUTPUT" + echo "Not a release commit - skipping publish." + fi + + publish: + name: Publish to npm + needs: [release-gate] + if: needs.release-gate.outputs.is-release == 'true' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + registry-url: 'https://registry.npmjs.org' + - run: npm ci + - name: Skip if version already on npm + id: ver + run: | + name=$(node -p "require('./package.json').name") + version=$(node -p "require('./package.json').version") + if npm view "${name}@${version}" version >/dev/null 2>&1; then + echo "publish=false" >> "$GITHUB_OUTPUT" + echo "${name}@${version} already published." + else + echo "publish=true" >> "$GITHUB_OUTPUT" + fi + echo "tag=v${version}" >> "$GITHUB_OUTPUT" + - if: steps.ver.outputs.publish == 'true' + run: npm run verify + - if: steps.ver.outputs.publish == 'true' + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm publish --access public + - if: steps.ver.outputs.publish == 'true' + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag -a "${{ steps.ver.outputs.tag }}" -m "Release ${{ steps.ver.outputs.tag }}" + git push origin "${{ steps.ver.outputs.tag }}" diff --git a/package-lock.json b/package-lock.json index 37b141a..2460cbc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,10 +9,13 @@ "version": "0.0.1", "license": "UNLICENSED", "dependencies": { - "@agentage/memory-core": "file:../memory-core", + "@agentage/memory-core": "^0.0.1", "@modelcontextprotocol/sdk": "^1.29.0", "zod": "^4.4.3" }, + "bin": { + "agentage-mcp-memory": "dist/bin/mcp-memory.js" + }, "devDependencies": { "@types/node": "^22.10.0", "@typescript-eslint/eslint-plugin": "^8.18.0", @@ -30,35 +33,20 @@ "npm": ">=10.0.0" } }, - "../memory-core": { - "name": "@agentage/memory-core", + "node_modules/@agentage/memory-core": { "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@agentage/memory-core/-/memory-core-0.0.1.tgz", + "integrity": "sha512-2siRlh4sscOYmCLlEgug/NypyClAXBhz+vR2MhP5CVN96vxFqgiedcYDYcioZ+WONH8WQ6p2yP2IBCMUbhxlJw==", "license": "UNLICENSED", "dependencies": { "yaml": "^2.7.0", "zod": "^4.4.3" }, - "devDependencies": { - "@types/node": "^22.10.0", - "@typescript-eslint/eslint-plugin": "^8.18.0", - "@typescript-eslint/parser": "^8.18.0", - "@vitest/coverage-v8": "^2.1.8", - "eslint": "^9.17.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-prettier": "^5.2.1", - "prettier": "^3.4.2", - "typescript": "^5.7.2", - "vitest": "^2.1.8" - }, "engines": { "node": ">=22.0.0", "npm": ">=10.0.0" } }, - "node_modules/@agentage/memory-core": { - "resolved": "../memory-core", - "link": true - }, "node_modules/@ampproject/remapping": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", @@ -3495,9 +3483,9 @@ "license": "MIT" }, "node_modules/nanoid": { - "version": "3.3.13", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.13.tgz", - "integrity": "sha512-sPdqC6ByMVVGvF1ynvvMo0/o+oD1VX7DaHhijt1bFgjvBkHBib4t49GoNDhf2NDta4oeUNlaGbSt5K7qjZ955Q==", + "version": "3.3.14", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.14.tgz", + "integrity": "sha512-U9kYi5bpVMEI31yC8iw4bJJp0avcHXA0W8/wNfLfnvJYzihQo2ZRPYPvpAAd570HAcCBjCTN7vnr+v4StKl1IQ==", "dev": true, "funding": [ { @@ -4797,6 +4785,21 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "license": "ISC" }, + "node_modules/yaml": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", + "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index a576abb..5e52573 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,14 @@ "description": "The MCP server for agentage Memory: exposes @agentage/memory-core vaults as the frozen 6 memory__* tools over stdio. The open, cross-vendor counterpart to @modelcontextprotocol/server-memory.", "type": "module", "license": "UNLICENSED", - "private": true, "main": "dist/index.js", "types": "dist/index.d.ts", "exports": { ".": "./dist/index.js" }, + "publishConfig": { + "access": "public" + }, "bin": { "agentage-mcp-memory": "dist/bin/mcp-memory.js" }, @@ -35,7 +37,7 @@ "prepublishOnly": "npm run verify" }, "dependencies": { - "@agentage/memory-core": "file:../memory-core", + "@agentage/memory-core": "^0.0.1", "@modelcontextprotocol/sdk": "^1.29.0", "zod": "^4.4.3" }, From de4fceeb6899875d2c74a0d07660e153616f4956 Mon Sep 17 00:00:00 2001 From: vreshch Date: Sat, 20 Jun 2026 21:19:28 +0200 Subject: [PATCH 2/2] ci: enable npm provenance now that the package exists --- .github/workflows/publish.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d614d53..83f444f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,7 +2,7 @@ name: Publish Package # Publishes @agentage/mcp-memory to npm. Manual (workflow_dispatch) or on a release # commit to master; never on an ordinary push. Requires an NPM_TOKEN repo secret. -# (No --provenance: it 404s a first-ever publish; add it back once the package exists.) +# (The first publish was bootstrapped manually; --provenance is safe now the pkg exists.) on: push: @@ -13,6 +13,7 @@ on: permissions: contents: write + id-token: write env: NODE_VERSION: '22' @@ -70,7 +71,7 @@ jobs: - if: steps.ver.outputs.publish == 'true' env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm publish --access public + run: npm publish --access public --provenance - if: steps.ver.outputs.publish == 'true' run: | git config user.name "github-actions[bot]"