diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 31adc6c..4c93cf1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -99,6 +99,7 @@ jobs: path: | dist package.json + src/adapters/claude/plugin/.claude-plugin/plugin.json if-no-files-found: error retention-days: 1 @@ -133,7 +134,7 @@ jobs: run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add package.json + git add package.json src/adapters/claude/plugin/.claude-plugin/plugin.json git commit -m "chore(release): $VERSION [skip ci]" git push origin HEAD:main diff --git a/.gitignore b/.gitignore index b947077..38e16cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules/ dist/ +src/mcp/identity.ts diff --git a/package.json b/package.json index 55c8329..42b1c9c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@logickoder/agent-bridge", - "version": "0.2.3", + "version": "0.2.4", "description": "Live messaging between agent CLI sessions (Claude Code, Antigravity, opencode). Each message wakes the receiving session in place.", "author": { "name": "Jeffery Orazulike", @@ -16,7 +16,9 @@ }, "packageManager": "pnpm@12.16.1", "scripts": { - "build": "rm -rf dist && tsc -p tsconfig.build.json && chmod +x dist/cli.js", + "sync-version": "node scripts/sync-version.mjs", + "prepare": "pnpm sync-version", + "build": "pnpm sync-version && rm -rf dist && tsc -p tsconfig.build.json && chmod +x dist/cli.js", "typecheck": "tsc --noEmit", "test": "vitest run --dir src", "test:e2e": "pnpm build && vitest run --dir test", diff --git a/scripts/sync-version.mjs b/scripts/sync-version.mjs new file mode 100644 index 0000000..21d8fe8 --- /dev/null +++ b/scripts/sync-version.mjs @@ -0,0 +1,25 @@ +import fs from 'node:fs' + +const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')) +const name = pkg.name.replace(/^@[^/]+\//, '') +const version = pkg.version + +const pluginPath = 'src/adapters/claude/plugin/.claude-plugin/plugin.json' +const plugin = JSON.parse(fs.readFileSync(pluginPath, 'utf8')) +if (plugin.version !== version) { + plugin.version = version + fs.writeFileSync(pluginPath, `${JSON.stringify(plugin, null, 2)}\n`) +} + +const identityPath = 'src/mcp/identity.ts' +const nextIdentity = [ + '// Generated from package.json by scripts/sync-version.mjs. Do not edit by hand.', + '/** Name every client sees for this server. Also the key in client configs. */', + `export const SERVER_NAME = ${JSON.stringify(name)}`, + `export const VERSION = ${JSON.stringify(version)}`, + '', +].join('\n') +const prevIdentity = fs.existsSync(identityPath) ? fs.readFileSync(identityPath, 'utf8') : '' +if (nextIdentity !== prevIdentity) { + fs.writeFileSync(identityPath, nextIdentity) +} diff --git a/src/adapters/claude/plugin/.claude-plugin/plugin.json b/src/adapters/claude/plugin/.claude-plugin/plugin.json index 4b93b29..2a46276 100644 --- a/src/adapters/claude/plugin/.claude-plugin/plugin.json +++ b/src/adapters/claude/plugin/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "agent-bridge", - "version": "0.2.0", + "version": "0.2.4", "description": "Join agent-bridge from Claude Code with /bridge. A monitor delivers messages from peer agents (other Claude sessions, agy).", "author": { "name": "logickoder" } } diff --git a/src/mcp/identity.ts b/src/mcp/identity.ts deleted file mode 100644 index a80bd53..0000000 --- a/src/mcp/identity.ts +++ /dev/null @@ -1,3 +0,0 @@ -/** Name every client sees for this server. Also the key in client configs. */ -export const SERVER_NAME = 'agent-bridge' -export const VERSION = '0.1.0'