network-ai 4.4.0 → 4.4.2
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/SKILL.md +61 -40
- package/package.json +1 -1
- package/scripts/blackboard.py +7 -0
- package/scripts/check_permission.py +6 -0
- package/scripts/revoke_token.py +6 -0
- package/scripts/swarm_guard.py +6 -0
- package/scripts/validate_token.py +6 -0
package/SKILL.md
CHANGED
|
@@ -6,11 +6,12 @@ metadata:
|
|
|
6
6
|
emoji: "\U0001F41D"
|
|
7
7
|
homepage: https://github.com/jovanSAPFIONEER/Network-AI
|
|
8
8
|
bundle_scope: "Python scripts only (scripts/*.py). The README.md in this repo describes the FULL project including the companion Node.js npm package — features documented there (HMAC tokens, AES-256 encryption, MCP server, 14 adapters, CLI) are NOT implemented in these Python scripts and are NOT part of this ClawHub skill. Install the npm package separately for those features."
|
|
9
|
+
network_calls: none
|
|
10
|
+
sessions_ops: "platform-provided — sessions_send, sessions_list, and sessions_history are OpenClaw host platform built-ins, not implemented or invoked by this skill's Python scripts"
|
|
9
11
|
requires:
|
|
10
12
|
bins:
|
|
11
13
|
- python3
|
|
12
|
-
optional_bins:
|
|
13
|
-
- node # Only needed if you separately install and run the Node.js MCP server (network-ai-server via npm). Not required for this skill's Python instructions.
|
|
14
|
+
optional_bins: [] # No optional binaries required. Node.js is only needed for the SEPARATE companion npm package (not part of this skill).
|
|
14
15
|
env:
|
|
15
16
|
SWARM_TOKEN_SECRET:
|
|
16
17
|
required: false
|
|
@@ -168,17 +169,26 @@ python {baseDir}/scripts/swarm_guard.py budget-init \
|
|
|
168
169
|
|
|
169
170
|
### 2. Delegate a Task to Another Session
|
|
170
171
|
|
|
171
|
-
|
|
172
|
+
> **Platform note:** `sessions_list`, `sessions_send`, and `sessions_history` are **OpenClaw host platform built-ins** — they are part of the OpenClaw runtime, not provided or invoked by this skill's Python scripts. This skill only runs local `python scripts/*.py` commands. The guidance below describes how to combine the platform's session tools with this skill's budget guard.
|
|
172
173
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
First check budget, then use the OpenClaw platform operation:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# 1. Check budget (this skill's Python script)
|
|
178
|
+
python {baseDir}/scripts/swarm_guard.py intercept-handoff \
|
|
179
|
+
--task-id "task_001" --from orchestrator --to data_analyst \
|
|
180
|
+
--message "Analyze Q4 revenue data"
|
|
181
|
+
|
|
182
|
+
# 2. If allowed, delegate using the OpenClaw platform tool (not this skill):
|
|
183
|
+
# sessions_list → see available sessions/agents
|
|
184
|
+
# sessions_send → send task to another session
|
|
185
|
+
# sessions_history → check results from delegated work
|
|
177
186
|
```
|
|
178
187
|
|
|
179
188
|
**Example delegation prompt:**
|
|
180
189
|
```
|
|
181
|
-
|
|
190
|
+
After running swarm_guard.py intercept-handoff and getting result.allowed == true,
|
|
191
|
+
use the OpenClaw sessions_send platform tool to ask the data_analyst session:
|
|
182
192
|
"Analyze Q4 revenue trends from the SAP export data and summarize key insights"
|
|
183
193
|
```
|
|
184
194
|
|
|
@@ -212,33 +222,9 @@ python {baseDir}/scripts/blackboard.py read "task:q4_analysis"
|
|
|
212
222
|
python {baseDir}/scripts/blackboard.py list
|
|
213
223
|
```
|
|
214
224
|
|
|
215
|
-
### 5. Use the Node.js CLI
|
|
216
|
-
|
|
217
|
-
The CLI gives direct terminal access to all four subsystems without running a server:
|
|
225
|
+
### 5. Optional: Use the Node.js CLI
|
|
218
226
|
|
|
219
|
-
|
|
220
|
-
# Blackboard
|
|
221
|
-
network-ai bb get task:q4_analysis
|
|
222
|
-
network-ai bb set task:q4_analysis '{"status": "complete"}' --agent orchestrator
|
|
223
|
-
network-ai bb list
|
|
224
|
-
network-ai bb snapshot
|
|
225
|
-
|
|
226
|
-
# Permissions
|
|
227
|
-
network-ai auth token data_analyst --resource DATABASE --action read \
|
|
228
|
-
--justification "Need Q4 invoices for revenue report"
|
|
229
|
-
network-ai auth check grant_a1b2c3...
|
|
230
|
-
network-ai auth revoke grant_a1b2c3...
|
|
231
|
-
|
|
232
|
-
# Budget
|
|
233
|
-
network-ai budget status
|
|
234
|
-
network-ai budget set-ceiling 50000
|
|
235
|
-
|
|
236
|
-
# Audit log
|
|
237
|
-
network-ai audit log --limit 50
|
|
238
|
-
network-ai audit tail # live-stream as events arrive
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
Global flags: `--data <path>` (override data directory) · `--json` (machine-readable output)
|
|
227
|
+
> **Scope note:** The `network-ai` CLI is part of the **companion npm package** — it is a completely separate project and is NOT part of this ClawHub skill bundle. This skill's Python scripts work fully without it. See the [Appendix](#appendix-optional-nodejs-companion-npm) at the bottom of this file for details.
|
|
242
228
|
|
|
243
229
|
## Agent-to-Agent Handoff Protocol
|
|
244
230
|
|
|
@@ -254,8 +240,11 @@ python {baseDir}/scripts/swarm_guard.py budget-check --task-id "task_001"
|
|
|
254
240
|
```
|
|
255
241
|
|
|
256
242
|
### Step 2: Identify Target Agent
|
|
243
|
+
|
|
244
|
+
> **Platform note:** `sessions_list` is an **OpenClaw host platform built-in**, not provided by this skill.
|
|
245
|
+
|
|
257
246
|
```
|
|
258
|
-
sessions_list #
|
|
247
|
+
sessions_list # OpenClaw platform operation — find available agents
|
|
259
248
|
```
|
|
260
249
|
|
|
261
250
|
Common agent types:
|
|
@@ -289,9 +278,12 @@ Include these fields in your delegation:
|
|
|
289
278
|
- **constraints**: Any limitations or requirements
|
|
290
279
|
- **expectedOutput**: What format/content you need back
|
|
291
280
|
|
|
292
|
-
### Step 5: Send via
|
|
281
|
+
### Step 5: Send via OpenClaw Platform Session Tool
|
|
282
|
+
|
|
283
|
+
> **Platform note:** `sessions_send` is an **OpenClaw host platform built-in** — it is NOT implemented by this skill. This skill only provides the budget guard (`swarm_guard.py`) that must be run first.
|
|
293
284
|
|
|
294
285
|
```
|
|
286
|
+
# OpenClaw platform operation (not this skill):
|
|
295
287
|
sessions_send to data_analyst:
|
|
296
288
|
"[HANDOFF]
|
|
297
289
|
Instruction: Analyze Q4 revenue by product category
|
|
@@ -301,10 +293,12 @@ Expected Output: JSON summary with category, revenue, growth_pct
|
|
|
301
293
|
[/HANDOFF]"
|
|
302
294
|
```
|
|
303
295
|
|
|
304
|
-
### Step
|
|
296
|
+
### Step 6: Check Results
|
|
297
|
+
|
|
298
|
+
> **Platform note:** `sessions_history` is an **OpenClaw host platform built-in**, not provided by this skill.
|
|
305
299
|
|
|
306
300
|
```
|
|
307
|
-
sessions_history data_analyst #
|
|
301
|
+
sessions_history data_analyst # OpenClaw platform operation — get the response
|
|
308
302
|
```
|
|
309
303
|
|
|
310
304
|
## Permission Wall (AuthGuardian)
|
|
@@ -409,9 +403,14 @@ Sequential processing - output of one feeds into next.
|
|
|
409
403
|
|
|
410
404
|
### Example Parallel Workflow
|
|
411
405
|
|
|
406
|
+
> **Platform note:** `sessions_send` and `sessions_history` are **OpenClaw host platform built-ins**, not provided by this skill. This skill provides only the `swarm_guard.py` budget/handoff check that runs before each delegation.
|
|
407
|
+
|
|
412
408
|
```
|
|
409
|
+
# For each delegation below, first run:
|
|
410
|
+
# python {baseDir}/scripts/swarm_guard.py intercept-handoff --task-id "task_001" --from orchestrator --to <agent> --message "<task>"
|
|
411
|
+
# Then, if allowed, use the OpenClaw platform tool:
|
|
413
412
|
1. sessions_send to data_analyst: "Extract key metrics from Q4 data"
|
|
414
|
-
2. sessions_send to risk_assessor: "Identify compliance risks in Q4 data"
|
|
413
|
+
2. sessions_send to risk_assessor: "Identify compliance risks in Q4 data"
|
|
415
414
|
3. sessions_send to strategy_advisor: "Recommend actions based on Q4 trends"
|
|
416
415
|
4. Wait for all responses via sessions_history
|
|
417
416
|
5. Synthesize: Combine metrics + risks + recommendations into executive summary
|
|
@@ -618,7 +617,7 @@ python {baseDir}/scripts/swarm_guard.py supervisor-review --task-id "task_001"
|
|
|
618
617
|
- Entry was never written
|
|
619
618
|
|
|
620
619
|
### Session Not Found
|
|
621
|
-
- Run `sessions_list` to see available sessions
|
|
620
|
+
- Run `sessions_list` (OpenClaw platform built-in) to see available sessions
|
|
622
621
|
- Session may need to be started first
|
|
623
622
|
|
|
624
623
|
## References
|
|
@@ -627,3 +626,25 @@ python {baseDir}/scripts/swarm_guard.py supervisor-review --task-id "task_001"
|
|
|
627
626
|
- [Blackboard Schema](references/blackboard-schema.md) - Data structure specifications
|
|
628
627
|
- [Agent Trust Levels](references/trust-levels.md) - How trust is calculated
|
|
629
628
|
- [CLI Reference](QUICKSTART.md) - Full `network-ai` CLI command reference (§ 10. CLI)
|
|
629
|
+
|
|
630
|
+
---
|
|
631
|
+
|
|
632
|
+
## Appendix: Optional Node.js Companion (npm)
|
|
633
|
+
|
|
634
|
+
> **This section describes a SEPARATE project — not part of this ClawHub skill bundle.**
|
|
635
|
+
> The Python scripts above work completely without any of this.
|
|
636
|
+
> Install only if you want MCP server integration with Claude/Cursor/VS Code.
|
|
637
|
+
|
|
638
|
+
```bash
|
|
639
|
+
npm install -g network-ai
|
|
640
|
+
npx network-ai-server --port 3001
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
The companion npm package (`network-ai`) provides:
|
|
644
|
+
- HMAC-signed audit tokens (vs UUID tokens in the Python layer)
|
|
645
|
+
- AES-256 blackboard encryption
|
|
646
|
+
- A standalone MCP server for IDE integration (Claude, Cursor, VS Code)
|
|
647
|
+
- 14 framework adapters (LangChain, AutoGen, CrewAI, DSPy, LlamaIndex, etc.)
|
|
648
|
+
- A full CLI (`network-ai bb`, `network-ai auth`, `network-ai budget`, `network-ai audit`)
|
|
649
|
+
|
|
650
|
+
None of the above are provided by this skill's Python scripts. No network calls are made by this skill.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "network-ai",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.2",
|
|
4
4
|
"description": "AI agent orchestration framework for TypeScript/Node.js - 14 adapters (LangChain, AutoGen, CrewAI, OpenAI Assistants, LlamaIndex, Semantic Kernel, Haystack, DSPy, Agno, MCP, OpenClaw, A2A, Codex + streaming variants). Built-in CLI, security, swarm intelligence, real-time streaming, and agentic workflow patterns.",
|
|
5
5
|
"homepage": "https://github.com/jovanSAPFIONEER/Network-AI#readme",
|
|
6
6
|
"main": "dist/index.js",
|
package/scripts/blackboard.py
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
+
# SECURITY: This script makes NO network calls and spawns NO subprocesses.
|
|
3
|
+
# All I/O is local file operations only:
|
|
4
|
+
# READS: swarm-blackboard.md, data/pending_changes/<id>.json
|
|
5
|
+
# WRITES: swarm-blackboard.md, data/pending_changes/<id>.json
|
|
6
|
+
# Imports used: argparse, json, os, re, sys, time, hashlib, datetime, pathlib,
|
|
7
|
+
# typing, contextlib, fcntl (Unix file-lock only, no network use)
|
|
8
|
+
# No imports of: requests, socket, subprocess, urllib, http, ssl, ftplib, smtplib
|
|
2
9
|
"""
|
|
3
10
|
Shared Blackboard - Agent Coordination State Manager (Atomic Commit Edition)
|
|
4
11
|
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
+
# SECURITY: This script makes NO network calls and spawns NO subprocesses.
|
|
3
|
+
# All I/O is local file operations only:
|
|
4
|
+
# READS: data/active_grants.json, data/audit_log.jsonl
|
|
5
|
+
# WRITES: data/active_grants.json, data/audit_log.jsonl
|
|
6
|
+
# Imports used: argparse, json, re, sys, uuid, datetime, pathlib, typing
|
|
7
|
+
# No imports of: requests, socket, subprocess, urllib, http, ssl, ftplib, smtplib
|
|
2
8
|
"""
|
|
3
9
|
AuthGuardian Permission Checker
|
|
4
10
|
|
package/scripts/revoke_token.py
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
+
# SECURITY: This script makes NO network calls and spawns NO subprocesses.
|
|
3
|
+
# All I/O is local file operations only:
|
|
4
|
+
# READS: data/active_grants.json, data/audit_log.jsonl
|
|
5
|
+
# WRITES: data/active_grants.json, data/audit_log.jsonl
|
|
6
|
+
# Imports used: argparse, json, sys, datetime, pathlib, typing
|
|
7
|
+
# No imports of: requests, socket, subprocess, urllib, http, ssl, ftplib, smtplib
|
|
2
8
|
"""
|
|
3
9
|
Revoke Grant Token & TTL Enforcement
|
|
4
10
|
|
package/scripts/swarm_guard.py
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
+
# SECURITY: This script makes NO network calls and spawns NO subprocesses.
|
|
3
|
+
# All I/O is local file operations only:
|
|
4
|
+
# READS: data/swarm_budgets.json, data/heartbeats.json, data/audit_log.jsonl
|
|
5
|
+
# WRITES: data/swarm_budgets.json, data/heartbeats.json, data/audit_log.jsonl
|
|
6
|
+
# Imports used: argparse, json, sys, datetime, pathlib, typing
|
|
7
|
+
# No imports of: requests, socket, subprocess, urllib, http, ssl, ftplib, smtplib
|
|
2
8
|
"""
|
|
3
9
|
Swarm Guard - Prevents Handoff Tax, Silent Failures, and Budget Overruns
|
|
4
10
|
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
+
# SECURITY: This script makes NO network calls and spawns NO subprocesses.
|
|
3
|
+
# All I/O is local file operations only:
|
|
4
|
+
# READS: data/active_grants.json
|
|
5
|
+
# WRITES: none
|
|
6
|
+
# Imports used: argparse, json, sys, datetime, pathlib, typing
|
|
7
|
+
# No imports of: requests, socket, subprocess, urllib, http, ssl, ftplib, smtplib
|
|
2
8
|
"""
|
|
3
9
|
Validate Grant Token
|
|
4
10
|
|