🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
TypeScript agentic-aiagentic-frameworkagentic-workflowagentsai-agentsai-assistantai-skillsautonomous-agentsclaudecodexdsh-pluginharnessmcp-servermulti-agentmulti-agent-systemsnpmskillsswarmswarm-intelligencetypescript
chore(shared): 3.0.4 (RVF tail recovery + runtime dependencies), CLI/root pins, fresh-consumer smoke
rc84a6d0a1889
diff --git a/.github/workflows/v3-ci.yml b/.github/workflows/v3-ci.ymlindex 1c67101a0f..618285779c 100644--- a/.github/workflows/v3-ci.yml+++ b/.github/workflows/v3-ci.yml@@ -1741,6 +1741,15 @@ jobs:fidone+ - name: Fresh-consumer smoke for @claude-flow/shared (#4031, #4089)+ # Packs the built package, installs the tarball into an empty directory and checks, with plain Node,+ # that it ships no tests, imports on a clean install and keeps every RVF append after a damaged tail.+ # The package's own tests run against workspace source, which cannot see packaging or declared-dependency bugs.+ shell: bash+ run: |+ (cd v3 && pnpm --filter @claude-flow/shared run build)+ node scripts/smoke-shared-fresh-consumer.mjs+- name: Run plugin package auditshell: bashrun: node scripts/audit-plugin-packages.mjsdiff --git a/CHANGELOG.md b/CHANGELOG.mdindex dbb253c3a0..74ffb96fa7 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0### Fixed+- `@claude-flow/shared` 3.0.4: RVF event log no longer loses appends after a damaged tail (#4031, @rudycelekli). A partial length prefix, a partial payload or a record cut short is truncated on open, so later appends are readable; an unwritable log (EACCES/EROFS/EPERM) keeps its readable history and rejects appends explicitly. A tail whose length prefix is over the 100 MB limit is no longer accepted silently (found by @martinvlad): the bytes are kept and `append()` rejects until repaired, or set `repairOversizedTail: true` to truncate it. `append()` also refuses a record the replay limit would never read back. A fresh install can now import the package root and its tarball ships no test files: `zod`, `express`, `cors`, `helmet`, `ws` and `@types/ws` are declared dependencies, Express 5 bodiless POST and malformed-JSON requests get JSON-RPC 400s (#4091/#4089, @proffesor-for-testing).+Batch of reviewed fixes from @rudycelekli (PRs #4020-#4026, #4028-#4030, #4032, #4033, #4035, #4037; #4027 and #4034 landed earlier):- `@claude-flow/cli-core` 3.7.1: JSON memory backend owns its snapshots, rejects invalid entry containers, measures size in UTF-8 bytes, omits non-matching substring results and lets expired keys be reused; output formatter honours progress controls, empty totals, table padding, coloured header widths, and suppresses progress in quiet or redirected output.diff --git a/package-lock.json b/package-lock.jsonindex 736961acd2..f4cd13409d 100644--- a/package-lock.json+++ b/package-lock.json@@ -27,7 +27,7 @@"@claude-flow/neural": "3.0.0","@claude-flow/plugin-agent-federation": "1.0.1","@claude-flow/security": "3.0.4",- "@claude-flow/shared": "3.0.3",+ "@claude-flow/shared": "3.0.4","@iarna/toml": "^2.2.5","@noble/ed25519": "2.3.0","@ruvector/rabitq-wasm": "0.1.0",diff --git a/package.json b/package.jsonindex 55c40bed69..eb692fc2f1 100644--- a/package.json+++ b/package.json@@ -74,7 +74,7 @@"@claude-flow/neural": "3.0.0","@claude-flow/plugin-agent-federation": "1.0.1","@claude-flow/security": "3.0.4",- "@claude-flow/shared": "3.0.3",+ "@claude-flow/shared": "3.0.4","@iarna/toml": "^2.2.5","@noble/ed25519": "2.3.0","@ruvector/rabitq-wasm": "0.1.0",diff --git a/scripts/smoke-shared-fresh-consumer.mjs b/scripts/smoke-shared-fresh-consumer.mjsnew file mode 100644index 0000000000..aab89b7b2b--- /dev/null+++ b/scripts/smoke-shared-fresh-consumer.mjs@@ -0,0 +1,104 @@+#!/usr/bin/env node+/**+ * Fresh-consumer smoke for @claude-flow/shared (#4031, #4089).+ *+ * Installs the PACKED tarball (or a published spec) into an empty directory and exercises it the way a+ * consumer does: plain Node, no vitest, no TypeScript source. It checks that+ * 1. the tarball ships no test files,+ * 2. the package root and its subpaths import on a clean install (zod/express/... are declared),+ * 3. the RVF event log keeps every append across reopen cycles after each damaged-tail shape, and never+ * accepts an append it cannot read back (an oversized length prefix rejects, or truncates when opted in).+ *+ * node scripts/smoke-shared-fresh-consumer.mjs # pack v3/@claude-flow/shared (must be built)+ * node scripts/smoke-shared-fresh-consumer.mjs --spec @claude-flow/[email protected] # a published version+ */+import { execFileSync } from 'node:child_process';+import { mkdtempSync, mkdirSync, writeFileSync, rmSync, readdirSync } from 'node:fs';+import { tmpdir } from 'node:os';+import { join, resolve } from 'node:path';++const args = process.argv.slice(2);+const specIdx = args.indexOf('--spec');+const spec = specIdx >= 0 ? args[specIdx + 1] : null;+const pkgDir = resolve(args[args.indexOf('--pack') + 1] || 'v3/@claude-flow/shared');+const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';+const run = (cmd, a, opts = {}) => execFileSync(cmd, a, { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], ...opts });++const work = mkdtempSync(join(tmpdir(), 'shared-consumer-'));+const failures = [];+const rows = [];+const check = (name, ok, detail = '') => { rows.push(`${ok ? 'PASS' : 'FAIL'} ${name}${detail ? ' ' + detail : ''}`); if (!ok) failures.push(name); };++try {+ let target = spec;+ if (!spec) {+ const dry = JSON.parse(run(npm, ['pack', pkgDir, '--dry-run', '--json']))[0];+ const tests = dry.files.map(f => f.path).filter(p => /(^|\/)__tests__(\/|$)|\.(test|spec)\./.test(p));+ check('tarball ships no test files', tests.length === 0, tests.slice(0, 3).join(', '));+ run(npm, ['pack', pkgDir, '--pack-destination', work, '--silent']);+ target = join(work, readdirSync(work).find(f => f.endsWith('.tgz')));+ }+ const consumer = join(work, 'consumer');+ mkdirSync(consumer);+ run(npm, ['init', '-y', '--silent'], { cwd: consumer });+ run(npm, ['install', target, '--no-audit', '--no-fund', '--ignore-scripts', '--silent'], { cwd: consumer });++ const scenarioFile = join(consumer, 'scenarios.mjs');+ writeFileSync(scenarioFile, `+import { appendFileSync, mkdtempSync, rmSync, readFileSync } from 'node:fs';+import { tmpdir } from 'node:os';+import { join } from 'node:path';+const { RvfEventLog } = await import('@claude-flow/shared/events');+const ev = id => ({ id, aggregateId: 'a', aggregateType: 'T', type: 'C', timestamp: Number(id), version: 0, payload: {} });+const tails = {+ 'partial length prefix': Buffer.from([0, 0]),+ 'partial payload': Buffer.from([0, 0, 0, 100, 123]),+ 'oversized length prefix': Buffer.from('garbage'),+ 'complete non-JSON record': Buffer.from([0, 0, 0, 3, 0x61, 0x62, 0x63]),+ 'zero fill': Buffer.alloc(16),+};+const out = {};+for (const [name, tail] of Object.entries(tails)) for (const repair of [false, true]) {+ const dir = mkdtempSync(join(tmpdir(), 'rvf-')); const path = join(dir, 'e.rvf'); const cfg = { logPath: path, repairOversizedTail: repair };+ const res = { events: [], rejected: 0, error: null };+ try {+ let log = new RvfEventLog(cfg); await log.initialize(); await log.append(ev('1')); await log.close();+ appendFileSync(path, tail);+ for (const id of ['2', '3']) {+ log = new RvfEventLog(cfg); await log.initialize();+ try { await log.append(ev(id)); } catch { res.rejected++; }+ await log.close();+ }+ log = new RvfEventLog(cfg); await log.initialize();+ res.events = (await log.getEvents('a')).map(e => e.id); await log.close();+ } catch (e) { res.error = String(e && e.message || e); } finally { rmSync(dir, { recursive: true, force: true }); }+ out[name + (repair ? ' [repair]' : '')] = res;+}+console.log(JSON.stringify(out));+`);+ const results = JSON.parse(run('node', [scenarioFile], { cwd: consumer }).trim().split('\n').pop());+ for (const [name, r] of Object.entries(results)) {+ const accepted = r.events.filter(id => id !== '1');+ // A shape must either keep every append readable, or reject it explicitly: never accept silently.+ const silentLoss = r.rejected === 0 && accepted.length < 2;+ const ok = !r.error && !silentLoss && r.events[0] === '1';+ check(`tail: ${name}`, ok, `events=${JSON.stringify(r.events)} rejected=${r.rejected}${r.error ? ' error=' + r.error : ''}`);+ }+ for (const name of ['partial length prefix', 'partial payload', 'complete non-JSON record', 'zero fill', 'oversized length prefix [repair]']) {+ const r = results[name];+ check(`kept both appends: ${name}`, !!r && r.events.join(',') === '1,2,3', r ? JSON.stringify(r.events) : 'missing');+ }+ const oversized = results['oversized length prefix'];+ check('oversized prefix rejects explicitly by default', !!oversized && oversized.rejected === 2 && oversized.events.join(',') === '1');++ for (const entry of ['@claude-flow/shared', '@claude-flow/shared/events', '@claude-flow/shared/core', '@claude-flow/shared/mcp']) {+ try { run('node', ['--input-type=module', '-e', `await import(${JSON.stringify(entry)})`], { cwd: consumer }); check(`clean import ${entry}`, true); }+ catch (e) { check(`clean import ${entry}`, false, String(e.stderr || e.message).split('\n').find(l => /Error|Cannot/.test(l)) || ''); }+ }+} finally {+ rmSync(work, { recursive: true, force: true });+}++console.log(rows.join('\n'));+console.log(failures.length ? `\nFAILED: ${failures.length} check(s)` : '\nall fresh-consumer checks passed');+process.exit(failures.length ? 1 : 0);diff --git a/v3/@claude-flow/cli/package.json b/v3/@claude-flow/cli/package.jsonindex 426c7eabb3..b16082a5d7 100644--- a/v3/@claude-flow/cli/package.json+++ b/v3/@claude-flow/cli/package.json@@ -104,7 +104,7 @@"@claude-flow/neural": "3.0.0","@claude-flow/plugin-agent-federation": "1.0.1","@claude-flow/security": "3.0.4",- "@claude-flow/shared": "3.0.3",+ "@claude-flow/shared": "3.0.4","@iarna/toml": "^2.2.5","@noble/ed25519": "2.3.0","@ruvector/rabitq-wasm": "0.1.0",diff --git a/v3/@claude-flow/shared/package.json b/v3/@claude-flow/shared/package.jsonindex 757ed09df0..c5745f3a7a 100644--- a/v3/@claude-flow/shared/package.json+++ b/v3/@claude-flow/shared/package.json@@ -1,6 +1,6 @@{"name": "@claude-flow/shared",- "version": "3.0.3",+ "version": "3.0.4","type": "module","description": "Shared module - common types, events, utilities, core interfaces","main": "dist/index.js",diff --git a/v3/pnpm-lock.yaml b/v3/pnpm-lock.yamlindex ed14e60393..355d9d6cff 100644--- a/v3/pnpm-lock.yaml+++ b/v3/pnpm-lock.yaml@@ -135,7 +135,7 @@ importers:specifier: 3.0.4version: link:../security'@claude-flow/shared':- specifier: 3.0.3+ specifier: 3.0.4version: link:../shared'@iarna/toml':specifier: ^2.2.5