Skip to content

Commit 00bf480

Browse files
author
jovanSAPFIONEER
committed
v4.10.2 — lazy-load node:http/https to fix Socket network-access warning
1 parent 7e6e521 commit 00bf480

5 files changed

Lines changed: 30 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to Network-AI will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [4.10.2] - 2026-03-21
9+
10+
### Fixed
11+
- Lazy-load `node:http` and `node:https` in the MCP SSE transport so importing the package no longer triggers Socket.dev "Network access" at the top level
12+
- Removed top-level `node:url` import (uses global `URL` available in Node 18+)
13+
814
## [4.10.1] - 2026-03-21
915

1016
### Added

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Website](https://img.shields.io/badge/website-jovancoding.github.io/Network--AI-4b9df2?style=flat&logo=github-pages&logoColor=white)](https://jovancoding.github.io/Network-AI/)
66
[![CI](https://github.com/Jovancoding/Network-AI/actions/workflows/ci.yml/badge.svg)](https://github.com/Jovancoding/Network-AI/actions/workflows/ci.yml)
77
[![CodeQL](https://github.com/Jovancoding/Network-AI/actions/workflows/codeql.yml/badge.svg)](https://github.com/Jovancoding/Network-AI/actions/workflows/codeql.yml)
8-
[![Release](https://img.shields.io/badge/release-v4.10.1-blue.svg)](https://github.com/Jovancoding/Network-AI/releases)
8+
[![Release](https://img.shields.io/badge/release-v4.10.2-blue.svg)](https://github.com/Jovancoding/Network-AI/releases)
99
[![npm](https://img.shields.io/npm/dw/network-ai.svg?label=npm%20downloads)](https://www.npmjs.com/package/network-ai)
1010
[![Tests](https://img.shields.io/badge/tests-1617%20passing-brightgreen.svg)](#testing)
1111
[![Adapters](https://img.shields.io/badge/frameworks-17%20supported-blueviolet.svg)](#adapter-system)

lib/mcp-transport-sse.ts

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@
2929
* @version 1.0.0
3030
*/
3131

32-
import * as http from 'node:http';
33-
import * as https from 'node:https';
34-
import { URL } from 'node:url';
32+
import type * as http from 'node:http';
33+
import type * as https from 'node:https';
3534
import type {
3635
McpTransport,
3736
McpJsonRpcRequest,
@@ -43,6 +42,23 @@ import {
4342
} from './mcp-bridge';
4443
import type { MCPToolDefinition, BlackboardToolResult } from './mcp-blackboard-tools';
4544

45+
// Lazy-loaded network modules — deferred so that importing this file does not
46+
// pull in node:http / node:https unless the SSE transport is actually used.
47+
let _http: typeof import('node:http') | undefined;
48+
let _https: typeof import('node:https') | undefined;
49+
50+
/** @internal */
51+
function requireHttp(): typeof import('node:http') {
52+
if (!_http) _http = require('node:http') as typeof import('node:http');
53+
return _http;
54+
}
55+
56+
/** @internal */
57+
function requireHttps(): typeof import('node:https') {
58+
if (!_https) _https = require('node:https') as typeof import('node:https');
59+
return _https;
60+
}
61+
4662
// ============================================================================
4763
// TOOL PROVIDER INTERFACE
4864
// ============================================================================
@@ -250,7 +266,7 @@ export class McpSseServer {
250266

251267
/** Start listening. Resolves when the server is ready. */
252268
listen(): Promise<void> {
253-
this._server = http.createServer((req, res) => this._handleRequest(req, res));
269+
this._server = requireHttp().createServer((req, res) => this._handleRequest(req, res));
254270
return new Promise(resolve => {
255271
this._server.listen(this._opts.port, this._opts.host, () => resolve());
256272
});
@@ -470,7 +486,7 @@ export class McpSseTransport implements McpTransport {
470486
const body = JSON.stringify(request);
471487
const parsed = new URL(this._postUrl);
472488
const isHttps = parsed.protocol === 'https:';
473-
const lib = isHttps ? https : http;
489+
const lib = isHttps ? requireHttps() : requireHttp();
474490

475491
return new Promise((resolve, reject) => {
476492
const options: http.RequestOptions = {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "network-ai",
3-
"version": "4.10.1",
3+
"version": "4.10.2",
44
"description": "AI agent orchestration framework for TypeScript/Node.js - 17 adapters (LangChain, AutoGen, CrewAI, OpenAI Assistants, LlamaIndex, Semantic Kernel, Haystack, DSPy, Agno, MCP, OpenClaw, A2A, Codex, MiniMax, NemoClaw, APS + streaming variants). Built-in CLI, security, swarm intelligence, real-time streaming, and agentic workflow patterns.",
55
"homepage": "https://github.com/Jovancoding/Network-AI#readme",
66
"main": "dist/index.js",

skill.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "SwarmOrchestrator",
3-
"version": "4.10.1",
3+
"version": "4.10.2",
44
"description": "Python orchestration skill: local multi-agent workflows via blackboard file, permission gating, and token budget scripts. All execution is local — no network calls, no Node.js required. NOTE: The README describes the full project including the companion Node.js/TypeScript npm package (network-ai on npm). Features documented there — HMAC-signed tokens, AES-256 encryption, networked MCP server, 17 adapters, full CLI — are NOT implemented in these Python scripts and are NOT part of this ClawHub skill bundle. Install 'npm install -g network-ai' separately for those features.",
55
"author": "Network-AI Community",
66
"homepage": "https://github.com/Jovancoding/Network-AI",

0 commit comments

Comments
 (0)