claude-flow 3.75.2 → 3.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/.claude/.proven-config-version +1 -0
  2. package/.claude/proven-config.json +42 -0
  3. package/node_modules/@claude-flow/plugin-agent-federation/package.json +16 -4
  4. package/node_modules/@claude-flow/security/README.md +43 -0
  5. package/node_modules/@claude-flow/security/package.json +23 -0
  6. package/package.json +2 -2
  7. package/v3/@claude-flow/cli/catalog-manifest.json +2 -2
  8. package/v3/@claude-flow/cli/dist/src/commands/hooks.js +1 -1
  9. package/v3/@claude-flow/cli/dist/src/init/helper-companions.js +64 -2
  10. package/v3/@claude-flow/cli/dist/src/init/settings-risk-scanner.js +16 -1
  11. package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js +64 -6
  12. package/v3/@claude-flow/cli/dist/src/mcp-tools/metaharness-tools.js +1 -1
  13. package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.js +9 -2
  14. package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.d.ts +2 -0
  15. package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js +7 -3
  16. package/v3/@claude-flow/cli/dist/src/missions/schemas.d.ts +124 -124
  17. package/v3/@claude-flow/cli/dist/src/mods/command-registry/schema.d.ts +199 -199
  18. package/v3/@claude-flow/cli/dist/src/ruvector/centroid-router.d.ts +87 -0
  19. package/v3/@claude-flow/cli/dist/src/ruvector/centroid-router.js +154 -0
  20. package/v3/@claude-flow/cli/dist/src/ruvector/router-embedder.d.ts +2 -0
  21. package/v3/@claude-flow/cli/dist/src/ruvector/router-embedder.js +7 -0
  22. package/v3/@claude-flow/cli/dist/src/services/distill-oracle.d.ts +1 -1
  23. package/v3/@claude-flow/cli/dist/src/services/distill-oracle.js +2 -2
  24. package/v3/@claude-flow/cli/dist/src/transfer/store/download.d.ts +10 -3
  25. package/v3/@claude-flow/cli/dist/src/transfer/store/download.js +33 -16
  26. package/v3/@claude-flow/cli/package.json +10 -6
  27. package/v3/@claude-flow/shared/README.md +39 -0
  28. package/v3/@claude-flow/shared/dist/core/config/schema.d.ts +114 -1516
  29. package/v3/@claude-flow/shared/dist/core/config/schema.js +4 -4
  30. package/v3/@claude-flow/shared/dist/core/config/validator.d.ts +2 -2
  31. package/v3/@claude-flow/shared/dist/core/config/validator.js +17 -3
  32. package/v3/@claude-flow/shared/package.json +25 -4
