From 846718518dcf720ce8a884f195e82eb86f8a94b8 Mon Sep 17 00:00:00 2001 From: NagyVikt Date: Fri, 24 Apr 2026 04:04:24 +0200 Subject: [PATCH] release: publish heartbeat sessions for hook-less MCP clients (v0.5.0) Bundles two release-cycle changes for @imdeadpool/colony and the linked @colony/* workspace packages (0.2.0 -> 0.5.0): - Export main() from @colony/mcp-server so the CLI `mcp` command drives the stdio server directly. The previous side-effectful import was skipped by isMainEntry() and clients hit "connection closed: initialize response". - Write / refresh .omx/state/active-sessions/.json on connect and on every tool call, so codex and other non-hook MCP clients show up in hivemind without installing colony's lifecycle hooks. Identity derives from CODEX_SESSION_ID / CLAUDECODE_SESSION_ID / CLAUDE_SESSION_ID / COLONY_CLIENT_SESSION_ID, with an mcp- fallback. Existing hook-written previews are preserved. - Re-export upsertActiveSession / removeActiveSession from @colony/hooks so other runtimes can reuse the same writer. Co-Authored-By: Claude Opus 4.7 (1M context) --- .changeset/colony-package-namespace.md | 12 ----- .changeset/colony-session-cwd-binding.md | 7 --- .changeset/hivemind-mcp-tool.md | 5 -- .changeset/pheromone-trails.md | 7 --- .changeset/proposal-system.md | 8 --- .changeset/response-thresholds.md | 8 --- apps/cli/CHANGELOG.md | 26 +++++++++ apps/cli/package.json | 9 +++- apps/cli/src/commands/mcp.ts | 4 +- apps/mcp-server/CHANGELOG.md | 64 ++++++++++++++++++++++ apps/mcp-server/package.json | 3 +- apps/mcp-server/src/server.ts | 67 +++++++++++++++++++++++- apps/mcp-server/test/server.test.ts | 59 ++++++++++++++++++++- apps/worker/CHANGELOG.md | 26 +++++++++ apps/worker/package.json | 2 +- evals/CHANGELOG.md | 14 +++++ evals/package.json | 2 +- packages/compress/CHANGELOG.md | 13 +++++ packages/compress/package.json | 7 ++- packages/config/CHANGELOG.md | 13 +++++ packages/config/package.json | 6 ++- packages/core/CHANGELOG.md | 34 ++++++++++++ packages/core/package.json | 6 ++- packages/embedding/CHANGELOG.md | 20 +++++++ packages/embedding/package.json | 6 ++- packages/hooks/CHANGELOG.md | 43 +++++++++++++++ packages/hooks/package.json | 6 ++- packages/hooks/src/index.ts | 1 + packages/installers/CHANGELOG.md | 20 +++++++ packages/installers/package.json | 6 ++- packages/storage/CHANGELOG.md | 27 ++++++++++ packages/storage/package.json | 6 ++- pnpm-lock.yaml | 3 ++ 33 files changed, 470 insertions(+), 70 deletions(-) delete mode 100644 .changeset/colony-package-namespace.md delete mode 100644 .changeset/colony-session-cwd-binding.md delete mode 100644 .changeset/hivemind-mcp-tool.md delete mode 100644 .changeset/pheromone-trails.md delete mode 100644 .changeset/proposal-system.md delete mode 100644 .changeset/response-thresholds.md diff --git a/.changeset/colony-package-namespace.md b/.changeset/colony-package-namespace.md deleted file mode 100644 index ce42350..0000000 --- a/.changeset/colony-package-namespace.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -"@imdeadpool/colony": patch -"@colony/compress": patch -"@colony/config": patch -"@colony/core": patch -"@colony/embedding": patch -"@colony/hooks": patch -"@colony/installers": patch -"@colony/storage": patch ---- - -Rename the public CLI package and workspace package/import namespace from cavemem to Colony. The CLI binary is now `colony`, workspace imports use `@colony/*`, release scripts pack `colony`, and installed hook scripts call `colony`. diff --git a/.changeset/colony-session-cwd-binding.md b/.changeset/colony-session-cwd-binding.md deleted file mode 100644 index f826568..0000000 --- a/.changeset/colony-session-cwd-binding.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@colony/hooks": patch -"@colony/storage": patch -"@imdeadpool/colony": patch ---- - -Bind hook-created sessions back to their repository cwd so colony views can see live Codex/Claude work instead of orphan `cwd: null` sessions. diff --git a/.changeset/hivemind-mcp-tool.md b/.changeset/hivemind-mcp-tool.md deleted file mode 100644 index db86d31..0000000 --- a/.changeset/hivemind-mcp-tool.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@colony/mcp-server": minor ---- - -Add a compact `hivemind` MCP tool that maps active proxy-runtime agent sessions to their current tasks. diff --git a/.changeset/pheromone-trails.md b/.changeset/pheromone-trails.md deleted file mode 100644 index 9f70c2a..0000000 --- a/.changeset/pheromone-trails.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@colony/storage': minor -'@colony/core': minor -'@colony/hooks': minor ---- - -Add pheromone trails: ambient decaying activity signal per (task, file, session). `PostToolUse` deposits pheromone on every write-tool invocation; strength decays exponentially (10-minute half-life, cap 10.0). The new `UserPromptSubmit` preface warns when another session has a strong trail on a file the current session has also touched, complementing the existing claim-based preface with a graded intensity signal that doesn't fire for stale collisions. Schema bumped to version 4 — adds `pheromones` table with FK cascade on sessions and tasks. diff --git a/.changeset/proposal-system.md b/.changeset/proposal-system.md deleted file mode 100644 index eaf38dc..0000000 --- a/.changeset/proposal-system.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@colony/storage': minor -'@colony/core': minor -'@colony/hooks': minor -'@colony/mcp-server': minor ---- - -Add proposal system: pre-tasks that auto-promote via collective reinforcement. Agents call `task_propose` to surface a candidate improvement; other agents call `task_reinforce` (kind `explicit` or `rediscovered`), and PostToolUse adds weak `adjacent` reinforcement whenever an edit touches a file listed in a pending proposal's `touches_files`. Total decayed strength (1-hour half-life, weights 1.0 / 0.7 / 0.3 by kind) is recomputed on every read; when it crosses `PROMOTION_THRESHOLD` (2.5), the proposal is auto-promoted to a real `TaskThread` on a synthetic branch `{branch}/proposal-{id}`. The new `task_foraging_report` MCP tool lists pending (above the 0.3 noise floor) and promoted proposals; `SessionStart` surfaces the same report in-preface. Schema bumped 4 → 5: adds `proposals` and `proposal_reinforcements`. diff --git a/.changeset/response-thresholds.md b/.changeset/response-thresholds.md deleted file mode 100644 index 788d063..0000000 --- a/.changeset/response-thresholds.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@colony/storage': minor -'@colony/core': minor -'@colony/hooks': minor -'@colony/mcp-server': minor ---- - -Add response-threshold routing for broadcast (`to_agent: 'any'`) handoffs. Each agent identity (Claude, Codex, …) can register a capability profile (`ui_work`, `api_work`, `test_work`, `infra_work`, `doc_work`, each `0..1`) via the new `agent_upsert_profile` MCP tool; unknown agents default to `0.5` across all dimensions. When `TaskThread.handOff` runs with `to_agent: 'any'`, it snapshots a keyword-weighted ranking of every non-sender participant into `HandoffMetadata.suggested_candidates`. `SessionStart` preface surfaces the top match and the viewing agent's own score inline with each pending broadcast handoff, so receivers can see at a glance whether they are the best fit. New `agent_get_profile` MCP tool exposes read-only inspection. Schema bumped 5 → 6: adds `agent_profiles` table. diff --git a/apps/cli/CHANGELOG.md b/apps/cli/CHANGELOG.md index 0788dc5..a3a054d 100644 --- a/apps/cli/CHANGELOG.md +++ b/apps/cli/CHANGELOG.md @@ -1,5 +1,31 @@ # cavemem +## 0.5.0 + +### Minor Changes + +- Sync linked release with the 0.4.0 MCP heartbeat bump so `@imdeadpool/colony` + and the supporting `@colony/*` workspace packages publish together. + +## 0.3.0 + +### Patch Changes + +- eb4dad9: Rename the public CLI package and workspace package/import namespace from cavemem to Colony. The CLI binary is now `colony`, workspace imports use `@colony/*`, release scripts pack `colony`, and installed hook scripts call `colony`. +- f1d036a: Bind hook-created sessions back to their repository cwd so colony views can see live Codex/Claude work instead of orphan `cwd: null` sessions. +- Fix `colony mcp` never starting the stdio server. + + `apps/mcp-server/src/server.ts` gated `main()` behind an `isMainEntry()` check + so it only ran when executed directly. The CLI `mcp` command invoked it via + `await import('@colony/mcp-server')`, which triggered the guard (entry was + the CLI binary, not `server.js`) and skipped `main()` — the process exited + immediately after the dynamic import, causing IDE clients (Codex, Claude + Code) to fail the MCP handshake with "connection closed: initialize + response". + + `main` is now exported from the server module and invoked explicitly by the + CLI command. + ## 0.2.0 ### Minor Changes diff --git a/apps/cli/package.json b/apps/cli/package.json index c226910..470fc5d 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -1,6 +1,6 @@ { "name": "@imdeadpool/colony", - "version": "0.2.0", + "version": "0.5.0", "license": "MIT", "description": "Local-first memory and coordination for Claude Code, Gemini CLI, OpenCode, Codex, and Cursor.", "keywords": [ @@ -32,7 +32,12 @@ "colony": "./dist/index.js" }, "main": "./dist/index.js", - "files": ["dist", "hooks-scripts", "README.md", "LICENSE"], + "files": [ + "dist", + "hooks-scripts", + "README.md", + "LICENSE" + ], "scripts": { "build": "tsup", "dev": "tsup --watch --onSuccess \"node dist/index.js\"", diff --git a/apps/cli/src/commands/mcp.ts b/apps/cli/src/commands/mcp.ts index a4ccc18..19e4c88 100644 --- a/apps/cli/src/commands/mcp.ts +++ b/apps/cli/src/commands/mcp.ts @@ -5,7 +5,7 @@ export function registerMcpCommand(program: Command): void { .command('mcp') .description('Run the MCP stdio server (typically invoked by the IDE)') .action(async () => { - // Delegate: importing runs main() via the server module. - await import('@colony/mcp-server'); + const { main } = await import('@colony/mcp-server'); + await main(); }); } diff --git a/apps/mcp-server/CHANGELOG.md b/apps/mcp-server/CHANGELOG.md index b9b24fd..3268a60 100644 --- a/apps/mcp-server/CHANGELOG.md +++ b/apps/mcp-server/CHANGELOG.md @@ -1,5 +1,69 @@ # @colony/mcp-server +## 0.5.0 + +### Patch Changes + +- Updated dependencies + - @colony/compress@0.5.0 + - @colony/config@0.5.0 + - @colony/core@0.5.0 + - @colony/embedding@0.5.0 + - @colony/hooks@0.5.0 + +## 0.4.0 + +### Minor Changes + +- Register the MCP caller in hivemind on startup and on every tool call. When a + client (e.g. codex) attaches to the colony stdio server without ever running + colony's lifecycle hooks, the server now writes / refreshes + `.omx/state/active-sessions/.json` using the caller's cwd plus a + session id derived from `CODEX_SESSION_ID`, `CLAUDECODE_SESSION_ID`, + `CLAUDE_SESSION_ID`, `COLONY_CLIENT_SESSION_ID`, or a per-parent-process + fallback. Existing hook-written heartbeats are preserved — the writer never + overwrites a richer task preview with a blank one. + + Exposes `upsertActiveSession` / `removeActiveSession` from `@colony/hooks` so + other non-hook runtimes can reuse the same writer. + +### Patch Changes + +- Updated dependencies + - @colony/hooks@0.4.0 + +## 0.3.0 + +### Minor Changes + +- f853481: Add a compact `hivemind` MCP tool that maps active proxy-runtime agent sessions to their current tasks. +- 4076133: Add proposal system: pre-tasks that auto-promote via collective reinforcement. Agents call `task_propose` to surface a candidate improvement; other agents call `task_reinforce` (kind `explicit` or `rediscovered`), and PostToolUse adds weak `adjacent` reinforcement whenever an edit touches a file listed in a pending proposal's `touches_files`. Total decayed strength (1-hour half-life, weights 1.0 / 0.7 / 0.3 by kind) is recomputed on every read; when it crosses `PROMOTION_THRESHOLD` (2.5), the proposal is auto-promoted to a real `TaskThread` on a synthetic branch `{branch}/proposal-{id}`. The new `task_foraging_report` MCP tool lists pending (above the 0.3 noise floor) and promoted proposals; `SessionStart` surfaces the same report in-preface. Schema bumped 4 → 5: adds `proposals` and `proposal_reinforcements`. +- 42dd222: Add response-threshold routing for broadcast (`to_agent: 'any'`) handoffs. Each agent identity (Claude, Codex, …) can register a capability profile (`ui_work`, `api_work`, `test_work`, `infra_work`, `doc_work`, each `0..1`) via the new `agent_upsert_profile` MCP tool; unknown agents default to `0.5` across all dimensions. When `TaskThread.handOff` runs with `to_agent: 'any'`, it snapshots a keyword-weighted ranking of every non-sender participant into `HandoffMetadata.suggested_candidates`. `SessionStart` preface surfaces the top match and the viewing agent's own score inline with each pending broadcast handoff, so receivers can see at a glance whether they are the best fit. New `agent_get_profile` MCP tool exposes read-only inspection. Schema bumped 5 → 6: adds `agent_profiles` table. + +### Patch Changes + +- Fix `colony mcp` never starting the stdio server. + + `apps/mcp-server/src/server.ts` gated `main()` behind an `isMainEntry()` check + so it only ran when executed directly. The CLI `mcp` command invoked it via + `await import('@colony/mcp-server')`, which triggered the guard (entry was + the CLI binary, not `server.js`) and skipped `main()` — the process exited + immediately after the dynamic import, causing IDE clients (Codex, Claude + Code) to fail the MCP handshake with "connection closed: initialize + response". + + `main` is now exported from the server module and invoked explicitly by the + CLI command. + +- Updated dependencies [eb4dad9] +- Updated dependencies [5f37e75] +- Updated dependencies [4076133] +- Updated dependencies [42dd222] + - @colony/compress@0.3.0 + - @colony/config@0.3.0 + - @colony/core@0.3.0 + - @colony/embedding@0.3.0 + ## 0.2.0 ### Minor Changes diff --git a/apps/mcp-server/package.json b/apps/mcp-server/package.json index b4a9d40..b3c076c 100644 --- a/apps/mcp-server/package.json +++ b/apps/mcp-server/package.json @@ -1,6 +1,6 @@ { "name": "@colony/mcp-server", - "version": "0.2.0", + "version": "0.5.0", "license": "MIT", "private": true, "type": "module", @@ -19,6 +19,7 @@ "@colony/config": "workspace:*", "@colony/core": "workspace:*", "@colony/embedding": "workspace:*", + "@colony/hooks": "workspace:*", "@modelcontextprotocol/sdk": "^1.0.0", "zod": "^3.23.8" }, diff --git a/apps/mcp-server/src/server.ts b/apps/mcp-server/src/server.ts index 0e48be5..7f81d6d 100644 --- a/apps/mcp-server/src/server.ts +++ b/apps/mcp-server/src/server.ts @@ -19,6 +19,7 @@ import { saveProfile, } from '@colony/core'; import { createEmbedder } from '@colony/embedding'; +import { type HookInput, type HookName, upsertActiveSession } from '@colony/hooks'; import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; import { z } from 'zod'; @@ -40,6 +41,13 @@ export function buildServer(store: MemoryStore, settings: Settings): McpServer { version: '0.1.0', }); + // Make this MCP client visible to hivemind even when the IDE never ran + // colony's lifecycle hooks (codex, custom MCP clients, background tools). + // The stdio MCP server is spawned per client session, so env + cwd + // identify the caller; upsertActiveSession merges with whatever a hook + // writer may have produced and preserves richer task previews. + installActiveSessionHeartbeat(server); + // tri-state: undefined = not yet attempted; null = unavailable (provider=none or load failed) let embedder: Embedder | null | undefined = undefined; const resolveEmbedder = async (): Promise => { @@ -654,7 +662,64 @@ function nextAction(lanes: HivemindContextLane[], memoryHits: SearchResult[]): s return 'No live lanes or matching memory found.'; } -async function main(): Promise { +interface McpClientIdentity { + sessionId: string; + ide: string; +} + +function detectMcpClientIdentity(env: NodeJS.ProcessEnv = process.env): McpClientIdentity { + const codexId = env.CODEX_SESSION_ID?.trim(); + if (codexId) return { sessionId: codexId, ide: 'codex' }; + const claudeId = env.CLAUDECODE_SESSION_ID?.trim() ?? env.CLAUDE_SESSION_ID?.trim(); + if (claudeId) return { sessionId: claudeId, ide: 'claude-code' }; + const override = env.COLONY_CLIENT_SESSION_ID?.trim(); + if (override) return { sessionId: override, ide: env.COLONY_CLIENT_IDE?.trim() ?? 'unknown' }; + // Fallback: stable per parent-process so the lane coalesces across tool calls. + return { sessionId: `mcp-${process.ppid}`, ide: env.COLONY_CLIENT_IDE?.trim() ?? 'unknown' }; +} + +function installActiveSessionHeartbeat(server: McpServer): void { + const client = detectMcpClientIdentity(); + const cwd = process.cwd(); + + const touch = (hook: HookName, extras: Partial = {}): void => { + try { + upsertActiveSession( + { session_id: client.sessionId, ide: client.ide, cwd, ...extras }, + hook, + ); + } catch { + // Heartbeat is best-effort; never fail a tool call because the JSON + // sidecar cannot be written. + } + }; + + // Register the client the moment the server is built — before any tool + // call — so the lane is visible on the very first hivemind query. + touch('session-start', { source: 'mcp-connect' }); + + // Wrap every subsequent `server.tool(...)` registration so each invocation + // bumps lastHeartbeatAt and reports the invoked tool name as the current + // task preview. The SDK overloads this method; we only care that the last + // argument is the handler. + type ToolRegister = McpServer['tool']; + const originalTool = server.tool.bind(server) as ToolRegister; + (server as { tool: ToolRegister }).tool = ((...toolArgs: unknown[]) => { + const name = typeof toolArgs[0] === 'string' ? toolArgs[0] : 'unknown'; + const handlerIndex = toolArgs.length - 1; + const handler = toolArgs[handlerIndex]; + if (typeof handler === 'function') { + const original = handler as (...handlerArgs: unknown[]) => unknown; + toolArgs[handlerIndex] = async (...handlerArgs: unknown[]) => { + touch('post-tool-use', { tool_name: `colony.${name}` }); + return original(...handlerArgs); + }; + } + return (originalTool as (...a: unknown[]) => ReturnType)(...toolArgs); + }) as ToolRegister; +} + +export async function main(): Promise { const settings = loadSettings(); const dbPath = join(resolveDataDir(settings.dataDir), 'data.db'); const store = new MemoryStore({ dbPath, settings }); diff --git a/apps/mcp-server/test/server.test.ts b/apps/mcp-server/test/server.test.ts index e0fc109..b00dad0 100644 --- a/apps/mcp-server/test/server.test.ts +++ b/apps/mcp-server/test/server.test.ts @@ -1,4 +1,4 @@ -import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'; +import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; import { tmpdir } from 'node:os'; import { join } from 'node:path'; import { defaultSettings } from '@colony/config'; @@ -358,4 +358,61 @@ describe('MCP server', () => { }); expect(res.isError).toBe(true); }); + + it('registers the MCP caller as an active session on connect and tool use', async () => { + // The fixture's pre-wired server was built before we set env + cwd, so + // build an isolated one here to drive the heartbeat path end-to-end. + const repoRoot = mkdtempSync(join(tmpdir(), 'colony-mcp-hb-')); + mkdirSync(join(repoRoot, '.git'), { recursive: true }); + writeFileSync(join(repoRoot, '.git', 'HEAD'), 'ref: refs/heads/hb-branch\n', 'utf8'); + + const prevCwd = process.cwd(); + const prevCodexId = process.env.CODEX_SESSION_ID; + process.chdir(repoRoot); + process.env.CODEX_SESSION_ID = 'hb-session-1'; + + const isolatedStore = new MemoryStore({ + dbPath: join(repoRoot, 'data.db'), + settings: defaultSettings, + }); + const isolatedServer = buildServer(isolatedStore, defaultSettings); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + const isolatedClient = new Client({ name: 'hb-test', version: '0.0.0' }); + + try { + await Promise.all([ + isolatedServer.connect(serverTransport), + isolatedClient.connect(clientTransport), + ]); + + const sessionFile = join( + repoRoot, + '.omx', + 'state', + 'active-sessions', + 'hb-session-1.json', + ); + const afterConnect = JSON.parse(readFileSync(sessionFile, 'utf8')); + expect(afterConnect.sessionKey).toBe('hb-session-1'); + expect(afterConnect.branch).toBe('hb-branch'); + expect(afterConnect.cliName).toBe('codex'); + expect(afterConnect.state).toBe('working'); + const connectHeartbeat = afterConnect.lastHeartbeatAt; + + await new Promise((r) => setTimeout(r, 5)); + + await isolatedClient.callTool({ name: 'list_sessions', arguments: { limit: 1 } }); + + const afterTool = JSON.parse(readFileSync(sessionFile, 'utf8')); + expect(afterTool.lastHeartbeatAt >= connectHeartbeat).toBe(true); + expect(afterTool.latestTaskPreview).toContain('colony.list_sessions'); + } finally { + await isolatedClient.close(); + isolatedStore.close(); + process.chdir(prevCwd); + if (prevCodexId === undefined) delete process.env.CODEX_SESSION_ID; + else process.env.CODEX_SESSION_ID = prevCodexId; + rmSync(repoRoot, { recursive: true, force: true }); + } + }); }); diff --git a/apps/worker/CHANGELOG.md b/apps/worker/CHANGELOG.md index 0eaa1cb..8094561 100644 --- a/apps/worker/CHANGELOG.md +++ b/apps/worker/CHANGELOG.md @@ -1,5 +1,31 @@ # @colony/worker +## 0.5.0 + +### Patch Changes + +- Updated dependencies + - @colony/compress@0.5.0 + - @colony/config@0.5.0 + - @colony/core@0.5.0 + - @colony/embedding@0.5.0 + - @colony/storage@0.5.0 + +## 0.3.0 + +### Patch Changes + +- Updated dependencies [eb4dad9] +- Updated dependencies [f1d036a] +- Updated dependencies [5f37e75] +- Updated dependencies [4076133] +- Updated dependencies [42dd222] + - @colony/compress@0.3.0 + - @colony/config@0.3.0 + - @colony/core@0.3.0 + - @colony/embedding@0.3.0 + - @colony/storage@0.3.0 + ## 0.2.0 ### Minor Changes diff --git a/apps/worker/package.json b/apps/worker/package.json index 6306a67..ee6844d 100644 --- a/apps/worker/package.json +++ b/apps/worker/package.json @@ -1,6 +1,6 @@ { "name": "@colony/worker", - "version": "0.2.0", + "version": "0.5.0", "license": "MIT", "private": true, "type": "module", diff --git a/evals/CHANGELOG.md b/evals/CHANGELOG.md index be7bd38..ea629be 100644 --- a/evals/CHANGELOG.md +++ b/evals/CHANGELOG.md @@ -1,5 +1,19 @@ # @colony/evals +## 0.5.0 + +### Patch Changes + +- Updated dependencies + - @colony/compress@0.5.0 + +## 0.3.0 + +### Patch Changes + +- Updated dependencies [eb4dad9] + - @colony/compress@0.3.0 + ## 0.2.0 ### Patch Changes diff --git a/evals/package.json b/evals/package.json index 9bb372b..c39068b 100644 --- a/evals/package.json +++ b/evals/package.json @@ -1,6 +1,6 @@ { "name": "@colony/evals", - "version": "0.2.0", + "version": "0.5.0", "private": true, "type": "module", "scripts": { diff --git a/packages/compress/CHANGELOG.md b/packages/compress/CHANGELOG.md index 32df923..1fa8255 100644 --- a/packages/compress/CHANGELOG.md +++ b/packages/compress/CHANGELOG.md @@ -1,5 +1,18 @@ # @colony/compress +## 0.5.0 + +### Minor Changes + +- Sync linked release with the 0.4.0 MCP heartbeat bump so `@imdeadpool/colony` + and the supporting `@colony/*` workspace packages publish together. + +## 0.3.0 + +### Patch Changes + +- eb4dad9: Rename the public CLI package and workspace package/import namespace from cavemem to Colony. The CLI binary is now `colony`, workspace imports use `@colony/*`, release scripts pack `colony`, and installed hook scripts call `colony`. + ## 0.2.0 ### Patch Changes diff --git a/packages/compress/package.json b/packages/compress/package.json index a6d8d09..0ab3484 100644 --- a/packages/compress/package.json +++ b/packages/compress/package.json @@ -1,6 +1,6 @@ { "name": "@colony/compress", - "version": "0.2.0", + "version": "0.5.0", "license": "MIT", "type": "module", "main": "./dist/index.js", @@ -15,7 +15,10 @@ "import": "./dist/lexicon.js" } }, - "files": ["dist", "src/lexicon.json"], + "files": [ + "dist", + "src/lexicon.json" + ], "scripts": { "build": "tsup src/index.ts src/lexicon.ts --format esm --dts --clean", "dev": "tsup src/index.ts src/lexicon.ts --format esm --dts --watch", diff --git a/packages/config/CHANGELOG.md b/packages/config/CHANGELOG.md index 4d720a7..3ae3611 100644 --- a/packages/config/CHANGELOG.md +++ b/packages/config/CHANGELOG.md @@ -1,5 +1,18 @@ # @colony/config +## 0.5.0 + +### Minor Changes + +- Sync linked release with the 0.4.0 MCP heartbeat bump so `@imdeadpool/colony` + and the supporting `@colony/*` workspace packages publish together. + +## 0.3.0 + +### Patch Changes + +- eb4dad9: Rename the public CLI package and workspace package/import namespace from cavemem to Colony. The CLI binary is now `colony`, workspace imports use `@colony/*`, release scripts pack `colony`, and installed hook scripts call `colony`. + ## 0.2.0 ### Minor Changes diff --git a/packages/config/package.json b/packages/config/package.json index 901da1c..8ecf638 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@colony/config", - "version": "0.2.0", + "version": "0.5.0", "license": "MIT", "type": "module", "main": "./dist/index.js", @@ -11,7 +11,9 @@ "import": "./dist/index.js" } }, - "files": ["dist"], + "files": [ + "dist" + ], "scripts": { "build": "tsup src/index.ts --format esm --dts --clean", "dev": "tsup src/index.ts --format esm --dts --watch", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 225c43d..fe7651f 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,39 @@ # @colony/core +## 0.5.0 + +### Minor Changes + +- Sync linked release with the 0.4.0 MCP heartbeat bump so `@imdeadpool/colony` + and the supporting `@colony/*` workspace packages publish together. + +### Patch Changes + +- Updated dependencies + - @colony/compress@0.5.0 + - @colony/config@0.5.0 + - @colony/storage@0.5.0 + +## 0.3.0 + +### Minor Changes + +- 5f37e75: Add pheromone trails: ambient decaying activity signal per (task, file, session). `PostToolUse` deposits pheromone on every write-tool invocation; strength decays exponentially (10-minute half-life, cap 10.0). The new `UserPromptSubmit` preface warns when another session has a strong trail on a file the current session has also touched, complementing the existing claim-based preface with a graded intensity signal that doesn't fire for stale collisions. Schema bumped to version 4 — adds `pheromones` table with FK cascade on sessions and tasks. +- 4076133: Add proposal system: pre-tasks that auto-promote via collective reinforcement. Agents call `task_propose` to surface a candidate improvement; other agents call `task_reinforce` (kind `explicit` or `rediscovered`), and PostToolUse adds weak `adjacent` reinforcement whenever an edit touches a file listed in a pending proposal's `touches_files`. Total decayed strength (1-hour half-life, weights 1.0 / 0.7 / 0.3 by kind) is recomputed on every read; when it crosses `PROMOTION_THRESHOLD` (2.5), the proposal is auto-promoted to a real `TaskThread` on a synthetic branch `{branch}/proposal-{id}`. The new `task_foraging_report` MCP tool lists pending (above the 0.3 noise floor) and promoted proposals; `SessionStart` surfaces the same report in-preface. Schema bumped 4 → 5: adds `proposals` and `proposal_reinforcements`. +- 42dd222: Add response-threshold routing for broadcast (`to_agent: 'any'`) handoffs. Each agent identity (Claude, Codex, …) can register a capability profile (`ui_work`, `api_work`, `test_work`, `infra_work`, `doc_work`, each `0..1`) via the new `agent_upsert_profile` MCP tool; unknown agents default to `0.5` across all dimensions. When `TaskThread.handOff` runs with `to_agent: 'any'`, it snapshots a keyword-weighted ranking of every non-sender participant into `HandoffMetadata.suggested_candidates`. `SessionStart` preface surfaces the top match and the viewing agent's own score inline with each pending broadcast handoff, so receivers can see at a glance whether they are the best fit. New `agent_get_profile` MCP tool exposes read-only inspection. Schema bumped 5 → 6: adds `agent_profiles` table. + +### Patch Changes + +- eb4dad9: Rename the public CLI package and workspace package/import namespace from cavemem to Colony. The CLI binary is now `colony`, workspace imports use `@colony/*`, release scripts pack `colony`, and installed hook scripts call `colony`. +- Updated dependencies [eb4dad9] +- Updated dependencies [f1d036a] +- Updated dependencies [5f37e75] +- Updated dependencies [4076133] +- Updated dependencies [42dd222] + - @colony/compress@0.3.0 + - @colony/config@0.3.0 + - @colony/storage@0.3.0 + ## 0.2.0 ### Minor Changes diff --git a/packages/core/package.json b/packages/core/package.json index c97b8b7..2cbddbf 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@colony/core", - "version": "0.2.0", + "version": "0.5.0", "license": "MIT", "type": "module", "main": "./dist/index.js", @@ -11,7 +11,9 @@ "import": "./dist/index.js" } }, - "files": ["dist"], + "files": [ + "dist" + ], "scripts": { "build": "tsup src/index.ts --format esm --dts --clean", "dev": "tsup src/index.ts --format esm --dts --watch", diff --git a/packages/embedding/CHANGELOG.md b/packages/embedding/CHANGELOG.md index 50a39be..e44df52 100644 --- a/packages/embedding/CHANGELOG.md +++ b/packages/embedding/CHANGELOG.md @@ -1,5 +1,25 @@ # @colony/embedding +## 0.5.0 + +### Minor Changes + +- Sync linked release with the 0.4.0 MCP heartbeat bump so `@imdeadpool/colony` + and the supporting `@colony/*` workspace packages publish together. + +### Patch Changes + +- Updated dependencies + - @colony/config@0.5.0 + +## 0.3.0 + +### Patch Changes + +- eb4dad9: Rename the public CLI package and workspace package/import namespace from cavemem to Colony. The CLI binary is now `colony`, workspace imports use `@colony/*`, release scripts pack `colony`, and installed hook scripts call `colony`. +- Updated dependencies [eb4dad9] + - @colony/config@0.3.0 + ## 0.2.0 ### Minor Changes diff --git a/packages/embedding/package.json b/packages/embedding/package.json index 65633fa..a466da0 100644 --- a/packages/embedding/package.json +++ b/packages/embedding/package.json @@ -1,6 +1,6 @@ { "name": "@colony/embedding", - "version": "0.2.0", + "version": "0.5.0", "license": "MIT", "type": "module", "main": "./dist/index.js", @@ -11,7 +11,9 @@ "import": "./dist/index.js" } }, - "files": ["dist"], + "files": [ + "dist" + ], "scripts": { "build": "tsup", "dev": "tsup --watch", diff --git a/packages/hooks/CHANGELOG.md b/packages/hooks/CHANGELOG.md index a72db29..080456a 100644 --- a/packages/hooks/CHANGELOG.md +++ b/packages/hooks/CHANGELOG.md @@ -1,5 +1,48 @@ # @colony/hooks +## 0.5.0 + +### Patch Changes + +- Updated dependencies + - @colony/config@0.5.0 + - @colony/core@0.5.0 + +## 0.4.0 + +### Minor Changes + +- Register the MCP caller in hivemind on startup and on every tool call. When a + client (e.g. codex) attaches to the colony stdio server without ever running + colony's lifecycle hooks, the server now writes / refreshes + `.omx/state/active-sessions/.json` using the caller's cwd plus a + session id derived from `CODEX_SESSION_ID`, `CLAUDECODE_SESSION_ID`, + `CLAUDE_SESSION_ID`, `COLONY_CLIENT_SESSION_ID`, or a per-parent-process + fallback. Existing hook-written heartbeats are preserved — the writer never + overwrites a richer task preview with a blank one. + + Exposes `upsertActiveSession` / `removeActiveSession` from `@colony/hooks` so + other non-hook runtimes can reuse the same writer. + +## 0.3.0 + +### Minor Changes + +- 5f37e75: Add pheromone trails: ambient decaying activity signal per (task, file, session). `PostToolUse` deposits pheromone on every write-tool invocation; strength decays exponentially (10-minute half-life, cap 10.0). The new `UserPromptSubmit` preface warns when another session has a strong trail on a file the current session has also touched, complementing the existing claim-based preface with a graded intensity signal that doesn't fire for stale collisions. Schema bumped to version 4 — adds `pheromones` table with FK cascade on sessions and tasks. +- 4076133: Add proposal system: pre-tasks that auto-promote via collective reinforcement. Agents call `task_propose` to surface a candidate improvement; other agents call `task_reinforce` (kind `explicit` or `rediscovered`), and PostToolUse adds weak `adjacent` reinforcement whenever an edit touches a file listed in a pending proposal's `touches_files`. Total decayed strength (1-hour half-life, weights 1.0 / 0.7 / 0.3 by kind) is recomputed on every read; when it crosses `PROMOTION_THRESHOLD` (2.5), the proposal is auto-promoted to a real `TaskThread` on a synthetic branch `{branch}/proposal-{id}`. The new `task_foraging_report` MCP tool lists pending (above the 0.3 noise floor) and promoted proposals; `SessionStart` surfaces the same report in-preface. Schema bumped 4 → 5: adds `proposals` and `proposal_reinforcements`. +- 42dd222: Add response-threshold routing for broadcast (`to_agent: 'any'`) handoffs. Each agent identity (Claude, Codex, …) can register a capability profile (`ui_work`, `api_work`, `test_work`, `infra_work`, `doc_work`, each `0..1`) via the new `agent_upsert_profile` MCP tool; unknown agents default to `0.5` across all dimensions. When `TaskThread.handOff` runs with `to_agent: 'any'`, it snapshots a keyword-weighted ranking of every non-sender participant into `HandoffMetadata.suggested_candidates`. `SessionStart` preface surfaces the top match and the viewing agent's own score inline with each pending broadcast handoff, so receivers can see at a glance whether they are the best fit. New `agent_get_profile` MCP tool exposes read-only inspection. Schema bumped 5 → 6: adds `agent_profiles` table. + +### Patch Changes + +- eb4dad9: Rename the public CLI package and workspace package/import namespace from cavemem to Colony. The CLI binary is now `colony`, workspace imports use `@colony/*`, release scripts pack `colony`, and installed hook scripts call `colony`. +- f1d036a: Bind hook-created sessions back to their repository cwd so colony views can see live Codex/Claude work instead of orphan `cwd: null` sessions. +- Updated dependencies [eb4dad9] +- Updated dependencies [5f37e75] +- Updated dependencies [4076133] +- Updated dependencies [42dd222] + - @colony/config@0.3.0 + - @colony/core@0.3.0 + ## 0.2.0 ### Minor Changes diff --git a/packages/hooks/package.json b/packages/hooks/package.json index 816c2a0..35f8a75 100644 --- a/packages/hooks/package.json +++ b/packages/hooks/package.json @@ -1,6 +1,6 @@ { "name": "@colony/hooks", - "version": "0.2.0", + "version": "0.5.0", "license": "MIT", "type": "module", "main": "./dist/index.js", @@ -11,7 +11,9 @@ "import": "./dist/index.js" } }, - "files": ["dist"], + "files": [ + "dist" + ], "scripts": { "build": "tsup src/index.ts --format esm --dts --clean", "dev": "tsup src/index.ts --format esm --dts --watch", diff --git a/packages/hooks/src/index.ts b/packages/hooks/src/index.ts index cfdad87..ee92ab2 100644 --- a/packages/hooks/src/index.ts +++ b/packages/hooks/src/index.ts @@ -6,3 +6,4 @@ export { userPromptSubmit } from './handlers/user-prompt-submit.js'; export { postToolUse } from './handlers/post-tool-use.js'; export { stop } from './handlers/stop.js'; export { sessionEnd } from './handlers/session-end.js'; +export { upsertActiveSession, removeActiveSession } from './active-session.js'; diff --git a/packages/installers/CHANGELOG.md b/packages/installers/CHANGELOG.md index 1892eda..f099598 100644 --- a/packages/installers/CHANGELOG.md +++ b/packages/installers/CHANGELOG.md @@ -1,5 +1,25 @@ # @colony/installers +## 0.5.0 + +### Minor Changes + +- Sync linked release with the 0.4.0 MCP heartbeat bump so `@imdeadpool/colony` + and the supporting `@colony/*` workspace packages publish together. + +### Patch Changes + +- Updated dependencies + - @colony/config@0.5.0 + +## 0.3.0 + +### Patch Changes + +- eb4dad9: Rename the public CLI package and workspace package/import namespace from cavemem to Colony. The CLI binary is now `colony`, workspace imports use `@colony/*`, release scripts pack `colony`, and installed hook scripts call `colony`. +- Updated dependencies [eb4dad9] + - @colony/config@0.3.0 + ## 0.2.0 ### Patch Changes diff --git a/packages/installers/package.json b/packages/installers/package.json index 13fe9fa..ef6487c 100644 --- a/packages/installers/package.json +++ b/packages/installers/package.json @@ -1,6 +1,6 @@ { "name": "@colony/installers", - "version": "0.2.0", + "version": "0.5.0", "license": "MIT", "type": "module", "main": "./dist/index.js", @@ -11,7 +11,9 @@ "import": "./dist/index.js" } }, - "files": ["dist"], + "files": [ + "dist" + ], "scripts": { "build": "tsup src/index.ts --format esm --dts --clean", "dev": "tsup src/index.ts --format esm --dts --watch", diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index 1f79f63..2dbca05 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -1,5 +1,32 @@ # @colony/storage +## 0.5.0 + +### Minor Changes + +- Sync linked release with the 0.4.0 MCP heartbeat bump so `@imdeadpool/colony` + and the supporting `@colony/*` workspace packages publish together. + +### Patch Changes + +- Updated dependencies + - @colony/config@0.5.0 + +## 0.3.0 + +### Minor Changes + +- 5f37e75: Add pheromone trails: ambient decaying activity signal per (task, file, session). `PostToolUse` deposits pheromone on every write-tool invocation; strength decays exponentially (10-minute half-life, cap 10.0). The new `UserPromptSubmit` preface warns when another session has a strong trail on a file the current session has also touched, complementing the existing claim-based preface with a graded intensity signal that doesn't fire for stale collisions. Schema bumped to version 4 — adds `pheromones` table with FK cascade on sessions and tasks. +- 4076133: Add proposal system: pre-tasks that auto-promote via collective reinforcement. Agents call `task_propose` to surface a candidate improvement; other agents call `task_reinforce` (kind `explicit` or `rediscovered`), and PostToolUse adds weak `adjacent` reinforcement whenever an edit touches a file listed in a pending proposal's `touches_files`. Total decayed strength (1-hour half-life, weights 1.0 / 0.7 / 0.3 by kind) is recomputed on every read; when it crosses `PROMOTION_THRESHOLD` (2.5), the proposal is auto-promoted to a real `TaskThread` on a synthetic branch `{branch}/proposal-{id}`. The new `task_foraging_report` MCP tool lists pending (above the 0.3 noise floor) and promoted proposals; `SessionStart` surfaces the same report in-preface. Schema bumped 4 → 5: adds `proposals` and `proposal_reinforcements`. +- 42dd222: Add response-threshold routing for broadcast (`to_agent: 'any'`) handoffs. Each agent identity (Claude, Codex, …) can register a capability profile (`ui_work`, `api_work`, `test_work`, `infra_work`, `doc_work`, each `0..1`) via the new `agent_upsert_profile` MCP tool; unknown agents default to `0.5` across all dimensions. When `TaskThread.handOff` runs with `to_agent: 'any'`, it snapshots a keyword-weighted ranking of every non-sender participant into `HandoffMetadata.suggested_candidates`. `SessionStart` preface surfaces the top match and the viewing agent's own score inline with each pending broadcast handoff, so receivers can see at a glance whether they are the best fit. New `agent_get_profile` MCP tool exposes read-only inspection. Schema bumped 5 → 6: adds `agent_profiles` table. + +### Patch Changes + +- eb4dad9: Rename the public CLI package and workspace package/import namespace from cavemem to Colony. The CLI binary is now `colony`, workspace imports use `@colony/*`, release scripts pack `colony`, and installed hook scripts call `colony`. +- f1d036a: Bind hook-created sessions back to their repository cwd so colony views can see live Codex/Claude work instead of orphan `cwd: null` sessions. +- Updated dependencies [eb4dad9] + - @colony/config@0.3.0 + ## 0.2.0 ### Minor Changes diff --git a/packages/storage/package.json b/packages/storage/package.json index e09e0d3..82db17b 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,6 +1,6 @@ { "name": "@colony/storage", - "version": "0.2.0", + "version": "0.5.0", "license": "MIT", "type": "module", "main": "./dist/index.js", @@ -11,7 +11,9 @@ "import": "./dist/index.js" } }, - "files": ["dist"], + "files": [ + "dist" + ], "scripts": { "build": "tsup src/index.ts --format esm --dts --clean", "dev": "tsup src/index.ts --format esm --dts --watch", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 539e69a..ed9a1a7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -115,6 +115,9 @@ importers: '@colony/embedding': specifier: workspace:* version: link:../../packages/embedding + '@colony/hooks': + specifier: workspace:* + version: link:../../packages/hooks '@modelcontextprotocol/sdk': specifier: ^1.0.0 version: 1.29.0(zod@3.25.76)