network-ai 4.9.0 → 4.10.0
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/INTEGRATION_GUIDE.md +3 -2
- package/QUICKSTART.md +9 -8
- package/README.md +71 -23
- package/SKILL.md +3 -3
- package/dist/adapters/aps-adapter.d.ts +129 -0
- package/dist/adapters/aps-adapter.d.ts.map +1 -0
- package/dist/adapters/aps-adapter.js +289 -0
- package/dist/adapters/aps-adapter.js.map +1 -0
- package/dist/adapters/index.d.ts +2 -0
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +4 -1
- package/dist/adapters/index.js.map +1 -1
- package/package.json +2 -2
package/INTEGRATION_GUIDE.md
CHANGED
|
@@ -64,7 +64,7 @@ Answers drive `AuthGuardian` configuration and audit log retention policy.
|
|
|
64
64
|
|
|
65
65
|
## 2. Framework Mapping
|
|
66
66
|
|
|
67
|
-
Network-AI ships
|
|
67
|
+
Network-AI ships 17 adapters. Map your existing agents to the right one:
|
|
68
68
|
|
|
69
69
|
| Your Stack | Network-AI Adapter | Notes |
|
|
70
70
|
|-----------|-------------------|-------|
|
|
@@ -83,6 +83,7 @@ Network-AI ships 16 adapters. Map your existing agents to the right one:
|
|
|
83
83
|
| OpenAI Codex CLI | `CodexAdapter` | Codex CLI task execution |
|
|
84
84
|
| MiniMax | `MiniMaxAdapter` | MiniMax chat completions (M2.5) |
|
|
85
85
|
| NVIDIA NemoClaw | `NemoClawAdapter` | Sandboxed agent execution via OpenShell |
|
|
86
|
+
| APS delegation chains | `APSAdapter` | Delegation-chain trust mapping for AuthGuardian |
|
|
86
87
|
| **Anything else** | `CustomAdapter` | Wrap any async function or HTTP endpoint |
|
|
87
88
|
|
|
88
89
|
### No matching framework?
|
|
@@ -463,7 +464,7 @@ Run these before declaring the integration production-ready:
|
|
|
463
464
|
|----------|---------------|
|
|
464
465
|
| [QUICKSTART.md](QUICKSTART.md) | Get running in 5 minutes |
|
|
465
466
|
| [QUICKSTART.md § CLI](QUICKSTART.md) | CLI reference — bb, auth, budget, audit commands |
|
|
466
|
-
| [references/adapter-system.md](references/adapter-system.md) | All
|
|
467
|
+
| [references/adapter-system.md](references/adapter-system.md) | All 17 adapters with code examples |
|
|
467
468
|
| [references/trust-levels.md](references/trust-levels.md) | Trust scoring formula and agent roles |
|
|
468
469
|
| [references/auth-guardian.md](references/auth-guardian.md) | Permission system, justification scoring, token lifecycle |
|
|
469
470
|
| [references/blackboard-schema.md](references/blackboard-schema.md) | Blackboard key conventions and namespacing |
|
package/QUICKSTART.md
CHANGED
|
@@ -18,7 +18,7 @@ npm install
|
|
|
18
18
|
npx ts-node setup.ts --check
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
**Zero external AI dependencies.** All
|
|
21
|
+
**Zero external AI dependencies.** All 17 adapters are self-contained — add framework SDKs only when you need them.
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
@@ -42,7 +42,7 @@ npx ts-node setup.ts --check
|
|
|
42
42
|
| `a2a` | A2A | none | Agent-to-Agent protocol |
|
|
43
43
|
| `codex` | Codex | `openai` | OpenAI Codex CLI |
|
|
44
44
|
| `minimax` | MiniMax | none | MiniMax chat completions |
|
|
45
|
-
| `nemoclaw` | NemoClaw | none | NVIDIA sandboxed agent execution |
|
|
45
|
+
| `nemoclaw` | NemoClaw | none | NVIDIA sandboxed agent execution |\n| `aps` | APS | none | Delegation-chain trust mapping |
|
|
46
46
|
|
|
47
47
|
---
|
|
48
48
|
|
|
@@ -218,9 +218,9 @@ export class MyFrameworkAdapter extends BaseAdapter {
|
|
|
218
218
|
## 8. Run Tests
|
|
219
219
|
|
|
220
220
|
```bash
|
|
221
|
-
npx ts-node test-standalone.ts #
|
|
222
|
-
npx ts-node test-security.ts #
|
|
223
|
-
npx ts-node test-adapters.ts #
|
|
221
|
+
npx ts-node test-standalone.ts # 88 core tests
|
|
222
|
+
npx ts-node test-security.ts # 34 security tests
|
|
223
|
+
npx ts-node test-adapters.ts # 176 adapter tests (all 17 frameworks)
|
|
224
224
|
npx ts-node test-cli.ts # 65 CLI tests
|
|
225
225
|
```
|
|
226
226
|
|
|
@@ -230,7 +230,7 @@ npx ts-node test-cli.ts # 65 CLI tests
|
|
|
230
230
|
|
|
231
231
|
```bash
|
|
232
232
|
npx ts-node setup.ts --check # Verify installation
|
|
233
|
-
npx ts-node setup.ts --list # List all
|
|
233
|
+
npx ts-node setup.ts --list # List all 17 adapters
|
|
234
234
|
npx ts-node setup.ts --example # Generate example.ts
|
|
235
235
|
```
|
|
236
236
|
|
|
@@ -347,7 +347,8 @@ Your App
|
|
|
347
347
|
├── OpenAIAssistantsAdapter── OpenAI Assistants
|
|
348
348
|
├── HaystackAdapter ─── Haystack pipelines
|
|
349
349
|
├── DSPyAdapter ─── DSPy modules
|
|
350
|
-
|
|
350
|
+
├── AgnoAdapter ─── Agno agents/teams
|
|
351
|
+
└── APSAdapter ─── APS delegation-chain trust
|
|
351
352
|
```
|
|
352
353
|
|
|
353
354
|
---
|
|
@@ -568,7 +569,7 @@ import SwarmOrchestrator, {
|
|
|
568
569
|
// Factory
|
|
569
570
|
import { createSwarmOrchestrator } from 'network-ai';
|
|
570
571
|
|
|
571
|
-
// All
|
|
572
|
+
// All 17 adapters
|
|
572
573
|
import {
|
|
573
574
|
AdapterRegistry, BaseAdapter,
|
|
574
575
|
OpenClawAdapter, LangChainAdapter, AutoGenAdapter,
|
package/README.md
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
[](https://jovancoding.github.io/Network-AI/)
|
|
6
6
|
[](https://github.com/Jovancoding/Network-AI/actions/workflows/ci.yml)
|
|
7
7
|
[](https://github.com/Jovancoding/Network-AI/actions/workflows/codeql.yml)
|
|
8
|
-
[](https://github.com/Jovancoding/Network-AI/releases)
|
|
9
9
|
[](https://www.npmjs.com/package/network-ai)
|
|
10
|
-
[](#testing)
|
|
11
|
+
[](#adapter-system)
|
|
12
12
|
[](LICENSE)
|
|
13
13
|
[](https://socket.dev/npm/package/network-ai/overview)
|
|
14
14
|
[](https://nodejs.org)
|
|
@@ -18,11 +18,15 @@
|
|
|
18
18
|
[](https://discord.gg/Cab5vAxc86)
|
|
19
19
|
[](https://glama.ai/mcp/servers/Jovancoding/network-ai)
|
|
20
20
|
|
|
21
|
+
<p align="center">
|
|
22
|
+
<img src="assets/demo.svg" alt="Network-AI control-plane demo — atomic blackboard, priority preemption, AuthGuardian, FSM governance" width="720">
|
|
23
|
+
</p>
|
|
24
|
+
|
|
21
25
|
Network-AI is a TypeScript/Node.js multi-agent orchestrator that adds coordination, guardrails, and governance to any AI agent stack.
|
|
22
26
|
|
|
23
27
|
- **Shared blackboard with locking** — atomic `propose → validate → commit` prevents race conditions and split-brain failures across parallel agents
|
|
24
28
|
- **Guardrails and budgets** — FSM governance, per-agent token ceilings, HMAC / Ed25519 audit trails, and permission gating
|
|
25
|
-
- **
|
|
29
|
+
- **17 adapters** — LangChain (+ streaming), AutoGen, CrewAI, OpenAI Assistants, LlamaIndex, Semantic Kernel, Haystack, DSPy, Agno, MCP, Custom (+ streaming), OpenClaw, A2A, Codex, MiniMax, NemoClaw, and APS — no glue code, no lock-in
|
|
26
30
|
- **Persistent project memory (Layer 3)** — `context_manager.py` injects decisions, goals, stack, milestones, and banned patterns into every system prompt so agents always have full project context
|
|
27
31
|
|
|
28
32
|
> **The silent failure mode in multi-agent systems:** parallel agents writing to the same key
|
|
@@ -39,17 +43,54 @@ Network-AI is a TypeScript/Node.js multi-agent orchestrator that adds coordinati
|
|
|
39
43
|
|
|
40
44
|
[**5-minute quickstart →**](QUICKSTART.md) | [**Architecture →**](ARCHITECTURE.md) | [**All adapters →**](#adapter-system) | [**Benchmarks →**](BENCHMARKS.md)
|
|
41
45
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## ⚡ Try in 60 Seconds
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm install network-ai
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import { LockedBlackboard } from 'network-ai';
|
|
56
|
+
|
|
57
|
+
const board = new LockedBlackboard('.');
|
|
58
|
+
const id = board.propose('status', { ready: true }, 'agent-1');
|
|
59
|
+
board.validate(id, 'agent-1');
|
|
60
|
+
board.commit(id);
|
|
61
|
+
|
|
62
|
+
console.log(board.read('status')); // { ready: true }
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Two agents, atomic writes, no race conditions. That's it.
|
|
66
|
+
|
|
67
|
+
Want the full stress test? **No API key, ~3 seconds:**
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npx ts-node examples/08-control-plane-stress-demo.ts
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Runs priority preemption, AuthGuardian permission gating, FSM governance, and compliance monitoring — all without a single LLM call.
|
|
74
|
+
|
|
49
75
|
> If it saves you from a race condition, a ⭐ helps others find it.
|
|
50
76
|
|
|
51
77
|
---
|
|
52
78
|
|
|
79
|
+
## What's Included
|
|
80
|
+
|
|
81
|
+
| | |
|
|
82
|
+
|---|---|
|
|
83
|
+
| ✅ Atomic shared state | `propose → validate → commit` with filesystem mutex — no split-brain |
|
|
84
|
+
| ✅ Token budgets | Hard per-agent ceilings with live spend tracking |
|
|
85
|
+
| ✅ Permission gating | HMAC / Ed25519-signed tokens, scoped per agent and resource |
|
|
86
|
+
| ✅ Append-only audit log | Every write, grant, and transition signed and logged |
|
|
87
|
+
| ✅ 17 framework adapters | LangChain, CrewAI, AutoGen, MCP, Codex, APS, and 11 more — zero lock-in |
|
|
88
|
+
| ✅ FSM governance | Hard-stop agents at state boundaries, timeout enforcement |
|
|
89
|
+
| ✅ Compliance monitoring | Real-time violation detection (tool abuse, turn-taking, timeouts) |
|
|
90
|
+
| ✅ TypeScript native | ES2022 strict mode, zero native dependencies |
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
53
94
|
## Why teams use Network-AI
|
|
54
95
|
|
|
55
96
|
| Problem | How Network-AI solves it |
|
|
@@ -57,7 +98,7 @@ Network-AI is a TypeScript/Node.js multi-agent orchestrator that adds coordinati
|
|
|
57
98
|
| Race conditions in parallel agents | Atomic blackboard: `propose → validate → commit` with file-system mutex |
|
|
58
99
|
| Agent overspend / runaway costs | `FederatedBudget` — hard per-agent token ceilings with live spend tracking |
|
|
59
100
|
| No visibility into what agents did | HMAC / Ed25519-signed audit log on every write, permission grant, and FSM transition |
|
|
60
|
-
| Locked into one AI framework |
|
|
101
|
+
| Locked into one AI framework | 17 adapters — mix LangChain + AutoGen + CrewAI + Codex + MiniMax + NemoClaw + APS + custom in one swarm |
|
|
61
102
|
| Agents escalating beyond their scope | `AuthGuardian` — scoped permission tokens required before sensitive operations |
|
|
62
103
|
| Agents lack project context between runs | `ProjectContextManager` (Layer 3) — inject decisions, goals, stack, and milestones into every system prompt |
|
|
63
104
|
|
|
@@ -75,16 +116,12 @@ flowchart TD
|
|
|
75
116
|
classDef blackboard fill:#0c4a6e,stroke:#0284c7,color:#bae6fd
|
|
76
117
|
classDef adapters fill:#064e3b,stroke:#059669,color:#a7f3d0
|
|
77
118
|
classDef audit fill:#1e293b,stroke:#475569,color:#94a3b8
|
|
78
|
-
classDef context fill:#3b1f00,stroke:#b45309,color:#fef3c7
|
|
79
119
|
|
|
80
120
|
App["Your Application"]:::app
|
|
81
121
|
App -->|"createSwarmOrchestrator()"| SO
|
|
82
122
|
|
|
83
|
-
PC["ProjectContextManager\n(Layer 3 — persistent memory)\ngoals · stack · decisions\nmilestones · banned"]:::context
|
|
84
|
-
PC -->|"injected into system prompt"| SO
|
|
85
|
-
|
|
86
123
|
subgraph SO["SwarmOrchestrator"]
|
|
87
|
-
AG["AuthGuardian\n(permission
|
|
124
|
+
AG["AuthGuardian\n(HMAC / Ed25519 permission tokens)"]:::security
|
|
88
125
|
AR["AdapterRegistry\n(route tasks to frameworks)"]:::routing
|
|
89
126
|
QG["QualityGateAgent\n(validate blackboard writes)"]:::quality
|
|
90
127
|
BB["SharedBlackboard\n(shared agent state)\npropose → validate → commit\nfilesystem mutex"]:::blackboard
|
|
@@ -96,10 +133,12 @@ flowchart TD
|
|
|
96
133
|
QG -->|"validates"| BB
|
|
97
134
|
end
|
|
98
135
|
|
|
99
|
-
SO --> AUDIT["data/audit_log.jsonl"]:::audit
|
|
136
|
+
SO --> AUDIT["data/audit_log.jsonl\n(HMAC / Ed25519-signed)"]:::audit
|
|
100
137
|
```
|
|
101
138
|
|
|
102
139
|
> `FederatedBudget` is a standalone export — instantiate it separately and optionally wire it to a blackboard backend for cross-node token budget enforcement.
|
|
140
|
+
>
|
|
141
|
+
> `ProjectContextManager` is a Layer-3 Python helper (`scripts/context_manager.py`) that injects persistent project goals, decisions, and milestones into agent system prompts — see [ARCHITECTURE.md § Layer 3](ARCHITECTURE.md#layer-3--projectcontextmanager).
|
|
103
142
|
|
|
104
143
|
→ [Full architecture, FSM journey, and handoff protocol](ARCHITECTURE.md)
|
|
105
144
|
|
|
@@ -265,11 +304,19 @@ npm run demo -- --07
|
|
|
265
304
|
|
|
266
305
|
[](https://youtu.be/UyMsNhaw9lU)
|
|
267
306
|
|
|
307
|
+
**NemoClaw sandbox swarm** *(no API key)* — 3 agents in isolated NVIDIA NemoClaw sandboxes with deny-by-default network policies:
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
npx ts-node examples/10-nemoclaw-sandbox-swarm.ts
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
[](https://www.youtube.com/watch?v=c-UWDrdP4ZE)
|
|
314
|
+
|
|
268
315
|
---
|
|
269
316
|
|
|
270
317
|
## Adapter System
|
|
271
318
|
|
|
272
|
-
|
|
319
|
+
17 adapters, zero adapter dependencies. You bring your own SDK objects.
|
|
273
320
|
|
|
274
321
|
| Adapter | Framework / Protocol | Register method |
|
|
275
322
|
|---|---|---|
|
|
@@ -289,6 +336,7 @@ npm run demo -- --07
|
|
|
289
336
|
| `CodexAdapter` | OpenAI Codex / gpt-4o / Codex CLI | `registerCodexAgent(name, config)` |
|
|
290
337
|
| `MiniMaxAdapter` | MiniMax LLM API (M2.5 / M2.5-highspeed) | `registerAgent(name, config)` |
|
|
291
338
|
| `NemoClawAdapter` | NVIDIA NemoClaw (sandboxed agents via OpenShell) | `registerSandboxAgent(name, config)` |
|
|
339
|
+
| `APSAdapter` | Agent Permission Service (delegation-chain trust) | `apsDelegationToTrust(delegation)` |
|
|
292
340
|
|
|
293
341
|
**Streaming variants** (drop-in replacements with `.stream()` support):
|
|
294
342
|
|
|
@@ -307,7 +355,7 @@ Extend `BaseAdapter` (or `StreamingBaseAdapter` for streaming) to add your own i
|
|
|
307
355
|
|
|
308
356
|
| Capability | Network-AI | LangGraph | CrewAI | AutoGen |
|
|
309
357
|
|---|---|---|---|---|
|
|
310
|
-
| Cross-framework agents in one swarm | ✅
|
|
358
|
+
| Cross-framework agents in one swarm | ✅ 17 built-in adapters | ⚠️ Nodes can call any code; no adapter abstraction | ⚠️ Extensible via tools; CrewAI-native agents only | ⚠️ Extensible via plugins; AutoGen-native agents only |
|
|
311
359
|
| Atomic shared state (conflict-safe) | ✅ `propose → validate → commit` mutex | ⚠️ State passed between nodes; last-write-wins | ⚠️ Shared memory available; no conflict resolution | ⚠️ Shared context available; no conflict resolution |
|
|
312
360
|
| Hard token ceiling per agent | ✅ `FederatedBudget` (first-class API) | ⚠️ Via callbacks / custom middleware | ⚠️ Via callbacks / custom middleware | ⚠️ Built-in token tracking in v0.4+; no swarm-level ceiling |
|
|
313
361
|
| Permission gating before sensitive ops | ✅ `AuthGuardian` (built-in) | ⚠️ Possible via custom node logic | ⚠️ Possible via custom tools | ⚠️ Possible via custom middleware |
|
|
@@ -323,7 +371,7 @@ Extend `BaseAdapter` (or `StreamingBaseAdapter` for streaming) to add your own i
|
|
|
323
371
|
npm run test:all # All suites in sequence
|
|
324
372
|
npm test # Core orchestrator
|
|
325
373
|
npm run test:security # Security module
|
|
326
|
-
npm run test:adapters # All
|
|
374
|
+
npm run test:adapters # All 17 adapters
|
|
327
375
|
npm run test:streaming # Streaming adapters
|
|
328
376
|
npm run test:a2a # A2A protocol adapter
|
|
329
377
|
npm run test:codex # Codex adapter
|
|
@@ -331,7 +379,7 @@ npm run test:priority # Priority & preemption
|
|
|
331
379
|
npm run test:cli # CLI layer
|
|
332
380
|
```
|
|
333
381
|
|
|
334
|
-
**1,
|
|
382
|
+
**1,617 passing assertions across 20 test suites** (`npm run test:all`):
|
|
335
383
|
|
|
336
384
|
| Suite | Assertions | Covers |
|
|
337
385
|
|---|---|---|
|
|
@@ -339,7 +387,7 @@ npm run test:cli # CLI layer
|
|
|
339
387
|
| `test-phase5f.ts` | 127 | SSE transport, `McpCombinedBridge`, extended MCP tools |
|
|
340
388
|
| `test-phase5g.ts` | 121 | CRDT backend, vector clocks, bidirectional sync |
|
|
341
389
|
| `test-phase6.ts` | 121 | MCP server, control-plane tools, audit tools |
|
|
342
|
-
| `test-adapters.ts` |
|
|
390
|
+
| `test-adapters.ts` | 176 | All 17 adapters, registry routing, integration, edge cases |
|
|
343
391
|
| `test-phase5d.ts` | 117 | Pluggable backend (Redis, CRDT, Memory) |
|
|
344
392
|
| `test-standalone.ts` | 88 | Blackboard, auth, integration, persistence, parallelisation, quality gate |
|
|
345
393
|
| `test-phase5e.ts` | 87 | Federated budget tracking |
|
package/SKILL.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: Network-AI
|
|
3
|
-
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. TypeScript/Node.js features (HMAC tokens, AES-256, MCP server,
|
|
3
|
+
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. TypeScript/Node.js features (HMAC tokens, AES-256, MCP server, 17 adapters, CLI) are in the SEPARATE companion npm package (npm install -g network-ai) and are NOT part of this skill bundle."
|
|
4
4
|
metadata:
|
|
5
5
|
openclaw:
|
|
6
6
|
emoji: "\U0001F41D"
|
|
7
7
|
homepage: https://github.com/Jovancoding/Network-AI
|
|
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,
|
|
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, 17 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
9
|
network_calls: none
|
|
10
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"
|
|
11
11
|
requires:
|
|
@@ -746,7 +746,7 @@ The companion npm package (`network-ai`) provides:
|
|
|
746
746
|
- HMAC / Ed25519-signed audit tokens (vs UUID tokens in the Python layer)
|
|
747
747
|
- AES-256 blackboard encryption
|
|
748
748
|
- A standalone MCP server for IDE integration (Claude, Cursor, VS Code)
|
|
749
|
-
-
|
|
749
|
+
- 17 framework adapters (LangChain, AutoGen, CrewAI, DSPy, LlamaIndex, NemoClaw, APS, etc.)
|
|
750
750
|
- A full CLI (`network-ai bb`, `network-ai auth`, `network-ai budget`, `network-ai audit`)
|
|
751
751
|
|
|
752
752
|
None of the above are provided by this skill's Python scripts. No network calls are made by this skill.
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* APS Adapter — Agent Permission Service interop adapter.
|
|
3
|
+
*
|
|
4
|
+
* Maps APS delegation chains to AuthGuardian trust levels.
|
|
5
|
+
* This is the interop PoC proposed in crewAIInc/crewAI#4560:
|
|
6
|
+
* APS chain → MCP verify → trust mapping → registerAgentTrust().
|
|
7
|
+
*
|
|
8
|
+
* APS (Agent Permission Service) is a delegation-chain permission model
|
|
9
|
+
* proposed by aeoess et al. This adapter consumes APS delegation tokens,
|
|
10
|
+
* verifies them (locally or via MCP server), and translates the verified
|
|
11
|
+
* scope + depth into Network-AI's AgentTrustConfig.
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
*
|
|
15
|
+
* import { APSAdapter } from 'network-ai';
|
|
16
|
+
*
|
|
17
|
+
* const aps = new APSAdapter();
|
|
18
|
+
* await aps.initialize({});
|
|
19
|
+
*
|
|
20
|
+
* // Register an APS-verified agent by providing its delegation chain
|
|
21
|
+
* const trust = aps.apsDelegationToTrust({
|
|
22
|
+
* delegator: 'root-orchestrator',
|
|
23
|
+
* delegatee: 'sub-agent-7',
|
|
24
|
+
* scope: ['file:read', 'net:fetch'],
|
|
25
|
+
* currentDepth: 1,
|
|
26
|
+
* maxDepth: 3,
|
|
27
|
+
* signature: '<base64-token>',
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* // Wire into AuthGuardian
|
|
31
|
+
* guardian.registerAgentTrust(trust);
|
|
32
|
+
*
|
|
33
|
+
* Verification modes:
|
|
34
|
+
* - 'local' — checks signature + depth + scope locally (default)
|
|
35
|
+
* - 'mcp' — calls an APS MCP server to verify the full chain
|
|
36
|
+
*
|
|
37
|
+
* @module APSAdapter
|
|
38
|
+
* @version 1.0.0
|
|
39
|
+
*/
|
|
40
|
+
import { BaseAdapter } from './base-adapter';
|
|
41
|
+
import type { AdapterConfig, AdapterCapabilities, AgentPayload, AgentContext, AgentResult } from '../types/agent-adapter';
|
|
42
|
+
/** A single link in an APS delegation chain. */
|
|
43
|
+
export interface APSDelegation {
|
|
44
|
+
/** Agent that grants authority */
|
|
45
|
+
delegator: string;
|
|
46
|
+
/** Agent that receives authority */
|
|
47
|
+
delegatee: string;
|
|
48
|
+
/** Scopes granted — monotonically narrowing down the chain */
|
|
49
|
+
scope: string[];
|
|
50
|
+
/** Current depth in the delegation chain (0 = root) */
|
|
51
|
+
currentDepth: number;
|
|
52
|
+
/** Maximum allowed depth */
|
|
53
|
+
maxDepth: number;
|
|
54
|
+
/** Cryptographic signature or token from the delegator */
|
|
55
|
+
signature: string;
|
|
56
|
+
}
|
|
57
|
+
/** Result of APS verification — input to AuthGuardian. */
|
|
58
|
+
export interface APSTrustMapping {
|
|
59
|
+
agentId: string;
|
|
60
|
+
trustLevel: number;
|
|
61
|
+
allowedResources: string[];
|
|
62
|
+
allowedNamespaces: string[];
|
|
63
|
+
/** Raw APS chain metadata for audit purposes */
|
|
64
|
+
apsMetadata: {
|
|
65
|
+
delegator: string;
|
|
66
|
+
depth: number;
|
|
67
|
+
maxDepth: number;
|
|
68
|
+
scope: string[];
|
|
69
|
+
verified: boolean;
|
|
70
|
+
verificationMode: 'local' | 'mcp';
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/** Configuration for the APS adapter. */
|
|
74
|
+
export interface APSAdapterConfig extends AdapterConfig {
|
|
75
|
+
/** Base trust level for a fully verified root delegation (default: 0.8) */
|
|
76
|
+
baseTrust?: number;
|
|
77
|
+
/** Depth decay factor — trust decays as delegation gets deeper (default: 0.4) */
|
|
78
|
+
depthDecay?: number;
|
|
79
|
+
/** Verification mode: 'local' or 'mcp' (default: 'local') */
|
|
80
|
+
verificationMode?: 'local' | 'mcp';
|
|
81
|
+
/** MCP server URL for remote verification (required when mode is 'mcp') */
|
|
82
|
+
mcpServerUrl?: string;
|
|
83
|
+
/** Function to verify APS signatures — BYOC (bring your own crypto) */
|
|
84
|
+
verifySignature?: (delegation: APSDelegation) => Promise<boolean>;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* APSAdapter translates APS delegation chains into AuthGuardian trust configs.
|
|
88
|
+
*
|
|
89
|
+
* This is not a traditional execution adapter — it's a trust-bridging adapter.
|
|
90
|
+
* Its primary method is `apsDelegationToTrust()`, which verifies an APS
|
|
91
|
+
* delegation and returns an `AgentTrustConfig`-compatible object.
|
|
92
|
+
*/
|
|
93
|
+
export declare class APSAdapter extends BaseAdapter {
|
|
94
|
+
readonly name = "aps";
|
|
95
|
+
readonly version = "1.0.0";
|
|
96
|
+
private baseTrust;
|
|
97
|
+
private depthDecay;
|
|
98
|
+
private verificationMode;
|
|
99
|
+
private mcpServerUrl?;
|
|
100
|
+
private verifySignatureFn?;
|
|
101
|
+
get capabilities(): AdapterCapabilities;
|
|
102
|
+
initialize(config: APSAdapterConfig): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* Core method: convert an APS delegation into an AuthGuardian trust mapping.
|
|
105
|
+
*
|
|
106
|
+
* Trust formula: baseTrust × (1 - (currentDepth / maxDepth × depthDecay))
|
|
107
|
+
* At depth 0 (root): full baseTrust.
|
|
108
|
+
* At maxDepth: baseTrust × (1 - depthDecay).
|
|
109
|
+
*
|
|
110
|
+
* Scopes are monotonically narrowing — a child delegation can only have
|
|
111
|
+
* a subset of the parent's scopes.
|
|
112
|
+
*/
|
|
113
|
+
apsDelegationToTrust(delegation: APSDelegation): Promise<APSTrustMapping>;
|
|
114
|
+
/**
|
|
115
|
+
* Verify an APS delegation — either locally or via MCP.
|
|
116
|
+
*/
|
|
117
|
+
private verifyDelegation;
|
|
118
|
+
/**
|
|
119
|
+
* Verify delegation via an APS MCP server.
|
|
120
|
+
* Calls the server's `verifyDelegation` tool.
|
|
121
|
+
*/
|
|
122
|
+
private verifyViaMCP;
|
|
123
|
+
/**
|
|
124
|
+
* Execute is a pass-through — APS adapter is a trust bridge, not an executor.
|
|
125
|
+
* When called, it verifies the delegation from the payload and returns the trust mapping.
|
|
126
|
+
*/
|
|
127
|
+
executeAgent(agentName: string, payload: AgentPayload, context: AgentContext): Promise<AgentResult>;
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=aps-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aps-adapter.d.ts","sourceRoot":"","sources":["../../adapters/aps-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC,UAAU,EAAE,aAAa,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACnE;AAoBD;;;;;;GAMG;AACH,qBAAa,UAAW,SAAQ,WAAW;IACzC,QAAQ,CAAC,IAAI,SAAS;IACtB,QAAQ,CAAC,OAAO,WAAW;IAE3B,OAAO,CAAC,SAAS,CAAO;IACxB,OAAO,CAAC,UAAU,CAAO;IACzB,OAAO,CAAC,gBAAgB,CAA4B;IACpD,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,iBAAiB,CAAC,CAAkD;IAE5E,IAAI,YAAY,IAAI,mBAAmB,CAStC;IAEK,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IA4BzD;;;;;;;;;OASG;IACG,oBAAoB,CAAC,UAAU,EAAE,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC;IA+D/E;;OAEG;YACW,gBAAgB;IAuB9B;;;OAGG;YACW,YAAY;IAwC1B;;;OAGG;IACG,YAAY,CAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,WAAW,CAAC;CA2CxB"}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* APS Adapter — Agent Permission Service interop adapter.
|
|
4
|
+
*
|
|
5
|
+
* Maps APS delegation chains to AuthGuardian trust levels.
|
|
6
|
+
* This is the interop PoC proposed in crewAIInc/crewAI#4560:
|
|
7
|
+
* APS chain → MCP verify → trust mapping → registerAgentTrust().
|
|
8
|
+
*
|
|
9
|
+
* APS (Agent Permission Service) is a delegation-chain permission model
|
|
10
|
+
* proposed by aeoess et al. This adapter consumes APS delegation tokens,
|
|
11
|
+
* verifies them (locally or via MCP server), and translates the verified
|
|
12
|
+
* scope + depth into Network-AI's AgentTrustConfig.
|
|
13
|
+
*
|
|
14
|
+
* Usage:
|
|
15
|
+
*
|
|
16
|
+
* import { APSAdapter } from 'network-ai';
|
|
17
|
+
*
|
|
18
|
+
* const aps = new APSAdapter();
|
|
19
|
+
* await aps.initialize({});
|
|
20
|
+
*
|
|
21
|
+
* // Register an APS-verified agent by providing its delegation chain
|
|
22
|
+
* const trust = aps.apsDelegationToTrust({
|
|
23
|
+
* delegator: 'root-orchestrator',
|
|
24
|
+
* delegatee: 'sub-agent-7',
|
|
25
|
+
* scope: ['file:read', 'net:fetch'],
|
|
26
|
+
* currentDepth: 1,
|
|
27
|
+
* maxDepth: 3,
|
|
28
|
+
* signature: '<base64-token>',
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* // Wire into AuthGuardian
|
|
32
|
+
* guardian.registerAgentTrust(trust);
|
|
33
|
+
*
|
|
34
|
+
* Verification modes:
|
|
35
|
+
* - 'local' — checks signature + depth + scope locally (default)
|
|
36
|
+
* - 'mcp' — calls an APS MCP server to verify the full chain
|
|
37
|
+
*
|
|
38
|
+
* @module APSAdapter
|
|
39
|
+
* @version 1.0.0
|
|
40
|
+
*/
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.APSAdapter = void 0;
|
|
43
|
+
const base_adapter_1 = require("./base-adapter");
|
|
44
|
+
// ─── Scope → Resource type mapping ────────────────────────────────────────────
|
|
45
|
+
const SCOPE_TO_RESOURCE = {
|
|
46
|
+
'file:read': 'FILE_SYSTEM',
|
|
47
|
+
'file:write': 'FILE_SYSTEM',
|
|
48
|
+
'net:fetch': 'NETWORK',
|
|
49
|
+
'net:listen': 'NETWORK',
|
|
50
|
+
'shell:exec': 'SHELL_EXEC',
|
|
51
|
+
'git:read': 'GIT',
|
|
52
|
+
'git:write': 'GIT',
|
|
53
|
+
'db:read': 'DATABASE',
|
|
54
|
+
'db:write': 'DATABASE',
|
|
55
|
+
'pay:read': 'PAYMENTS',
|
|
56
|
+
'pay:write': 'PAYMENTS',
|
|
57
|
+
};
|
|
58
|
+
// ─── Adapter ──────────────────────────────────────────────────────────────────
|
|
59
|
+
/**
|
|
60
|
+
* APSAdapter translates APS delegation chains into AuthGuardian trust configs.
|
|
61
|
+
*
|
|
62
|
+
* This is not a traditional execution adapter — it's a trust-bridging adapter.
|
|
63
|
+
* Its primary method is `apsDelegationToTrust()`, which verifies an APS
|
|
64
|
+
* delegation and returns an `AgentTrustConfig`-compatible object.
|
|
65
|
+
*/
|
|
66
|
+
class APSAdapter extends base_adapter_1.BaseAdapter {
|
|
67
|
+
name = 'aps';
|
|
68
|
+
version = '1.0.0';
|
|
69
|
+
baseTrust = 0.8;
|
|
70
|
+
depthDecay = 0.4;
|
|
71
|
+
verificationMode = 'local';
|
|
72
|
+
mcpServerUrl;
|
|
73
|
+
verifySignatureFn;
|
|
74
|
+
get capabilities() {
|
|
75
|
+
return {
|
|
76
|
+
streaming: false,
|
|
77
|
+
parallel: true,
|
|
78
|
+
bidirectional: false,
|
|
79
|
+
discovery: false,
|
|
80
|
+
authentication: true,
|
|
81
|
+
statefulSessions: false,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
async initialize(config) {
|
|
85
|
+
await super.initialize(config);
|
|
86
|
+
if (config.baseTrust !== undefined) {
|
|
87
|
+
if (typeof config.baseTrust !== 'number' || config.baseTrust < 0 || config.baseTrust > 1) {
|
|
88
|
+
throw new Error('baseTrust must be a number between 0 and 1');
|
|
89
|
+
}
|
|
90
|
+
this.baseTrust = config.baseTrust;
|
|
91
|
+
}
|
|
92
|
+
if (config.depthDecay !== undefined) {
|
|
93
|
+
if (typeof config.depthDecay !== 'number' || config.depthDecay < 0 || config.depthDecay > 1) {
|
|
94
|
+
throw new Error('depthDecay must be a number between 0 and 1');
|
|
95
|
+
}
|
|
96
|
+
this.depthDecay = config.depthDecay;
|
|
97
|
+
}
|
|
98
|
+
if (config.verificationMode) {
|
|
99
|
+
this.verificationMode = config.verificationMode;
|
|
100
|
+
}
|
|
101
|
+
if (config.mcpServerUrl) {
|
|
102
|
+
this.mcpServerUrl = config.mcpServerUrl;
|
|
103
|
+
}
|
|
104
|
+
if (config.verifySignature) {
|
|
105
|
+
this.verifySignatureFn = config.verifySignature;
|
|
106
|
+
}
|
|
107
|
+
if (this.verificationMode === 'mcp' && !this.mcpServerUrl) {
|
|
108
|
+
throw new Error('mcpServerUrl is required when verificationMode is "mcp"');
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Core method: convert an APS delegation into an AuthGuardian trust mapping.
|
|
113
|
+
*
|
|
114
|
+
* Trust formula: baseTrust × (1 - (currentDepth / maxDepth × depthDecay))
|
|
115
|
+
* At depth 0 (root): full baseTrust.
|
|
116
|
+
* At maxDepth: baseTrust × (1 - depthDecay).
|
|
117
|
+
*
|
|
118
|
+
* Scopes are monotonically narrowing — a child delegation can only have
|
|
119
|
+
* a subset of the parent's scopes.
|
|
120
|
+
*/
|
|
121
|
+
async apsDelegationToTrust(delegation) {
|
|
122
|
+
// Validate input
|
|
123
|
+
if (!delegation || typeof delegation !== 'object') {
|
|
124
|
+
throw new Error('delegation must be a non-null object');
|
|
125
|
+
}
|
|
126
|
+
if (!delegation.delegatee || typeof delegation.delegatee !== 'string') {
|
|
127
|
+
throw new Error('delegation.delegatee must be a non-empty string');
|
|
128
|
+
}
|
|
129
|
+
if (!delegation.delegator || typeof delegation.delegator !== 'string') {
|
|
130
|
+
throw new Error('delegation.delegator must be a non-empty string');
|
|
131
|
+
}
|
|
132
|
+
if (!Array.isArray(delegation.scope) || delegation.scope.length === 0) {
|
|
133
|
+
throw new Error('delegation.scope must be a non-empty array');
|
|
134
|
+
}
|
|
135
|
+
if (typeof delegation.currentDepth !== 'number' || delegation.currentDepth < 0) {
|
|
136
|
+
throw new Error('delegation.currentDepth must be a non-negative number');
|
|
137
|
+
}
|
|
138
|
+
if (typeof delegation.maxDepth !== 'number' || delegation.maxDepth < 1) {
|
|
139
|
+
throw new Error('delegation.maxDepth must be a positive number');
|
|
140
|
+
}
|
|
141
|
+
if (delegation.currentDepth > delegation.maxDepth) {
|
|
142
|
+
throw new Error('delegation.currentDepth cannot exceed maxDepth');
|
|
143
|
+
}
|
|
144
|
+
// Verify the delegation
|
|
145
|
+
const verified = await this.verifyDelegation(delegation);
|
|
146
|
+
// Compute trust level with depth decay
|
|
147
|
+
const depthRatio = delegation.maxDepth > 0
|
|
148
|
+
? delegation.currentDepth / delegation.maxDepth
|
|
149
|
+
: 0;
|
|
150
|
+
const trustLevel = verified
|
|
151
|
+
? Math.max(0, this.baseTrust * (1 - depthRatio * this.depthDecay))
|
|
152
|
+
: 0;
|
|
153
|
+
// Map APS scopes to AuthGuardian resource types
|
|
154
|
+
const allowedResources = [...new Set(delegation.scope
|
|
155
|
+
.map(s => SCOPE_TO_RESOURCE[s])
|
|
156
|
+
.filter((r) => r !== undefined))];
|
|
157
|
+
// Derive namespace prefixes from scopes
|
|
158
|
+
const allowedNamespaces = delegation.scope
|
|
159
|
+
.map(s => s.split(':')[0] + ':')
|
|
160
|
+
.filter((v, i, a) => a.indexOf(v) === i);
|
|
161
|
+
return {
|
|
162
|
+
agentId: delegation.delegatee,
|
|
163
|
+
trustLevel: Math.round(trustLevel * 1000) / 1000,
|
|
164
|
+
allowedResources,
|
|
165
|
+
allowedNamespaces,
|
|
166
|
+
apsMetadata: {
|
|
167
|
+
delegator: delegation.delegator,
|
|
168
|
+
depth: delegation.currentDepth,
|
|
169
|
+
maxDepth: delegation.maxDepth,
|
|
170
|
+
scope: delegation.scope,
|
|
171
|
+
verified,
|
|
172
|
+
verificationMode: this.verificationMode,
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Verify an APS delegation — either locally or via MCP.
|
|
178
|
+
*/
|
|
179
|
+
async verifyDelegation(delegation) {
|
|
180
|
+
// Depth bounds check
|
|
181
|
+
if (delegation.currentDepth > delegation.maxDepth) {
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
if (!delegation.signature || typeof delegation.signature !== 'string') {
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
if (this.verificationMode === 'mcp' && this.mcpServerUrl) {
|
|
188
|
+
return this.verifyViaMCP(delegation);
|
|
189
|
+
}
|
|
190
|
+
// Local verification — use BYOC verifier or default signature check
|
|
191
|
+
if (this.verifySignatureFn) {
|
|
192
|
+
return this.verifySignatureFn(delegation);
|
|
193
|
+
}
|
|
194
|
+
// Default: non-empty signature + valid depth = trusted
|
|
195
|
+
// In production, replace with actual crypto verification
|
|
196
|
+
return delegation.signature.length > 0;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Verify delegation via an APS MCP server.
|
|
200
|
+
* Calls the server's `verifyDelegation` tool.
|
|
201
|
+
*/
|
|
202
|
+
async verifyViaMCP(delegation) {
|
|
203
|
+
if (!this.mcpServerUrl)
|
|
204
|
+
return false;
|
|
205
|
+
try {
|
|
206
|
+
const url = new URL('/sse', this.mcpServerUrl);
|
|
207
|
+
const response = await fetch(url.toString(), {
|
|
208
|
+
method: 'POST',
|
|
209
|
+
headers: { 'Content-Type': 'application/json' },
|
|
210
|
+
body: JSON.stringify({
|
|
211
|
+
jsonrpc: '2.0',
|
|
212
|
+
id: `aps-verify-${Date.now()}`,
|
|
213
|
+
method: 'tools/call',
|
|
214
|
+
params: {
|
|
215
|
+
name: 'verifyDelegation',
|
|
216
|
+
arguments: {
|
|
217
|
+
delegator: delegation.delegator,
|
|
218
|
+
delegatee: delegation.delegatee,
|
|
219
|
+
scope: delegation.scope,
|
|
220
|
+
currentDepth: delegation.currentDepth,
|
|
221
|
+
maxDepth: delegation.maxDepth,
|
|
222
|
+
signature: delegation.signature,
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
}),
|
|
226
|
+
});
|
|
227
|
+
if (!response.ok)
|
|
228
|
+
return false;
|
|
229
|
+
const result = await response.json();
|
|
230
|
+
const text = result?.result?.content?.[0]?.text;
|
|
231
|
+
if (!text)
|
|
232
|
+
return false;
|
|
233
|
+
const parsed = JSON.parse(text);
|
|
234
|
+
return parsed.verified === true;
|
|
235
|
+
}
|
|
236
|
+
catch {
|
|
237
|
+
// MCP verification failed — deny by default
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Execute is a pass-through — APS adapter is a trust bridge, not an executor.
|
|
243
|
+
* When called, it verifies the delegation from the payload and returns the trust mapping.
|
|
244
|
+
*/
|
|
245
|
+
async executeAgent(agentName, payload, context) {
|
|
246
|
+
this.ensureReady();
|
|
247
|
+
const delegation = payload.params;
|
|
248
|
+
if (!delegation?.delegatee) {
|
|
249
|
+
return {
|
|
250
|
+
success: false,
|
|
251
|
+
error: {
|
|
252
|
+
code: 'INVALID_DELEGATION',
|
|
253
|
+
message: 'Payload must contain a valid APSDelegation in params',
|
|
254
|
+
recoverable: false,
|
|
255
|
+
},
|
|
256
|
+
metadata: { adapter: this.name },
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
try {
|
|
260
|
+
const trust = await this.apsDelegationToTrust(delegation);
|
|
261
|
+
return {
|
|
262
|
+
success: true,
|
|
263
|
+
data: trust,
|
|
264
|
+
metadata: {
|
|
265
|
+
adapter: this.name,
|
|
266
|
+
trace: {
|
|
267
|
+
agentName,
|
|
268
|
+
verified: trust.apsMetadata.verified,
|
|
269
|
+
trustLevel: trust.trustLevel,
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
catch (err) {
|
|
275
|
+
return {
|
|
276
|
+
success: false,
|
|
277
|
+
error: {
|
|
278
|
+
code: 'DELEGATION_FAILED',
|
|
279
|
+
message: err instanceof Error ? err.message : String(err),
|
|
280
|
+
recoverable: false,
|
|
281
|
+
nativeError: err,
|
|
282
|
+
},
|
|
283
|
+
metadata: { adapter: this.name },
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
exports.APSAdapter = APSAdapter;
|
|
289
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QAAQ,EAAE;oBACR,OAAO,EAAE,IAAI,CAAC,IAAI;oBAClB,KAAK,EAAE;wBACL,SAAS;wBACT,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,QAAQ;wBACpC,UAAU,EAAE,KAAK,CAAC,UAAU;qBAC7B;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE;oBACL,IAAI,EAAE,mBAAmB;oBACzB,OAAO,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;oBACzD,WAAW,EAAE,KAAK;oBAClB,WAAW,EAAE,GAAG;iBACjB;gBACD,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAE;aACjC,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAnPD,gCAmPC"}
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -53,6 +53,8 @@ export { CodexAdapter } from './codex-adapter';
|
|
|
53
53
|
export type { CodexMode, CodexAgentConfig, CodexChatClient, CodexCompletionClient, CodexCLIExecutor, } from './codex-adapter';
|
|
54
54
|
export { MiniMaxAdapter } from './minimax-adapter';
|
|
55
55
|
export type { MiniMaxAgentConfig, MiniMaxChatClient } from './minimax-adapter';
|
|
56
|
+
export { APSAdapter } from './aps-adapter';
|
|
57
|
+
export type { APSDelegation, APSTrustMapping, APSAdapterConfig, } from './aps-adapter';
|
|
56
58
|
export { NemoClawAdapter } from './nemoclaw-adapter';
|
|
57
59
|
export type { NemoClawAgentConfig, OpenShellExecutor, BlueprintAction, BlueprintRunResult, SandboxState, SandboxStatus, NetworkPolicy, PolicyEndpoint, } from './nemoclaw-adapter';
|
|
58
60
|
export type { StreamingChunk, IStreamingAdapter, StreamCollector } from '../types/streaming-adapter';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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AAY,EACV,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG/E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,YAAY,EACV,aAAa,EACb,eAAe,EACf,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,GACf,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAGrG,YAAY,EACV,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,SAAS,EACT,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC"}
|
package/dist/adapters/index.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* @version 1.0.0
|
|
21
21
|
*/
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.NemoClawAdapter = exports.MiniMaxAdapter = exports.CodexAdapter = exports.A2AAdapter = exports.CustomStreamingAdapter = exports.LangChainStreamingAdapter = exports.collectStream = exports.StreamingBaseAdapter = exports.AgnoAdapter = exports.DSPyAdapter = exports.HaystackAdapter = exports.OpenAIAssistantsAdapter = exports.SemanticKernelAdapter = exports.LlamaIndexAdapter = exports.CustomAdapter = exports.MCPAdapter = exports.CrewAIAdapter = exports.AutoGenAdapter = exports.LangChainAdapter = exports.OpenClawAdapter = exports.getRegistry = exports.AdapterRegistry = exports.BaseAdapter = void 0;
|
|
23
|
+
exports.NemoClawAdapter = exports.APSAdapter = exports.MiniMaxAdapter = exports.CodexAdapter = exports.A2AAdapter = exports.CustomStreamingAdapter = exports.LangChainStreamingAdapter = exports.collectStream = exports.StreamingBaseAdapter = exports.AgnoAdapter = exports.DSPyAdapter = exports.HaystackAdapter = exports.OpenAIAssistantsAdapter = exports.SemanticKernelAdapter = exports.LlamaIndexAdapter = exports.CustomAdapter = exports.MCPAdapter = exports.CrewAIAdapter = exports.AutoGenAdapter = exports.LangChainAdapter = exports.OpenClawAdapter = exports.getRegistry = exports.AdapterRegistry = exports.BaseAdapter = void 0;
|
|
24
24
|
// Core infrastructure
|
|
25
25
|
var base_adapter_1 = require("./base-adapter");
|
|
26
26
|
Object.defineProperty(exports, "BaseAdapter", { enumerable: true, get: function () { return base_adapter_1.BaseAdapter; } });
|
|
@@ -70,6 +70,9 @@ Object.defineProperty(exports, "CodexAdapter", { enumerable: true, get: function
|
|
|
70
70
|
// MiniMax adapter (MiniMax LLM API — MiniMax-M2.5 / MiniMax-M2.5-highspeed)
|
|
71
71
|
var minimax_adapter_1 = require("./minimax-adapter");
|
|
72
72
|
Object.defineProperty(exports, "MiniMaxAdapter", { enumerable: true, get: function () { return minimax_adapter_1.MiniMaxAdapter; } });
|
|
73
|
+
// APS adapter (Agent Permission Service — delegation chain → trust mapping)
|
|
74
|
+
var aps_adapter_1 = require("./aps-adapter");
|
|
75
|
+
Object.defineProperty(exports, "APSAdapter", { enumerable: true, get: function () { return aps_adapter_1.APSAdapter; } });
|
|
73
76
|
// NemoClaw adapter (NVIDIA NemoClaw — sandboxed agent execution via OpenShell)
|
|
74
77
|
var nemoclaw_adapter_1 = require("./nemoclaw-adapter");
|
|
75
78
|
Object.defineProperty(exports, "NemoClawAdapter", { enumerable: true, get: function () { return nemoclaw_adapter_1.NemoClawAdapter; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../adapters/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,sBAAsB;AACtB,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,uDAAkE;AAAzD,mHAAA,eAAe,OAAA;AAAE,+GAAA,WAAW,OAAA;AAErC,mCAAmC;AACnC,uDAAqD;AAA5C,mHAAA,eAAe,OAAA;AACxB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AAEzB,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AAEvB,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AAEtB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AAEnB,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AAGtB,8BAA8B;AAC9B,2DAAyD;AAAhD,uHAAA,iBAAiB,OAAA;AAO1B,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA;AAE9B,yEAAsE;AAA7D,oIAAA,uBAAuB,OAAA;AAOhC,uDAAqD;AAA5C,mHAAA,eAAe,OAAA;AAQxB,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AAEpB,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AAQpB,qBAAqB;AACrB,mEAA+E;AAAtE,8HAAA,oBAAoB,OAAA;AAAE,uHAAA,aAAa,OAAA;AAC5C,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,uEAAoE;AAA3D,kIAAA,sBAAsB,OAAA;AAG/B,+BAA+B;AAC/B,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AAUnB,uDAAuD;AACvD,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AASrB,4EAA4E;AAC5E,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AAGvB,+EAA+E;AAC/E,uDAAqD;AAA5C,mHAAA,eAAe,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../adapters/index.ts"],"names":[],"mappings":";A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ai",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "AI agent orchestration framework for TypeScript/Node.js -
|
|
3
|
+
"version": "4.10.0",
|
|
4
|
+
"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.",
|
|
5
5
|
"homepage": "https://github.com/Jovancoding/Network-AI#readme",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|