@@ -0,0 +1,87 @@
1
+ /**
2
+ * centroid-router.ts — opt-in nearest-centroid agent router (ADR-527).
3
+ *
4
+ * Each agent label has one unit-length centroid: the mean MiniLM embedding of
5
+ * its labelled example prompts (the ADR-391 corpus dev split, built by
6
+ * `benchmarks/router/build-centroids.mjs`). A task goes to the label whose
7
+ * centroid is most cosine-similar. When the top two scores are closer than
8
+ * `margin`, the caller keeps the current router's pick instead.
9
+ *
10
+ * The artifact records the embedding model and dimension it was built with.
11
+ * A query embedded any other way (for example MiniLM degraded to the hash
12
+ * embedder) is never scored against it: `classify` returns `unavailable`.
13
+ *
14
+ * Gate: `CLAUDE_FLOW_ROUTER_CENTROID=1`. Off by default; the current router
15
+ * is unchanged unless the flag is set.
16
+ *
17
+ * @module centroid-router
18
+ */
19
+ export declare const CENTROID_ROUTER_ENV = "CLAUDE_FLOW_ROUTER_CENTROID";
20
+ export declare const CENTROID_MARGIN_ENV = "CLAUDE_FLOW_ROUTER_CENTROID_MARGIN";
21
+ export declare const CENTROID_ARTIFACT_ENV = "CLAUDE_FLOW_ROUTER_CENTROID_PATH";
22
+ export declare const CENTROID_SCHEMA = "ruflo.agent-centroids/1";
23
+ /** Label meaning "no agent fits"; the router abstains instead of picking one. */
24
+ export declare const ABSTAIN_LABEL = "none";
25
+ export interface CentroidArtifact {
26
+ schema: typeof CENTROID_SCHEMA;
27
+ /** Embedder kind the centroids live in. Only 'minilm' is built today. */
28
+ embedder: 'minilm';
29
+ /** Embedding model id reported by the local embedder when the artifact was built. */
30
+ model: string;
31
+ dim: number;
32
+ /** Default top-two margin below which the caller falls back. */
33
+ margin: number;
34
+ /** sha256 of the corpus file the centroids were built from. */
35
+ corpusSha256: string;
36
+ split: string;
37
+ labels: string[];
38
+ /** Examples per label, aligned with `labels`. */
39
+ support: number[];
40
+ /** Unit-length centroids, aligned with `labels`. */
41
+ centroids: number[][];
42
+ }
43
+ export type CentroidDecision = {
44
+ status: 'decided';
45
+ label: string;
46
+ score: number;
47
+ runnerUp: string;
48
+ runnerUpScore: number;
49
+ margin: number;
50
+ } | {
51
+ status: 'fallback';
52
+ label: string;
53
+ score: number;
54
+ runnerUp: string;
55
+ runnerUpScore: number;
56
+ margin: number;
57
+ reason: string;
58
+ } | {
59
+ status: 'unavailable';
60
+ reason: string;
61
+ }
62
+ /** A learned route (AgentDB or a persisted SONA pattern) answered before the centroid router ran. */
63
+ | {
64
+ status: 'bypassed';
65
+ reason: string;
66
+ };
67
+ export declare function centroidRouterEnabled(env?: NodeJS.ProcessEnv): boolean;
68
+ /** Margin from the env when it is a finite number in [0, 1], else the artifact default. */
69
+ export declare function resolveMargin(artifact: Pick<CentroidArtifact, 'margin'>, env?: NodeJS.ProcessEnv): number;
70
+ /** Throws with a specific message when the artifact is malformed. */
71
+ export declare function validateArtifact(a: unknown): CentroidArtifact;
72
+ /** Load (and cache) the artifact. Returns the error instead of throwing. */
73
+ export declare function loadCentroidArtifact(env?: NodeJS.ProcessEnv): {
74
+ artifact: CentroidArtifact | null;
75
+ error: string | null;
76
+ path: string;
77
+ };
78
+ /**
79
+ * Score one query embedding.
80
+ * @param query the query vector (any length; normalised here)
81
+ * @param queryEmbedder the embedder that actually produced `query`
82
+ * @param queryModel the model id that produced it, when known
83
+ */
84
+ export declare function classify(artifact: CentroidArtifact, query: ArrayLike<number>, queryEmbedder: string, queryModel: string | undefined, margin: number): CentroidDecision;
85
+ /** Test hook. */
86
+ export declare function __resetCentroidRouterForTests(): void;
87
+ //# sourceMappingURL=centroid-router.d.ts.map
@@ -0,0 +1,154 @@
1
+ /**
2
+ * centroid-router.ts — opt-in nearest-centroid agent router (ADR-527).
3
+ *
4
+ * Each agent label has one unit-length centroid: the mean MiniLM embedding of
5
+ * its labelled example prompts (the ADR-391 corpus dev split, built by
6
+ * `benchmarks/router/build-centroids.mjs`). A task goes to the label whose
7
+ * centroid is most cosine-similar. When the top two scores are closer than
8
+ * `margin`, the caller keeps the current router's pick instead.
9
+ *
10
+ * The artifact records the embedding model and dimension it was built with.
11
+ * A query embedded any other way (for example MiniLM degraded to the hash
12
+ * embedder) is never scored against it: `classify` returns `unavailable`.
13
+ *
14
+ * Gate: `CLAUDE_FLOW_ROUTER_CENTROID=1`. Off by default; the current router
15
+ * is unchanged unless the flag is set.
16
+ *
17
+ * @module centroid-router
18
+ */
19
+ import { existsSync, readFileSync } from 'node:fs';
20
+ import { dirname, resolve as resolvePath } from 'node:path';
21
+ import { fileURLToPath } from 'node:url';
22
+ export const CENTROID_ROUTER_ENV = 'CLAUDE_FLOW_ROUTER_CENTROID';
23
+ export const CENTROID_MARGIN_ENV = 'CLAUDE_FLOW_ROUTER_CENTROID_MARGIN';
24
+ export const CENTROID_ARTIFACT_ENV = 'CLAUDE_FLOW_ROUTER_CENTROID_PATH';
25
+ export const CENTROID_SCHEMA = 'ruflo.agent-centroids/1';
26
+ /** Label meaning "no agent fits"; the router abstains instead of picking one. */
27
+ export const ABSTAIN_LABEL = 'none';
28
+ export function centroidRouterEnabled(env = process.env) {
29
+ return env[CENTROID_ROUTER_ENV] === '1';
30
+ }
31
+ /** Margin from the env when it is a finite number in [0, 1], else the artifact default. */
32
+ export function resolveMargin(artifact, env = process.env) {
33
+ const raw = env[CENTROID_MARGIN_ENV];
34
+ if (raw !== undefined && raw.trim() !== '') {
35
+ const m = Number(raw);
36
+ if (Number.isFinite(m) && m >= 0 && m <= 1)
37
+ return m;
38
+ }
39
+ return artifact.margin;
40
+ }
41
+ /** Throws with a specific message when the artifact is malformed. */
42
+ export function validateArtifact(a) {
43
+ const x = a;
44
+ if (!x || x.schema !== CENTROID_SCHEMA)
45
+ throw new Error(`centroid artifact schema is not ${CENTROID_SCHEMA}`);
46
+ if (x.embedder !== 'minilm')
47
+ throw new Error(`centroid artifact embedder '${String(x.embedder)}' is not supported`);
48
+ if (typeof x.model !== 'string' || !x.model)
49
+ throw new Error('centroid artifact has no model id');
50
+ if (!Number.isInteger(x.dim) || x.dim <= 0)
51
+ throw new Error('centroid artifact dim is invalid');
52
+ if (typeof x.margin !== 'number' || !(x.margin >= 0 && x.margin <= 1))
53
+ throw new Error('centroid artifact margin is invalid');
54
+ const labels = x.labels, cents = x.centroids, support = x.support;
55
+ if (!Array.isArray(labels) || labels.length < 2)
56
+ throw new Error('centroid artifact needs at least two labels');
57
+ if (!Array.isArray(cents) || cents.length !== labels.length)
58
+ throw new Error('centroid artifact labels and centroids differ in length');
59
+ if (!Array.isArray(support) || support.length !== labels.length)
60
+ throw new Error('centroid artifact labels and support differ in length');
61
+ for (const c of cents) {
62
+ if (!Array.isArray(c) || c.length !== x.dim || !c.every(Number.isFinite)) {
63
+ throw new Error(`centroid artifact has a centroid that is not ${x.dim} finite numbers`);
64
+ }
65
+ }
66
+ return x;
67
+ }
68
+ let _cache = null;
69
+ function defaultArtifactPath() {
70
+ const here = dirname(fileURLToPath(import.meta.url));
71
+ // src/ruvector → assets, dist/src/ruvector → assets (package root)
72
+ const candidates = [
73
+ resolvePath(here, '..', '..', 'assets', 'agent-router', 'centroids.minilm.json'),
74
+ resolvePath(here, '..', '..', '..', 'assets', 'agent-router', 'centroids.minilm.json'),
75
+ ];
76
+ return candidates.find(existsSync) ?? candidates[0];
77
+ }
78
+ /** Load (and cache) the artifact. Returns the error instead of throwing. */
79
+ export function loadCentroidArtifact(env = process.env) {
80
+ const path = env[CENTROID_ARTIFACT_ENV] || defaultArtifactPath();
81
+ if (_cache && _cache.path === path)
82
+ return _cache;
83
+ try {
84
+ if (!existsSync(path))
85
+ throw new Error(`centroid artifact not found at ${path}`);
86
+ _cache = { path, artifact: validateArtifact(JSON.parse(readFileSync(path, 'utf8'))), error: null };
87
+ }
88
+ catch (err) {
89
+ _cache = { path, artifact: null, error: err instanceof Error ? err.message : String(err) };
90
+ }
91
+ return _cache;
92
+ }
93
+ /**
94
+ * Score one query embedding.
95
+ * @param query the query vector (any length; normalised here)
96
+ * @param queryEmbedder the embedder that actually produced `query`
97
+ * @param queryModel the model id that produced it, when known
98
+ */
99
+ export function classify(artifact, query, queryEmbedder, queryModel, margin) {
100
+ if (queryEmbedder !== artifact.embedder) {
101
+ return { status: 'unavailable', reason: `query embedded with '${queryEmbedder}', centroids are '${artifact.embedder}'` };
102
+ }
103
+ if (queryModel !== undefined && normaliseModel(queryModel) !== normaliseModel(artifact.model)) {
104
+ return { status: 'unavailable', reason: `query model '${queryModel}' differs from centroid model '${artifact.model}'` };
105
+ }
106
+ if (query.length !== artifact.dim) {
107
+ return { status: 'unavailable', reason: `query is ${query.length}-d, centroids are ${artifact.dim}-d` };
108
+ }
109
+ let norm = 0;
110
+ for (let i = 0; i < query.length; i++)
111
+ norm += query[i] * query[i];
112
+ norm = Math.sqrt(norm);
113
+ if (!(norm > 0))
114
+ return { status: 'unavailable', reason: 'query embedding is all zeros' };
115
+ let best = -1, second = -1, bestScore = -Infinity, secondScore = -Infinity;
116
+ for (let k = 0; k < artifact.centroids.length; k++) {
117
+ const c = artifact.centroids[k];
118
+ let dot = 0;
119
+ for (let i = 0; i < c.length; i++)
120
+ dot += c[i] * query[i];
121
+ const s = dot / norm;
122
+ if (s > bestScore) {
123
+ second = best;
124
+ secondScore = bestScore;
125
+ best = k;
126
+ bestScore = s;
127
+ }
128
+ else if (s > secondScore) {
129
+ second = k;
130
+ secondScore = s;
131
+ }
132
+ }
133
+ const out = {
134
+ label: artifact.labels[best], score: round(bestScore),
135
+ runnerUp: artifact.labels[second], runnerUpScore: round(secondScore),
136
+ margin: round(bestScore - secondScore),
137
+ };
138
+ if (bestScore - secondScore < margin) {
139
+ return { status: 'fallback', ...out, reason: `top two within margin ${margin}` };
140
+ }
141
+ return { status: 'decided', ...out };
142
+ }
143
+ /** 'Xenova/all-MiniLM-L6-v2' and 'all-MiniLM-L6-v2' name the same model; other runtimes keep their prefix. */
144
+ function normaliseModel(m) {
145
+ return m.replace(/^Xenova\//i, '').toLowerCase();
146
+ }
147
+ function round(x) {
148
+ return Math.round(x * 10000) / 10000;
149
+ }
150
+ /** Test hook. */
151
+ export function __resetCentroidRouterForTests() {
152
+ _cache = null;
153
+ }
154
+ //# sourceMappingURL=centroid-router.js.map
@@ -48,6 +48,8 @@ export declare function resolveRouterEmbedder(override?: RouterEmbedderKind, env
48
48
  * and thresholds were calibrated against it.
49
49
  */
50
50
  export declare function generateSimpleEmbedding(text: string, dimension?: number): Float32Array;
51
+ /** Model id behind the most recent MiniLM vector, or undefined before the first one. */
52
+ export declare function routerEmbedderModel(): string | undefined;
51
53
  /**
52
54
  * Embed texts for the router. All vectors in one result come from ONE embedder.
53
55
  * `hash` never touches the model (no load cost for default users).
@@ -86,6 +86,12 @@ function l2Normalize(v) {
86
86
  // changes, so this survives router rebuilds (e.g. after saveRoutingOutcomes).
87
87
  const MINILM_CACHE = new Map();
88
88
  const MINILM_CACHE_MAX = 2048;
89
+ /** Model id the local embedder last reported for a MiniLM vector (ADR-527 version check). */
90
+ let lastMiniLMModel;
91
+ /** Model id behind the most recent MiniLM vector, or undefined before the first one. */
92
+ export function routerEmbedderModel() {
93
+ return lastMiniLMModel;
94
+ }
89
95
  async function embedOneMiniLM(text) {
90
96
  const cached = MINILM_CACHE.get(text);
91
97
  if (cached)
@@ -98,6 +104,7 @@ async function embedOneMiniLM(text) {
98
104
  if (!out.embedding || out.embedding.length !== ROUTER_EMBEDDING_DIM) {
99
105
  throw new RouterEmbedderDegraded(`local embedder returned ${out.embedding?.length ?? 0}-d vectors; router index is ${ROUTER_EMBEDDING_DIM}-d`);
100
106
  }
107
+ lastMiniLMModel = out.modelId ?? out.model;
101
108
  const vec = l2Normalize(Float32Array.from(out.embedding));
102
109
  if (MINILM_CACHE.size >= MINILM_CACHE_MAX) {
103
110
  const oldest = MINILM_CACHE.keys().next().value;
@@ -36,7 +36,7 @@
36
36
  */
37
37
  import { type VerifyTaskKind } from '../ruvector/output-verifier.js';
38
38
  import { FableHarness, type ReflectItem, type ReflectResult } from './fable-harness.js';
39
- export declare const MH_DARWIN_PIN = "0.13.0";
39
+ export declare const MH_DARWIN_PIN = "0.14.0";
40
40
  export type ResolvedProvenance = 'oracle:test-exec' | 'judge:fable' | 'proxy:structural';
41
41
  /** SWE-bench-shaped / bench-suite-mapped test spec that Tier 1 can execute. */
42
42
  export interface TestSpec {
@@ -43,9 +43,9 @@ import { FableHarness, } from './fable-harness.js';
43
43
  // behavior mid-run (the #142 pin-drift failure mode). Pin it, and let
44
44
  // scripts/check-metaharness-pins.mjs watch this constant for drift. Kept in
45
45
  // lock-step with the optionalDependencies pin in package.json and the plugin
46
- // darwin cache (versioned by the plugin's own `~0.13.0` pin in _darwin.mjs;
46
+ // darwin cache (versioned by the plugin's own `~0.14.0` pin in _darwin.mjs;
47
47
  // both are checked by scripts/check-metaharness-pins.mjs — #3366).
48
- export const MH_DARWIN_PIN = '0.13.0';
48
+ export const MH_DARWIN_PIN = '0.14.0';
49
49
  // ── Public API ───────────────────────────────────────────────────────────
50
50
  /**
51
51
  * Label each trajectory with `resolved` + honest provenance, trying the tiers
@@ -46,9 +46,16 @@ export declare class PatternDownloader {
46
46
  */
47
47
  private verifySignature;
48
48
  /**
49
- * Return the trusted Ed25519 public key that a pattern's signature must verify
50
- * against (#4750). Prefers config.trustedRegistryPublicKeys, falls back to the
51
- * entry's declared publicKey only when it is well-formed.
49
+ * Resolve the Ed25519 public key a pattern's signature must verify against
50
+ * (#4750). Returns whether the key is *pinned* (came from the operator's
51
+ * config.trustedRegistryPublicKeys) or merely the entry's own self-declared
52
+ * publicKey. Callers that enforce verification must treat a self-declared key
53
+ * as untrusted: otherwise a malicious registry entry can sign its own content
54
+ * with its own key and pass (the exact gap #4750 was filed to close).
55
+ */
56
+ private resolveVerificationKey;
57
+ /**
58
+ * Thin wrapper kept for callers that only need a usable key.
52
59
  */
53
60
  private resolveTrustedPublicKey;
54
61
  /**
@@ -76,11 +76,21 @@ export class PatternDownloader {
76
76
  console.log(`[Download] Checksum verified!`);
77
77
  }
78
78
  }
79
- // Verify signature against a trusted key (#4750). A signature that does
80
- // not verify against a trusted key is refused rather than written; when
81
- // requireVerification is set, a missing/untrusted signature is also
82
- // refused. The self-declared pattern.publicKey alone is not trusted.
83
- const trustedKey = this.resolveTrustedPublicKey(pattern);
79
+ // Verify the signature (#4750). A signature that does not verify against
80
+ // the resolved key is refused rather than written. When requireVerification
81
+ // is on, verification must be backed by a *pinned* key: a self-declared
82
+ // pattern.publicKey is not trusted, so an entry that supplies its own key
83
+ // is refused rather than allowed to self-sign.
84
+ const { key: trustedKey, pinned } = this.resolveVerificationKey(pattern);
85
+ if (this.config.requireVerification && !pinned) {
86
+ console.warn(`[Download] requireVerification is on but no trusted (pinned) key is configured for ${pattern.id}; refusing self-declared key. Configure StoreConfig.trustedRegistryPublicKeys to download this pattern, or disable requireVerification.`);
87
+ return {
88
+ success: false,
89
+ pattern,
90
+ verified: false,
91
+ size: content.length,
92
+ };
93
+ }
84
94
  if (pattern.signature && trustedKey) {
85
95
  const sigVerified = await verifyEd25519(content, pattern.signature, trustedKey);
86
96
  if (!sigVerified) {
@@ -93,6 +103,7 @@ export class PatternDownloader {
93
103
  };
94
104
  }
95
105
  console.log(`[Download] Signature verified!`);
106
+ verified = true;
96
107
  }
97
108
  else if (this.config.requireVerification) {
98
109
  console.warn(`[Download] No verifiable signature and requireVerification is on, not writing the pattern.`);
@@ -288,32 +299,38 @@ export class PatternDownloader {
288
299
  }
289
300
  }
290
301
  /**
291
- * Return the trusted Ed25519 public key that a pattern's signature must verify
292
- * against (#4750). Prefers config.trustedRegistryPublicKeys, falls back to the
293
- * entry's declared publicKey only when it is well-formed.
302
+ * Resolve the Ed25519 public key a pattern's signature must verify against
303
+ * (#4750). Returns whether the key is *pinned* (came from the operator's
304
+ * config.trustedRegistryPublicKeys) or merely the entry's own self-declared
305
+ * publicKey. Callers that enforce verification must treat a self-declared key
306
+ * as untrusted: otherwise a malicious registry entry can sign its own content
307
+ * with its own key and pass (the exact gap #4750 was filed to close).
294
308
  */
295
- resolveTrustedPublicKey(pattern) {
296
- // Prefer an explicitly configured trusted key (keyed by registry name /
297
- // IPNS name). Otherwise fall back to the entry's own declared public key,
298
- // which is only acceptable when it is a well-formed ed25519 key.
309
+ resolveVerificationKey(pattern) {
299
310
  const trusted = this.config.trustedRegistryPublicKeys;
300
311
  if (trusted) {
301
312
  const candidates = [pattern.author?.id, pattern.source, pattern.id].filter(Boolean);
302
313
  for (const key of candidates) {
303
314
  const pinned = trusted[key];
304
315
  if (pinned && pinned.startsWith('ed25519:')) {
305
- return pinned;
316
+ return { key: pinned, pinned: true };
306
317
  }
307
318
  }
308
319
  // Any configured key also matches a pattern that declares the same key.
309
320
  if (pattern.publicKey && Object.values(trusted).includes(pattern.publicKey)) {
310
- return pattern.publicKey;
321
+ return { key: pattern.publicKey, pinned: true };
311
322
  }
312
323
  }
313
324
  if (pattern.publicKey && pattern.publicKey.startsWith('ed25519:')) {
314
- return pattern.publicKey;
325
+ return { key: pattern.publicKey, pinned: false };
315
326
  }
316
- return null;
327
+ return { key: null, pinned: false };
328
+ }
329
+ /**
330
+ * Thin wrapper kept for callers that only need a usable key.
331
+ */
332
+ resolveTrustedPublicKey(pattern) {
333
+ return this.resolveVerificationKey(pattern).key;
317
334
  }
318
335
  /**
319
336
  * Sanitize a pattern's name/version and assert the resulting path stays inside
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claude-flow/cli",
3
- "version": "3.75.2",
3
+ "version": "3.76.0",
4
4
  "type": "module",
5
5
  "description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
6
6
  "main": "dist/src/index.js",
@@ -76,6 +76,10 @@
76
76
  "!dist/**/*.tsbuildinfo",
77
77
  "bin",
78
78
  "scripts/postinstall.cjs",
79
+ "assets/agent-router",
80
+ "assets/model-router/seed-router.krr*.json",
81
+ "assets/model-router/seed-router.calibrator*.json",
82
+ "assets/model-router/seed-rows.json",
79
83
  "templates",
80
84
  ".claude",
81
85
  "plugins",
@@ -107,9 +111,9 @@
107
111
  "@claude-flow/neural": "3.0.3",
108
112
  "@claude-flow/plugin-agent-federation": "1.0.7",
109
113
  "@claude-flow/security": "3.0.7",
110
- "@claude-flow/shared": "3.0.7",
114
+ "@claude-flow/shared": "3.0.8",
111
115
  "@iarna/toml": "^2.2.5",
112
- "@metaharness/darwin": "~0.13.0",
116
+ "@metaharness/darwin": "~0.14.0",
113
117
  "@noble/ed25519": "2.3.0",
114
118
  "@ruvector/rabitq-wasm": "0.1.2",
115
119
  "agentic-flow": "^3.0.0",
@@ -130,17 +134,17 @@
130
134
  "ws": "^8.21.0",
131
135
  "yaml": "^2.8.0",
132
136
  "zod": "^3.22.0",
133
- "@claude-flow/memory": "3.3.0"
137
+ "@claude-flow/memory": "3.3.2"
134
138
  },
135
139
  "optionalDependencies": {
136
140
  "@agntcy/slim-bindings": "2.1.1",
137
141
  "@claude-flow/aidefence": "3.2.1",
138
- "@claude-flow/memory": "3.3.0",
142
+ "@claude-flow/memory": "3.3.2",
139
143
  "@metaharness/flywheel": "~0.1.10",
140
144
  "@metaharness/radio": "~0.1.0",
141
145
  "@metaharness/turn-credit": "~0.1.0",
142
146
  "@napi-rs/keyring": "1.3.0",
143
- "agentdb": "^3.6.0",
147
+ "agentdb": "^3.10.0",
144
148
  "better-sqlite3": "^12.9.0",
145
149
  "ruvector": "^0.3.13",
146
150
  "nostr-tools": "^2.7.0",
@@ -1,5 +1,38 @@
1
1
  # @claude-flow/shared
2
2
 
3
+ <!-- adr-356:quickstart:start -->
4
+ ![Animated diagram: raw config is validated by Zod schemas into typed config that flows through the EventBus to other packages](https://raw.githubusercontent.com/ruvnet/ruflo/main/v3/@claude-flow/shared/assets/shared-flow.svg)
5
+
6
+ **@claude-flow/shared** — Shared types, Zod config schemas and validators, the event bus and resilience helpers that the other `@claude-flow` packages build on.
7
+
8
+ **Supported environments:** Node.js 20+ · ESM · Linux, macOS, Windows (pure JavaScript)
9
+
10
+ ## Quickstart
11
+
12
+ ```bash
13
+ npm install @claude-flow/shared
14
+ ```
15
+
16
+ ```js
17
+ import { validateAgentConfig } from '@claude-flow/shared';
18
+
19
+ const ok = validateAgentConfig({ id: 'coder-1', name: 'Coder', type: 'coder' });
20
+ console.log(ok.success, ok.data.maxConcurrentTasks, ok.data.priority);
21
+
22
+ const bad = validateAgentConfig({ id: 'coder-1', name: 'Coder', type: 'coder', priority: 500 });
23
+ console.log(bad.success, bad.errors.map((e) => `${e.path}: ${e.code}`).join(', '));
24
+ ```
25
+
26
+ Expected output:
27
+
28
+ ```text
29
+ true 5 50
30
+ false priority: too_big
31
+ ```
32
+
33
+ Next: [`@claude-flow/hooks`](https://www.npmjs.com/package/@claude-flow/hooks) builds its lifecycle hooks on these types.
34
+ <!-- adr-356:quickstart:end -->
35
+
3
36
  [![npm version](https://img.shields.io/npm/v/@claude-flow/shared.svg)](https://www.npmjs.com/package/@claude-flow/shared)
4
37
  [![npm downloads](https://img.shields.io/npm/dm/@claude-flow/shared.svg)](https://www.npmjs.com/package/@claude-flow/shared)
5
38
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
@@ -321,3 +354,9 @@ This package is a dependency of all other @claude-flow modules:
321
354
  ## License
322
355
 
323
356
  MIT
357
+
358
+ <!-- adr-356:footer:start -->
359
+ ---
360
+
361
+ Built by [rUv](https://ruv.io) · [ruv.io](https://ruv.io) · [Source](https://github.com/ruvnet/ruflo/tree/main/v3/@claude-flow/shared)
362
+ <!-- adr-356:footer:end -->