Files
ruflo/v3/@claude-flow/shared/package.json
T
rUv 07ff7f5641 fix: prevent MCP server self-kill on startup (#1381)
* fix: intelligence layer loads flat array from auto-memory store

The auto-memory-hook.mjs writes a flat JSON array to auto-memory-store.json,
but intelligence.cjs loadEntries() only checked for store.entries (object
wrapper format). This caused the vector store to load only 1 fallback
pattern from MEMORY.md instead of the full 1,300+ entries.

Now supports both formats: flat array and { entries: [...] } wrapper.
Also fixes deprecated Dirent.path usage (use parentPath first).

Co-Authored-By: claude-flow <ruv@ruv.net>

* fix: apply same loadEntries fix to helpers-generator.ts

The published CLI package generates intelligence.cjs during `init` via
helpers-generator.ts — it had the same flat-array bug. Users running
`npx claude-flow init` would get the broken version.

Co-Authored-By: claude-flow <ruv@ruv.net>

* fix: statusline uses real data instead of hardcoded/estimated values

- Hooks: count actual hook entries instead of hardcoding total=17
- Vectors: count real entries from auto-memory-store.json, not file-size/2
- Tests: scan v3/ directory (depth 6), was missing ~2000 test files
- Swarm: only show active if state updated within 5 min (stale check)
- Security: flag as STALE if audit older than 7 days
- ADRs: count actual files (76), don't use stale compliance JSON (7)
- Intelligence: scale to 2000 entries = 100% instead of 100 entries

Co-Authored-By: claude-flow <ruv@ruv.net>

* fix: apply statusline accuracy fixes to generator (end-user path)

The statusline-generator.ts always overwrites the bundled statusline.cjs
during init, so all 6 accuracy fixes must be in both files:

- Hooks: count actual entries, not hardcode 17
- Vectors: read real entry count from store JSON
- Tests: scan depth 6, include v3/ directory
- Swarm: 5-min staleness check on metrics
- Security: PENDING when no audit run, STALE after 7 days
- ADRs: count files directly, skip stale compliance JSON

Co-Authored-By: claude-flow <ruv@ruv.net>

* fix: prevent MCP server self-kill on startup (#1380)

Three compounding bugs caused `mcp start` to crash with "Killed":

1. Self-kill: getStatus() reported current process as "running" for stdio
   transport, then start command sent SIGKILL to its own PID
2. Config crash: Zod schema rejected partial configs with non-object values
3. Hook exit: process.exitCode=0 was overridden by async errors

Fixes:
- Add isSelfDetected guard to skip kill when PID matches process.pid
- Add .passthrough() to SystemConfigSchema, merge partial configs with defaults
- Use process.exit(0) in .finally() for reliable hook exits
- Remove invalid hook events (TeammateIdle, TaskCompleted, PostCompact)
- Wrap hook commands in sh -c for cross-platform CLAUDE_PROJECT_DIR expansion

Published as v3.5.39. Tested in Docker — clean startup, no warnings.

Closes #1380

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-19 11:08:37 -04:00

43 lines
1.0 KiB
JSON

{
"name": "@claude-flow/shared",
"version": "3.0.0-alpha.7",
"type": "module",
"description": "Shared module - common types, events, utilities, core interfaces",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": "./dist/index.js",
"./types": "./dist/types/index.js",
"./core": "./dist/core/index.js",
"./events": "./dist/events/index.js",
"./hooks": "./dist/hooks/index.js",
"./mcp": "./dist/mcp/index.js",
"./security": "./dist/security/index.js",
"./resilience": "./dist/resilience/index.js"
},
"scripts": {
"test": "vitest run",
"build": "tsc"
},
"dependencies": {
"sql.js": "^1.10.3"
},
"devDependencies": {
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/node": "^20.0.0",
"@types/sql.js": "^1.4.9",
"@types/ws": "^8.5.10",
"cors": "^2.8.5",
"express": "^4.21.0",
"helmet": "^7.1.0",
"vitest": "^4.0.16",
"ws": "^8.16.0",
"zod": "^3.22.4"
},
"publishConfig": {
"access": "public",
"tag": "v3alpha"
}
}