network-ai 4.3.0 → 4.3.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.
@@ -457,6 +457,7 @@ Run these before declaring the integration production-ready:
457
457
  | Document | What It Covers |
458
458
  |----------|---------------|
459
459
  | [QUICKSTART.md](QUICKSTART.md) | Get running in 5 minutes |
460
+ | [QUICKSTART.md § CLI](QUICKSTART.md) | CLI reference — bb, auth, budget, audit commands |
460
461
  | [references/adapter-system.md](references/adapter-system.md) | All 12 adapters with code examples |
461
462
  | [references/trust-levels.md](references/trust-levels.md) | Trust scoring formula and agent roles |
462
463
  | [references/auth-guardian.md](references/auth-guardian.md) | Permission system, justification scoring, token lifecycle |
package/QUICKSTART.md CHANGED
@@ -215,7 +215,8 @@ export class MyFrameworkAdapter extends BaseAdapter {
215
215
  ```bash
216
216
  npx ts-node test-standalone.ts # 79 core tests
217
217
  npx ts-node test-security.ts # 33 security tests
218
- npx ts-node test-adapters.ts # 100+ adapter tests (all 12 frameworks)
218
+ npx ts-node test-adapters.ts # 100+ adapter tests (all 14 frameworks)
219
+ npx ts-node test-cli.ts # 65 CLI tests
219
220
  ```
220
221
 
221
222
  ---
@@ -230,6 +231,95 @@ npx ts-node setup.ts --example # Generate example.ts
230
231
 
231
232
  ---
232
233
 
234
+ ## 10. CLI
235
+
236
+ Control Network-AI directly from the terminal — no server or running process required.
237
+ The CLI imports the same `LockedBlackboard`, `AuthGuardian`, and `FederatedBudget` core used everywhere else.
238
+
239
+ ### Install (global)
240
+
241
+ ```bash
242
+ npm install -g network-ai
243
+ network-ai --help
244
+ ```
245
+
246
+ Or run from source without installing:
247
+
248
+ ```bash
249
+ npx ts-node bin/cli.ts --help
250
+ ```
251
+
252
+ ### Blackboard (`bb`)
253
+
254
+ ```bash
255
+ # Write / read / delete
256
+ network-ai bb set agent:status running --agent orchestrator
257
+ network-ai bb get agent:status
258
+ network-ai bb delete agent:status
259
+
260
+ # List all keys
261
+ network-ai bb list
262
+
263
+ # Snapshot (pretty-print full state)
264
+ network-ai bb snapshot
265
+
266
+ # Atomic propose → commit workflow
267
+ network-ai bb propose agent:status complete --agent orchestrator # prints changeId
268
+ network-ai bb commit <changeId>
269
+ network-ai bb abort <changeId>
270
+ ```
271
+
272
+ ### Auth (`auth`)
273
+
274
+ ```bash
275
+ # Issue a permission token
276
+ network-ai auth token my-bot --resource DATABASE --action read \
277
+ --justification "Need Q4 invoices for report"
278
+
279
+ # Validate a token
280
+ network-ai auth check grant_a1b2c3...
281
+
282
+ # Revoke a token
283
+ network-ai auth revoke grant_a1b2c3...
284
+ ```
285
+
286
+ ### Budget (`budget`)
287
+
288
+ ```bash
289
+ # View current spend across all agents
290
+ network-ai budget status
291
+
292
+ # Set a new ceiling
293
+ network-ai budget set-ceiling 50000
294
+ ```
295
+
296
+ ### Audit (`audit`)
297
+
298
+ ```bash
299
+ # Print recent entries (last 50 by default)
300
+ network-ai audit log --limit 50
301
+
302
+ # Live-stream new entries as they arrive
303
+ network-ai audit tail
304
+
305
+ # Clear the log (irreversible)
306
+ network-ai audit clear
307
+ ```
308
+
309
+ ### Global flags
310
+
311
+ | Flag | Default | Purpose |
312
+ |---|---|---|
313
+ | `--data <path>` | `./data` | Override the data directory |
314
+ | `--json` | off | Machine-readable JSON output on every command |
315
+
316
+ ```bash
317
+ # Example: point at a non-default data dir and get JSON output
318
+ network-ai --data /var/swarm/data --json bb list
319
+ ```
320
+
321
+ ---
322
+
233
323
  ## Architecture
234
324
 
235
325
  ```
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.3.0-blue.svg)](https://github.com/jovanSAPFIONEER/Network-AI/releases)
7
+ [![Release](https://img.shields.io/badge/release-v4.3.2-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
  [![Tests](https://img.shields.io/badge/tests-1399%20passing-brightgreen.svg)](#testing)
10
10
  [![Adapters](https://img.shields.io/badge/frameworks-14%20supported-blueviolet.svg)](#adapter-system)
@@ -31,6 +31,7 @@ Network-AI is a TypeScript/Node.js multi-agent orchestrator that adds coordinati
31
31
  **Use Network-AI as:**
32
32
  - A **TypeScript/Node.js library** — `import { createSwarmOrchestrator } from 'network-ai'`
33
33
  - An **MCP server** — `npx network-ai-server --port 3001`
34
+ - A **CLI** — `network-ai bb get status` / `network-ai audit tail`
34
35
  - An **OpenClaw skill** — `clawhub install network-ai`
35
36
 
36
37
  [**5-minute quickstart →**](QUICKSTART.md) &nbsp;|&nbsp; [**Architecture →**](ARCHITECTURE.md) &nbsp;|&nbsp; [**All adapters →**](#adapter-system) &nbsp;|&nbsp; [**Benchmarks →**](BENCHMARKS.md)
@@ -164,6 +165,35 @@ Options: `--no-budget`, `--no-token`, `--no-control`, `--ceiling <n>`, `--board
164
165
 
165
166
  ---
166
167
 
168
+ ## CLI
169
+
170
+ Control Network-AI directly from the terminal — no server required. The CLI imports the same core engine used by the MCP server.
171
+
172
+ ```bash
173
+ # One-off commands (no server needed)
174
+ npx ts-node bin/cli.ts bb set status running --agent cli
175
+ npx ts-node bin/cli.ts bb get status
176
+ npx ts-node bin/cli.ts bb snapshot
177
+
178
+ # After npm install -g network-ai:
179
+ network-ai bb list
180
+ network-ai audit tail # live-stream the audit log
181
+ network-ai auth token my-bot --resource blackboard
182
+ ```
183
+
184
+ | Command group | What it controls |
185
+ |---|---|
186
+ | `network-ai bb` | Blackboard — get, set, delete, list, snapshot, propose, commit, abort |
187
+ | `network-ai auth` | AuthGuardian — issue tokens, revoke, check permissions |
188
+ | `network-ai budget` | FederatedBudget — spend status, set ceiling |
189
+ | `network-ai audit` | Audit log — print, live-tail, clear |
190
+
191
+ Global flags on every command: `--data <path>` (data directory, default `./data`) · `--json` (machine-readable output)
192
+
193
+ → Full reference in [QUICKSTART.md § CLI](QUICKSTART.md)
194
+
195
+ ---
196
+
167
197
  ## Two agents, one shared state — without race conditions
168
198
 
169
199
  The real differentiator is coordination. Here is what no single-framework solution handles: two agents writing to the same resource concurrently, atomically, without corrupting each other.
@@ -288,9 +318,10 @@ npm run test:streaming # Streaming adapters
288
318
  npm run test:a2a # A2A protocol adapter
289
319
  npm run test:codex # Codex adapter
290
320
  npm run test:priority # Priority & preemption
321
+ npm run test:cli # CLI layer
291
322
  ```
292
323
 
293
- **1,334 passing assertions across 16 test suites** (`npm run test:all`):
324
+ **1,399 passing assertions across 17 test suites** (`npm run test:all`):
294
325
 
295
326
  | Suite | Assertions | Covers |
296
327
  |---|---|---|
@@ -310,6 +341,7 @@ npm run test:priority # Priority & preemption
310
341
  | `test-phase5b.ts` | 55 | Pluggable backend part 2, consistency levels |
311
342
  | `test-phase5.ts` | 42 | Named multi-blackboard base |
312
343
  | `test-security.ts` | 34 | Tokens, sanitization, rate limiting, encryption, audit |
344
+ | `test-cli.ts` | 65 | CLI layer: bb, auth, budget, audit commands |
313
345
 
314
346
  ---
315
347
 
@@ -317,7 +349,7 @@ npm run test:priority # Priority & preemption
317
349
 
318
350
  | Doc | Contents |
319
351
  |---|---|
320
- | [QUICKSTART.md](QUICKSTART.md) | Installation, first run, PowerShell guide, Python scripts CLI |
352
+ | [QUICKSTART.md](QUICKSTART.md) | Installation, first run, CLI reference, PowerShell guide, Python scripts CLI |
321
353
  | [ARCHITECTURE.md](ARCHITECTURE.md) | Race condition problem, FSM design, handoff protocol, project structure |
322
354
  | [BENCHMARKS.md](BENCHMARKS.md) | Provider performance, rate limits, local GPU, `max_completion_tokens` guide |
323
355
  | [SECURITY.md](SECURITY.md) | Security module, permission system, trust levels, audit trail |
package/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: Network-AI
3
- description: Multi-agent swarm orchestration for complex workflows. Coordinates multiple agents, decomposes tasks, manages shared state via a local blackboard file, and enforces permission walls before sensitive operations. All execution is local and sandboxed.
3
+ description: Multi-agent swarm orchestration for complex workflows. Coordinates multiple agents, decomposes tasks, manages shared state via a local blackboard file, and enforces permission walls before sensitive operations. Includes a full CLI (network-ai bb/auth/budget/audit) for terminal-based control. All execution is local and sandboxed.
4
4
  metadata:
5
5
  openclaw:
6
6
  emoji: "\U0001F41D"
@@ -211,6 +211,34 @@ python {baseDir}/scripts/blackboard.py read "task:q4_analysis"
211
211
  python {baseDir}/scripts/blackboard.py list
212
212
  ```
213
213
 
214
+ ### 5. Use the Node.js CLI (optional — requires `npm install -g network-ai`)
215
+
216
+ The CLI gives direct terminal access to all four subsystems without running a server:
217
+
218
+ ```bash
219
+ # Blackboard
220
+ network-ai bb get task:q4_analysis
221
+ network-ai bb set task:q4_analysis '{"status": "complete"}' --agent orchestrator
222
+ network-ai bb list
223
+ network-ai bb snapshot
224
+
225
+ # Permissions
226
+ network-ai auth token data_analyst --resource DATABASE --action read \
227
+ --justification "Need Q4 invoices for revenue report"
228
+ network-ai auth check grant_a1b2c3...
229
+ network-ai auth revoke grant_a1b2c3...
230
+
231
+ # Budget
232
+ network-ai budget status
233
+ network-ai budget set-ceiling 50000
234
+
235
+ # Audit log
236
+ network-ai audit log --limit 50
237
+ network-ai audit tail # live-stream as events arrive
238
+ ```
239
+
240
+ Global flags: `--data <path>` (override data directory) · `--json` (machine-readable output)
241
+
214
242
  ## Agent-to-Agent Handoff Protocol
215
243
 
216
244
  When delegating tasks between agents/sessions:
@@ -597,3 +625,4 @@ python {baseDir}/scripts/swarm_guard.py supervisor-review --task-id "task_001"
597
625
  - [AuthGuardian Details](references/auth-guardian.md) - Full permission system documentation
598
626
  - [Blackboard Schema](references/blackboard-schema.md) - Data structure specifications
599
627
  - [Agent Trust Levels](references/trust-levels.md) - How trust is calculated
628
+ - [CLI Reference](QUICKSTART.md) - Full `network-ai` CLI command reference (§ 10. CLI)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "network-ai",
3
- "version": "4.3.0",
3
+ "version": "4.3.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",