network-ai 4.0.4 → 4.0.6

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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![CI](https://github.com/jovanSAPFIONEER/Network-AI/actions/workflows/ci.yml/badge.svg)](https://github.com/jovanSAPFIONEER/Network-AI/actions/workflows/ci.yml)
6
6
  [![CodeQL](https://github.com/jovanSAPFIONEER/Network-AI/actions/workflows/codeql.yml/badge.svg)](https://github.com/jovanSAPFIONEER/Network-AI/actions/workflows/codeql.yml)
7
- [![Release](https://img.shields.io/badge/release-v4.0.3-blue.svg)](https://github.com/jovanSAPFIONEER/Network-AI/releases)
7
+ [![Release](https://img.shields.io/badge/release-v4.0.6-blue.svg)](https://github.com/jovanSAPFIONEER/Network-AI/releases)
8
8
  [![npm](https://img.shields.io/npm/dw/network-ai.svg?label=npm%20downloads)](https://www.npmjs.com/package/network-ai)
9
9
  [![ClawHub](https://img.shields.io/badge/ClawHub-network--ai-orange.svg)](https://clawhub.ai/skills/network-ai)
10
10
  [![Node.js](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org)
@@ -60,7 +60,60 @@ console.log(result.data); // "Hello, World! Your task: welcome"
60
60
 
61
61
  That's it. No config files, no setup wizards. Add more agents, swap frameworks, layer on security -- all optional.
62
62
 
63
- ## Demo
63
+ ## Demos
64
+
65
+ ### One command to run everything
66
+
67
+ ```bash
68
+ npm run demo
69
+ ```
70
+
71
+ Interactive menu or use flags directly:
72
+
73
+ ```bash
74
+ npm run demo -- --07 # Full AI showcase (OPENAI_API_KEY required)
75
+ npm run demo -- --08 # Control-plane stress demo (no API key)
76
+ npm run demo -- --both # Both sequentially
77
+ npm run demo -- --both --silent-summary # Both, highlights only
78
+ ```
79
+
80
+ ---
81
+
82
+ ### Demo 07 — Full AI Showcase *(requires `OPENAI_API_KEY`)*
83
+
84
+ 8-agent pipeline that builds a Payment Processing Service from scratch with full governance:
85
+
86
+ - **FSM state machine** — each agent phase is gated by `JourneyFSM` state transitions
87
+ - **AuthGuardian tokens** — scoped HMAC-signed tokens required at every gate
88
+ - **FederatedBudget** — per-agent token ceilings, hard cut-off on overspend
89
+ - **QualityGateAgent** — AI-assisted security scan + content safety on generated code
90
+ - **Fixer + debugger agents** — two-pass automated remediation loop
91
+ - **Deterministic 10/10 scoring** — 8 objective gates, no LLM score parsing
92
+ - **Cryptographic audit trail** — every write signed to `data/audit_log.jsonl`
93
+
94
+ ```bash
95
+ npm run demo -- --07
96
+ ```
97
+
98
+ ---
99
+
100
+ ### Demo 08 — Control-Plane Stress Demo *(no API key)*
101
+
102
+ No LLM calls. Runs in ~2 seconds. Shows the synchronization and governance primitives under load:
103
+
104
+ - **`LockedBlackboard`** — atomic `propose → validate → commit` workflow with file-system mutex
105
+ - **Priority preemption** — high-priority (3) write overwrites low-priority (0) write on same key
106
+ - **FSM timeout** — state times out after 700 ms, FSM hard-stops
107
+ - **Live compliance violations** — TOOL_ABUSE (6 rapid writes), TURN_TAKING (5 consecutive actions), RESPONSE_TIMEOUT (1.2 s sleep), JOURNEY_TIMEOUT — all captured by `ComplianceMonitor`
108
+ - **`FederatedBudget`** — per-agent ceilings tracked without any AI backend
109
+
110
+ ```bash
111
+ npm run demo -- --08
112
+ ```
113
+
114
+ ---
115
+
116
+ ### Demo 05 — Code Review Swarm *(requires `OPENAI_API_KEY`)*
64
117
 
65
118
  [![Code Review Swarm Demo](https://img.youtube.com/vi/UyMsNhaw9lU/0.jpg)](https://youtu.be/UyMsNhaw9lU)
66
119
 
@@ -68,7 +121,12 @@ That's it. No config files, no setup wizards. Add more agents, swap frameworks,
68
121
 
69
122
  > The demo shows a code review swarm, but Network-AI is not a code review tool. The same orchestration pattern works for research pipelines, data processing, content moderation, customer support routing, document analysis, financial workflows — any task where multiple agents need to coordinate without stepping on each other.
70
123
 
71
- > **Run the demo yourself:** `05-code-review-swarm.ts` is in the repo. Copy `.env.example` to `.env`, add your `OPENAI_API_KEY`, then run `npx ts-node examples/05-code-review-swarm.ts`. Supports 4 modes: built-in code review, paste your own code, system design document, or custom role for any content type (proposals, policies, job descriptions, emails). Examples `01`–`03` cover all core framework features with no API key required. `04-live-swarm.ts` runs a 10-agent live AI research swarm (3 parallel analyst waves + synthesizer) — also requires `OPENAI_API_KEY`.
124
+ ```bash
125
+ npm run demo -- --07 # or run directly:
126
+ npx ts-node examples/05-code-review-swarm.ts
127
+ ```
128
+
129
+ Supports 4 modes: built-in code review, paste your own code, system design document, or custom role for any content type. Examples `01`–`03` run without any API key. `04-live-swarm.ts` runs a 10-agent live AI research swarm (3 parallel analyst waves + synthesizer).
72
130
 
73
131
  ## Why This Exists -- The Multi-Agent Race Condition Problem
74
132
 
package/bin/mcp-server.ts CHANGED
@@ -29,7 +29,7 @@
29
29
  * http://localhost:3001/tools (list all tools)
30
30
  *
31
31
  * @module bin/mcp-server
32
- * @version 4.0.0
32
+ * @version 4.0.6
33
33
  */
34
34
 
35
35
  import {
@@ -103,7 +103,7 @@ function parseArgs(argv: string[]): ServerArgs {
103
103
 
104
104
  function printHelp(): void {
105
105
  console.log(`
106
- network-ai-server — Network-AI MCP Server v4.0.0
106
+ network-ai-server — Network-AI MCP Server v4.0.6
107
107
 
108
108
  Usage: npx ts-node bin/mcp-server.ts [options]
109
109
 
@@ -140,7 +140,7 @@ async function main(): Promise<void> {
140
140
  process.exit(0);
141
141
  }
142
142
 
143
- console.log(`\n[network-ai-server] Starting MCP Server v4.0.0`);
143
+ console.log(`\n[network-ai-server] Starting MCP Server v4.0.6`);
144
144
  console.log(`[network-ai-server] Board: ${args.board} | Port: ${args.port}`);
145
145
 
146
146
  // --------------------------------------------------------------------------
@@ -29,7 +29,7 @@
29
29
  * http://localhost:3001/tools (list all tools)
30
30
  *
31
31
  * @module bin/mcp-server
32
- * @version 4.0.0
32
+ * @version 4.0.6
33
33
  */
34
34
  export {};
35
35
  //# sourceMappingURL=mcp-server.d.ts.map
@@ -30,7 +30,7 @@
30
30
  * http://localhost:3001/tools (list all tools)
31
31
  *
32
32
  * @module bin/mcp-server
33
- * @version 4.0.0
33
+ * @version 4.0.6
34
34
  */
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const index_1 = require("../index");
@@ -102,7 +102,7 @@ function parseArgs(argv) {
102
102
  }
103
103
  function printHelp() {
104
104
  console.log(`
105
- network-ai-server — Network-AI MCP Server v4.0.0
105
+ network-ai-server — Network-AI MCP Server v4.0.6
106
106
 
107
107
  Usage: npx ts-node bin/mcp-server.ts [options]
108
108
 
@@ -135,7 +135,7 @@ async function main() {
135
135
  printHelp();
136
136
  process.exit(0);
137
137
  }
138
- console.log(`\n[network-ai-server] Starting MCP Server v4.0.0`);
138
+ console.log(`\n[network-ai-server] Starting MCP Server v4.0.6`);
139
139
  console.log(`[network-ai-server] Board: ${args.board} | Port: ${args.port}`);
140
140
  // --------------------------------------------------------------------------
141
141
  // 1. Create orchestrator + blackboard
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "network-ai",
3
- "version": "4.0.4",
3
+ "version": "4.0.6",
4
4
  "description": "AI agent orchestration framework for TypeScript/Node.js - plug-and-play multi-agent coordination with 12 frameworks (LangChain, AutoGen, CrewAI, OpenAI Assistants, LlamaIndex, Semantic Kernel, Haystack, DSPy, Agno, MCP, OpenClaw). Built-in security, swarm intelligence, and agentic workflow patterns.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -29,6 +29,7 @@
29
29
  "setup": "npx ts-node setup.ts",
30
30
  "setup:check": "npx ts-node setup.ts --check",
31
31
  "setup:example": "npx ts-node setup.ts --example",
32
+ "demo": "npx ts-node examples/demo-runner.ts",
32
33
  "blackboard": "python scripts/blackboard.py",
33
34
  "check-permission": "python scripts/check_permission.py",
34
35
  "validate-token": "python scripts/validate_token.py",
@@ -82,6 +83,7 @@
82
83
  },
83
84
  "devDependencies": {
84
85
  "@types/node": "^25.3.0",
86
+ "dotenv": "^17.3.1",
85
87
  "openai": "^6.23.0",
86
88
  "ts-node": "^10.9.2",
87
89
  "typescript": "^5.9.3"
@@ -94,6 +96,7 @@
94
96
  "README.md",
95
97
  "QUICKSTART.md",
96
98
  "SKILL.md",
97
- "LICENSE"
99
+ "LICENSE",
100
+ "socket.json"
98
101
  ]
99
102
  }
package/socket.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "version": 2,
3
+ "ignore": {
4
+ "evalDynamicCodeExecution": [
5
+ {
6
+ "path": "dist/lib/blackboard-validator.js",
7
+ "reason": "False positive — this is a security detection pattern that scans for eval() usage in untrusted agent code. It is not dynamic code execution."
8
+ }
9
+ ],
10
+ "networkAccess": [
11
+ {
12
+ "path": "dist/adapters/custom-adapter.js",
13
+ "reason": "Intentional — CustomAdapter is a user-configured HTTP adapter that calls a user-supplied URL (config.url) to connect to external AI endpoints. Network access is the explicit purpose of this adapter."
14
+ },
15
+ {
16
+ "path": "dist/lib/mcp-transport-sse.ts",
17
+ "reason": "Intentional — McpSseTransport is an HTTP/SSE transport layer for the MCP protocol. Both the server (createServer) and client (http.request) directions are the explicit purpose of this module."
18
+ },
19
+ {
20
+ "path": "dist/lib/mcp-transport-sse.js",
21
+ "reason": "Intentional — McpSseTransport is an HTTP/SSE transport layer for the MCP protocol. Both the server (createServer) and client (http.request) directions are the explicit purpose of this module."
22
+ },
23
+ {
24
+ "path": "dist/bin/mcp-server.js",
25
+ "reason": "Intentional — network-ai-server is an opt-in CLI binary that starts an HTTP/SSE server to expose the Network-AI tool suite over MCP. Users invoke it explicitly; it is not a background side-effect."
26
+ }
27
+ ]
28
+ }
29
+ }