agentic-flow 1.7.6 → 1.7.8

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-flow",
3
- "version": "1.7.6",
3
+ "version": "1.7.8",
4
4
  "description": "Production-ready AI agent orchestration platform with 66 specialized agents, 213 MCP tools, ReasoningBank learning memory, and autonomous multi-agent swarms. Built by @ruvnet with Claude Agent SDK, neural networks, memory persistence, GitHub integration, and distributed consensus protocols.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -22,6 +22,7 @@
22
22
  "./transport/quic": "./dist/transport/quic.js"
23
23
  },
24
24
  "scripts": {
25
+ "postinstall": "node scripts/postinstall.js || true",
25
26
  "start": "node --enable-source-maps dist/index.js",
26
27
  "build": "npm run build:wasm && tsc -p config/tsconfig.json && cp -r src/reasoningbank/prompts dist/reasoningbank/",
27
28
  "build:wasm": "cd ../reasoningbank && wasm-pack build --target bundler --out-dir pkg/bundler crates/reasoningbank-wasm && wasm-pack build --target web --out-dir pkg/web crates/reasoningbank-wasm && mkdir -p ../agentic-flow/wasm/reasoningbank && cp -r crates/reasoningbank-wasm/pkg/bundler/* ../agentic-flow/wasm/reasoningbank/ && cp -r crates/reasoningbank-wasm/pkg/web ../agentic-flow/wasm/reasoningbank/",
@@ -142,7 +143,7 @@
142
143
  "@anthropic-ai/claude-agent-sdk": "^0.1.5",
143
144
  "@anthropic-ai/sdk": "^0.65.0",
144
145
  "@google/genai": "^1.22.0",
145
- "agentdb": "^1.3.9",
146
+ "agentdb": "^1.3.12",
146
147
  "agentic-payments": "^0.1.3",
147
148
  "axios": "^1.12.2",
148
149
  "better-sqlite3": "^12.4.1",
@@ -0,0 +1,98 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Postinstall script for agentic-flow
4
+ *
5
+ * Automatically patches AgentDB v1.3.9 import resolution issues
6
+ * This runs after npm install, npm install -g, and npx
7
+ */
8
+
9
+ import { readFileSync, writeFileSync, existsSync } from 'fs';
10
+ import { join, dirname } from 'path';
11
+ import { fileURLToPath } from 'url';
12
+
13
+ const __filename = fileURLToPath(import.meta.url);
14
+ const __dirname = dirname(__filename);
15
+
16
+ function findAgentDBPath() {
17
+ const possiblePaths = [
18
+ // npm install (local)
19
+ join(__dirname, '..', 'node_modules', 'agentdb'),
20
+ // npm install -g
21
+ join(__dirname, '..', '..', 'agentdb'),
22
+ // npx (parent directory)
23
+ join(__dirname, '..', '..', '..', 'agentdb')
24
+ ];
25
+
26
+ for (const path of possiblePaths) {
27
+ if (existsSync(join(path, 'package.json'))) {
28
+ try {
29
+ const pkg = JSON.parse(readFileSync(join(path, 'package.json'), 'utf8'));
30
+ if (pkg.name === 'agentdb') {
31
+ return path;
32
+ }
33
+ } catch {}
34
+ }
35
+ }
36
+
37
+ return null;
38
+ }
39
+
40
+ function applyPatch() {
41
+ console.log('[agentic-flow] Checking AgentDB installation...');
42
+
43
+ const agentdbPath = findAgentDBPath();
44
+ if (!agentdbPath) {
45
+ console.log('[agentic-flow] ⚠️ AgentDB not found - skipping patch');
46
+ return;
47
+ }
48
+
49
+ const controllerIndexPath = join(agentdbPath, 'dist', 'controllers', 'index.js');
50
+ if (!existsSync(controllerIndexPath)) {
51
+ console.log('[agentic-flow] ⚠️ AgentDB controllers not found');
52
+ return;
53
+ }
54
+
55
+ let content = readFileSync(controllerIndexPath, 'utf8');
56
+
57
+ // Check if already patched
58
+ if (content.includes("from './ReflexionMemory.js'")) {
59
+ console.log('[agentic-flow] ✅ AgentDB already patched');
60
+ return;
61
+ }
62
+
63
+ // Apply patches
64
+ const patches = [
65
+ { from: "from './ReflexionMemory'", to: "from './ReflexionMemory.js'" },
66
+ { from: "from './SkillLibrary'", to: "from './SkillLibrary.js'" },
67
+ { from: "from './EmbeddingService'", to: "from './EmbeddingService.js'" },
68
+ { from: "from './CausalMemoryGraph'", to: "from './CausalMemoryGraph.js'" },
69
+ { from: "from './CausalRecall'", to: "from './CausalRecall.js'" },
70
+ { from: "from './NightlyLearner'", to: "from './NightlyLearner.js'" }
71
+ ];
72
+
73
+ let modified = false;
74
+ for (const patch of patches) {
75
+ if (content.includes(patch.from) && !content.includes(patch.to)) {
76
+ content = content.replace(new RegExp(patch.from, 'g'), patch.to);
77
+ modified = true;
78
+ }
79
+ }
80
+
81
+ if (modified) {
82
+ try {
83
+ writeFileSync(controllerIndexPath, content, 'utf8');
84
+ console.log('[agentic-flow] ✅ AgentDB imports patched successfully');
85
+ console.log('[agentic-flow] Fixed ESM import resolution for v1.3.9');
86
+ } catch (error) {
87
+ console.log('[agentic-flow] ⚠️ Could not write patch (read-only)');
88
+ console.log('[agentic-flow] This is OK for npx - runtime patch will handle it');
89
+ }
90
+ }
91
+ }
92
+
93
+ try {
94
+ applyPatch();
95
+ } catch (error) {
96
+ console.log('[agentic-flow] ⚠️ Postinstall patch failed:', error.message);
97
+ console.log('[agentic-flow] Runtime patch will attempt fix on first use');
98
+ }