@lawrenceliang-btc/atel-sdk 0.8.14 → 0.9.1
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 +195 -7
- package/bin/atel.mjs +691 -62
- package/bin/ollama-manager.mjs +149 -0
- package/dist/audit/async-queue.d.ts +32 -0
- package/dist/audit/async-queue.js +87 -0
- package/dist/audit/index.d.ts +6 -0
- package/dist/audit/index.js +7 -0
- package/dist/audit/llm-verifier.d.ts +15 -0
- package/dist/audit/llm-verifier.js +128 -0
- package/dist/audit/model-capability.d.ts +22 -0
- package/dist/audit/model-capability.js +63 -0
- package/dist/audit/service.d.ts +56 -0
- package/dist/audit/service.js +130 -0
- package/dist/audit/tiered-verifier.d.ts +19 -0
- package/dist/audit/tiered-verifier.js +120 -0
- package/dist/audit/types.d.ts +26 -0
- package/dist/audit/types.js +2 -0
- package/dist/executor/index.d.ts +12 -0
- package/dist/executor/index.js +244 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/trace/index.d.ts +1 -1
- package/package.json +1 -1
- package/skill/references/quickstart.md +35 -8
- package/skill/references/recovery.md +51 -1
- package/skill/references/reliability.md +26 -0
- package/skill/references/selfcheck.md +23 -6
- package/skill/scripts/selfcheck.sh +38 -5
package/README.md
CHANGED
|
@@ -4,13 +4,44 @@
|
|
|
4
4
|
|
|
5
5
|
ATEL provides the cryptographic primitives and protocol building blocks that let AI agents collaborate safely: identity verification, scoped consent, policy enforcement, tamper-evident execution traces, Merkle-tree proofs, and reputation scoring.
|
|
6
6
|
|
|
7
|
+
## ✨ What's New in v0.9.0
|
|
8
|
+
|
|
9
|
+
- **🔍 System Status Command** — Check agent health with `atel status`
|
|
10
|
+
- **🤖 Ollama Auto-Init** — Automatic Ollama service startup and model download
|
|
11
|
+
- **📊 Visual Health Indicators** — Clear ✅/❌/⚠️ status display
|
|
12
|
+
- **🔐 Enhanced Security** — Improved audit verification with local LLM fallback
|
|
13
|
+
|
|
14
|
+
See [docs/STATUS_AND_OLLAMA_FEATURE.md](docs/STATUS_AND_OLLAMA_FEATURE.md) for details.
|
|
15
|
+
|
|
7
16
|
## Quick Start
|
|
8
17
|
|
|
18
|
+
### For End Users (CLI)
|
|
19
|
+
|
|
20
|
+
Install the ATEL CLI globally:
|
|
21
|
+
|
|
9
22
|
```bash
|
|
10
|
-
|
|
11
|
-
|
|
23
|
+
npm install -g @lawrenceliang-btc/atel-sdk
|
|
24
|
+
atel init my-agent
|
|
25
|
+
atel register "My Agent" "assistant,research"
|
|
26
|
+
atel start 3100
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Check system status:**
|
|
30
|
+
```bash
|
|
31
|
+
atel status
|
|
32
|
+
# Shows: Identity, Agent, Executor, Gateway, Ollama, Audit, Network
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
See [skill/references/quickstart.md](skill/references/quickstart.md) for detailed setup and upgrade instructions.
|
|
36
|
+
|
|
37
|
+
### For Developers (SDK)
|
|
12
38
|
|
|
13
|
-
|
|
39
|
+
Clone and build from source:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
git clone https://github.com/LawrenceLiang-BTC/atel-sdk.git
|
|
43
|
+
cd atel-sdk
|
|
44
|
+
npm install
|
|
14
45
|
npm run build
|
|
15
46
|
|
|
16
47
|
# Run the end-to-end demo
|
|
@@ -69,6 +100,36 @@ ATEL is organized into 13 composable modules:
|
|
|
69
100
|
| **Anchor** | Multi-chain proof anchoring (Base/BSC/Solana/Mock) |
|
|
70
101
|
| **Orchestrator** | High-level API wiring task delegation/execution/verify |
|
|
71
102
|
| **Service** | HTTP API for score + graph queries with JSON persistence |
|
|
103
|
+
| **Audit** | Thinking verification with tiered strategy (Gateway → Ollama → Rule) |
|
|
104
|
+
|
|
105
|
+
## Audit System
|
|
106
|
+
|
|
107
|
+
ATEL includes a comprehensive audit system for verifying agent thinking processes:
|
|
108
|
+
|
|
109
|
+
### Tiered Verification Strategy
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
┌─────────────────────────────────────────────┐
|
|
113
|
+
│ Audit Verification │
|
|
114
|
+
├─────────────────────────────────────────────┤
|
|
115
|
+
│ 1. Gateway (OpenClaw) ← Primary │
|
|
116
|
+
│ 2. Ollama (Local LLM) ← Fallback │
|
|
117
|
+
│ 3. Rule-Based ← Last Resort │
|
|
118
|
+
└─────────────────────────────────────────────┘
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Features:**
|
|
122
|
+
- **Auto-initialization**: Ollama service starts automatically on agent startup
|
|
123
|
+
- **Model management**: Automatic download of `qwen2.5:0.5b` (397MB) if missing
|
|
124
|
+
- **Non-blocking**: Audit runs asynchronously, never blocks task completion
|
|
125
|
+
- **Graceful degradation**: Falls back to simpler verification if advanced methods fail
|
|
126
|
+
|
|
127
|
+
**Verification Levels:**
|
|
128
|
+
1. **Gateway**: Uses OpenClaw Gateway to call large language models
|
|
129
|
+
2. **Ollama**: Local LLM inference for offline verification
|
|
130
|
+
3. **Rule**: Keyword-based pattern matching (always available)
|
|
131
|
+
|
|
132
|
+
See [docs/AUDIT_SERVICE.md](docs/AUDIT_SERVICE.md) for implementation details.
|
|
72
133
|
|
|
73
134
|
## Trust Modes
|
|
74
135
|
|
|
@@ -84,11 +145,73 @@ This means local capability is never removed when network trust is enabled.
|
|
|
84
145
|
Detailed API guide: `docs/API.md`
|
|
85
146
|
Start here (one-page onboarding): `docs/START-HERE.md`
|
|
86
147
|
5-minute quickstart: `docs/QUICKSTART-5MIN.md`
|
|
87
|
-
Phase 0.5 runbook: `docs/PHASE-0.5.md`
|
|
88
|
-
Service deployment: `docs/SERVICE-DEPLOY.md`
|
|
148
|
+
Phase 0.5 runbook: `docs/PHASE-0.5.md`
|
|
149
|
+
Service deployment: `docs/SERVICE-DEPLOY.md`
|
|
150
|
+
Status & Ollama features: `docs/STATUS_AND_OLLAMA_FEATURE.md`
|
|
89
151
|
|
|
90
152
|
ATEL skill package: `skills/atel/SKILL.md`
|
|
91
153
|
|
|
154
|
+
### CLI Commands
|
|
155
|
+
|
|
156
|
+
**System Management:**
|
|
157
|
+
```bash
|
|
158
|
+
atel init [name] # Create agent identity
|
|
159
|
+
atel info # Show identity and configuration
|
|
160
|
+
atel status # Check system health (NEW in v0.9.0)
|
|
161
|
+
atel status --json # JSON output for monitoring
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Network Setup:**
|
|
165
|
+
```bash
|
|
166
|
+
atel setup [port] # Configure network (IP, UPnP, verify)
|
|
167
|
+
atel verify # Verify port reachability
|
|
168
|
+
atel start [port] # Start agent endpoint (auto-init Ollama)
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Registry:**
|
|
172
|
+
```bash
|
|
173
|
+
atel register [name] [caps] # Register on public registry
|
|
174
|
+
atel search <capability> # Search for agents
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Task Execution:**
|
|
178
|
+
```bash
|
|
179
|
+
atel task <target> <json> # Delegate task to agent
|
|
180
|
+
atel result <taskId> <json> # Submit execution result
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Trust & Verification:**
|
|
184
|
+
```bash
|
|
185
|
+
atel check <did> [risk] # Check agent trust score
|
|
186
|
+
atel audit <did> <taskId> # Deep audit with trace verification
|
|
187
|
+
atel verify-proof <tx> <root> # Verify on-chain proof
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Account & Trading:**
|
|
191
|
+
```bash
|
|
192
|
+
atel balance # Show account balance
|
|
193
|
+
atel order <did> <cap> <price> # Create trade order
|
|
194
|
+
atel accept <orderId> # Accept order
|
|
195
|
+
atel complete <orderId> # Mark complete
|
|
196
|
+
atel confirm <orderId> # Confirm and settle
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Status Command Output
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
=== ATEL Agent Status ===
|
|
203
|
+
|
|
204
|
+
Identity: ✅ did:atel:ed25519:Huqt3hpi...
|
|
205
|
+
Agent: ✅ Running (port 14002)
|
|
206
|
+
Executor: ✅ Available (http://127.0.0.1:14004)
|
|
207
|
+
Gateway: ✅ Connected (http://localhost:18789)
|
|
208
|
+
Ollama: ✅ Running (1 models)
|
|
209
|
+
Models: qwen2.5:0.5b
|
|
210
|
+
Audit: ✅ Enabled (Gateway → Ollama → Rule)
|
|
211
|
+
Registry: http://47.251.8.19:8200
|
|
212
|
+
Network: ✅ http://43.160.230.129:14002
|
|
213
|
+
```
|
|
214
|
+
|
|
92
215
|
### Module 1: Identity
|
|
93
216
|
|
|
94
217
|
```typescript
|
|
@@ -179,7 +302,52 @@ const report = ProofVerifier.verify(bundle, { trace });
|
|
|
179
302
|
// report.valid, report.checks, report.summary
|
|
180
303
|
```
|
|
181
304
|
|
|
182
|
-
### Module 7:
|
|
305
|
+
### Module 7: On-Chain Anchoring
|
|
306
|
+
|
|
307
|
+
```typescript
|
|
308
|
+
import { SolanaAnchorProvider, BaseAnchorProvider, BSCAnchorProvider } from '@lawrenceliang-btc/atel-sdk';
|
|
309
|
+
|
|
310
|
+
// Anchor proof to Solana
|
|
311
|
+
const solana = new SolanaAnchorProvider({
|
|
312
|
+
rpcUrl: 'https://api.mainnet-beta.solana.com',
|
|
313
|
+
privateKey: process.env.ATEL_SOLANA_PRIVATE_KEY
|
|
314
|
+
});
|
|
315
|
+
const result = await solana.anchor(traceRoot, {
|
|
316
|
+
executorDid: 'did:atel:ed25519:...',
|
|
317
|
+
requesterDid: 'did:atel:ed25519:...',
|
|
318
|
+
taskId: 'task-123'
|
|
319
|
+
});
|
|
320
|
+
// result.txHash, result.blockNumber
|
|
321
|
+
|
|
322
|
+
// Verify on-chain anchor
|
|
323
|
+
const verified = await solana.verify(traceRoot, txHash);
|
|
324
|
+
// verified.valid, verified.detail
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
**Supported Chains:**
|
|
328
|
+
- Solana (Memo Program)
|
|
329
|
+
- Base (L2)
|
|
330
|
+
- BSC (Binance Smart Chain)
|
|
331
|
+
|
|
332
|
+
**On-Chain Format (v2):**
|
|
333
|
+
```
|
|
334
|
+
ATEL:1:executorDID:requesterDID:taskId:traceRoot
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
Example:
|
|
338
|
+
```
|
|
339
|
+
ATEL:1:did:atel:ed25519:ABC...:did:atel:ed25519:XYZ...:task-123:6776dd40b1aa3e1cc8d4f713c83d13ecb6b92aade817c9ef073a7607c6fe63d0
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
**Environment Variables:**
|
|
343
|
+
- `ATEL_SOLANA_PRIVATE_KEY` - Solana wallet private key (base58)
|
|
344
|
+
- `ATEL_SOLANA_RPC_URL` - Solana RPC endpoint (default: mainnet-beta)
|
|
345
|
+
- `ATEL_BASE_PRIVATE_KEY` - Base chain private key (hex)
|
|
346
|
+
- `ATEL_BASE_RPC_URL` - Base RPC endpoint (default: https://mainnet.base.org)
|
|
347
|
+
- `ATEL_BSC_PRIVATE_KEY` - BSC private key (hex)
|
|
348
|
+
- `ATEL_BSC_RPC_URL` - BSC RPC endpoint (default: https://bsc-dataseed.binance.org)
|
|
349
|
+
|
|
350
|
+
### Module 8: Score
|
|
183
351
|
|
|
184
352
|
```typescript
|
|
185
353
|
import { TrustScoreClient } from '@lawrenceliang-btc/atel-sdk';
|
|
@@ -202,13 +370,33 @@ consistency = (1 − violation_rate) × 10
|
|
|
202
370
|
score = base + volume + risk_bonus + consistency (clamped 0–100)
|
|
203
371
|
```
|
|
204
372
|
|
|
205
|
-
## Current Status (2026-
|
|
373
|
+
## Current Status (2026-03-13)
|
|
206
374
|
|
|
207
375
|
- [x] **Phase 0 MVP complete** — 13 modules implemented, core trust workflow end-to-end
|
|
208
376
|
- [x] **241 tests in suite** — unit/integration coverage across modules
|
|
209
377
|
- [x] **Demo coverage** — success path + failure scenarios
|
|
378
|
+
- [x] **Audit system** — Thinking verification with tiered strategy (Gateway → Ollama → Rule)
|
|
379
|
+
- [x] **v0.9.0 released** — Status command, Ollama auto-init, enhanced monitoring
|
|
380
|
+
- [x] **Production deployment** — Platform + SDK deployed and tested
|
|
210
381
|
- [ ] **Phase 0.5 validation** — real agents + real external tools + real testnet anchoring
|
|
211
382
|
|
|
383
|
+
## Recent Updates
|
|
384
|
+
|
|
385
|
+
### v0.9.0 (2026-03-13)
|
|
386
|
+
- ✅ Added `atel status` command for system health monitoring
|
|
387
|
+
- ✅ Automatic Ollama service initialization on agent startup
|
|
388
|
+
- ✅ Auto-download of `qwen2.5:0.5b` model (397MB)
|
|
389
|
+
- ✅ Visual status indicators (✅/❌/⚠️)
|
|
390
|
+
- ✅ JSON output support for programmatic monitoring
|
|
391
|
+
- ✅ Repository cleanup (removed sensitive data and internal reports)
|
|
392
|
+
|
|
393
|
+
### v0.8.x (2026-03-12)
|
|
394
|
+
- ✅ Implemented comprehensive audit system
|
|
395
|
+
- ✅ Tiered verification strategy (Gateway → Ollama → Rule)
|
|
396
|
+
- ✅ Async audit queue with retry mechanism
|
|
397
|
+
- ✅ Security fixes (shell injection, promise rejection handling)
|
|
398
|
+
- ✅ Platform integration with thinking verification
|
|
399
|
+
|
|
212
400
|
## Roadmap
|
|
213
401
|
|
|
214
402
|
- [ ] **Phase 0.5** — Internal multi-agent cluster with real API/tool workloads
|