@claude-flow/cli 3.5.1 → 3.5.3
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 +156 -26
- package/dist/src/appliance/gguf-engine.d.ts +91 -0
- package/dist/src/appliance/gguf-engine.d.ts.map +1 -0
- package/dist/src/appliance/gguf-engine.js +425 -0
- package/dist/src/appliance/gguf-engine.js.map +1 -0
- package/dist/src/appliance/ruvllm-bridge.d.ts +102 -0
- package/dist/src/appliance/ruvllm-bridge.d.ts.map +1 -0
- package/dist/src/appliance/ruvllm-bridge.js +292 -0
- package/dist/src/appliance/ruvllm-bridge.js.map +1 -0
- package/dist/src/appliance/rvfa-builder.d.ts +44 -0
- package/dist/src/appliance/rvfa-builder.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-builder.js +329 -0
- package/dist/src/appliance/rvfa-builder.js.map +1 -0
- package/dist/src/appliance/rvfa-distribution.d.ts +97 -0
- package/dist/src/appliance/rvfa-distribution.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-distribution.js +370 -0
- package/dist/src/appliance/rvfa-distribution.js.map +1 -0
- package/dist/src/appliance/rvfa-format.d.ts +111 -0
- package/dist/src/appliance/rvfa-format.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-format.js +393 -0
- package/dist/src/appliance/rvfa-format.js.map +1 -0
- package/dist/src/appliance/rvfa-runner.d.ts +69 -0
- package/dist/src/appliance/rvfa-runner.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-runner.js +237 -0
- package/dist/src/appliance/rvfa-runner.js.map +1 -0
- package/dist/src/appliance/rvfa-signing.d.ts +123 -0
- package/dist/src/appliance/rvfa-signing.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-signing.js +347 -0
- package/dist/src/appliance/rvfa-signing.js.map +1 -0
- package/dist/src/commands/appliance-advanced.d.ts +9 -0
- package/dist/src/commands/appliance-advanced.d.ts.map +1 -0
- package/dist/src/commands/appliance-advanced.js +215 -0
- package/dist/src/commands/appliance-advanced.js.map +1 -0
- package/dist/src/commands/appliance.d.ts +8 -0
- package/dist/src/commands/appliance.d.ts.map +1 -0
- package/dist/src/commands/appliance.js +406 -0
- package/dist/src/commands/appliance.js.map +1 -0
- package/dist/src/commands/benchmark.js +2 -2
- package/dist/src/commands/benchmark.js.map +1 -1
- package/dist/src/commands/claims.js +1 -1
- package/dist/src/commands/claims.js.map +1 -1
- package/dist/src/commands/config.js +1 -1
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/deployment.js +1 -1
- package/dist/src/commands/deployment.js.map +1 -1
- package/dist/src/commands/doctor.d.ts.map +1 -1
- package/dist/src/commands/doctor.js +25 -42
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/embeddings.js +1 -1
- package/dist/src/commands/embeddings.js.map +1 -1
- package/dist/src/commands/hooks.js +1 -1
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/index.d.ts +2 -0
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +6 -0
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/init.js +11 -11
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/memory.d.ts.map +1 -1
- package/dist/src/commands/memory.js +24 -0
- package/dist/src/commands/memory.js.map +1 -1
- package/dist/src/commands/neural.js +1 -1
- package/dist/src/commands/neural.js.map +1 -1
- package/dist/src/commands/performance.js +1 -1
- package/dist/src/commands/performance.js.map +1 -1
- package/dist/src/commands/plugins.js +1 -1
- package/dist/src/commands/plugins.js.map +1 -1
- package/dist/src/commands/providers.js +1 -1
- package/dist/src/commands/providers.js.map +1 -1
- package/dist/src/commands/security.js +1 -1
- package/dist/src/commands/security.js.map +1 -1
- package/dist/src/commands/start.js +11 -11
- package/dist/src/commands/start.js.map +1 -1
- package/dist/src/commands/status.js +3 -3
- package/dist/src/commands/status.js.map +1 -1
- package/dist/src/commands/transfer-store.js +1 -1
- package/dist/src/commands/transfer-store.js.map +1 -1
- package/dist/src/index.js +2 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/init/claudemd-generator.js +1 -1
- package/dist/src/init/claudemd-generator.js.map +1 -1
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +20 -46
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/settings-generator.d.ts.map +1 -1
- package/dist/src/init/settings-generator.js +68 -40
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/init/statusline-generator.d.ts +1 -1
- package/dist/src/init/statusline-generator.js +4 -4
- package/dist/src/mcp-tools/coordination-tools.js +1 -1
- package/dist/src/mcp-tools/coordination-tools.js.map +1 -1
- package/dist/src/mcp-tools/daa-tools.js +5 -5
- package/dist/src/mcp-tools/daa-tools.js.map +1 -1
- package/dist/src/mcp-tools/github-tools.js +2 -2
- package/dist/src/mcp-tools/github-tools.js.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.js +1 -1
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/mcp-tools/performance-tools.js +1 -1
- package/dist/src/mcp-tools/performance-tools.js.map +1 -1
- package/dist/src/mcp-tools/system-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/system-tools.js +21 -6
- package/dist/src/mcp-tools/system-tools.js.map +1 -1
- package/dist/src/memory/memory-initializer.d.ts +6 -0
- package/dist/src/memory/memory-initializer.d.ts.map +1 -1
- package/dist/src/memory/memory-initializer.js +54 -2
- package/dist/src/memory/memory-initializer.js.map +1 -1
- package/dist/src/runtime/headless.js +3 -3
- package/dist/src/runtime/headless.js.map +1 -1
- package/dist/src/services/claim-service.js +1 -1
- package/dist/src/services/claim-service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# 🌊
|
|
1
|
+
# 🌊 RuFlo v3.5: Enterprise AI Orchestration Platform
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
|
-

|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -143,7 +143,7 @@ flowchart TB
|
|
|
143
143
|
|
|
144
144
|
```bash
|
|
145
145
|
# Use RuVector via Ruflo
|
|
146
|
-
npx ruflo@
|
|
146
|
+
npx ruflo@latest hooks intelligence --status
|
|
147
147
|
```
|
|
148
148
|
|
|
149
149
|
</details>
|
|
@@ -158,7 +158,7 @@ curl -fsSL https://cdn.jsdelivr.net/gh/ruvnet/claude-flow@main/scripts/install.s
|
|
|
158
158
|
curl -fsSL https://cdn.jsdelivr.net/gh/ruvnet/claude-flow@main/scripts/install.sh | bash -s -- --full
|
|
159
159
|
|
|
160
160
|
# Or via npx
|
|
161
|
-
npx ruflo@
|
|
161
|
+
npx ruflo@latest init --wizard
|
|
162
162
|
```
|
|
163
163
|
|
|
164
164
|
---
|
|
@@ -481,14 +481,14 @@ curl ... | bash -s -- --full
|
|
|
481
481
|
|
|
482
482
|
```bash
|
|
483
483
|
# Quick start (no install needed)
|
|
484
|
-
npx ruflo@
|
|
484
|
+
npx ruflo@latest init
|
|
485
485
|
|
|
486
486
|
# Or install globally
|
|
487
|
-
npm install -g ruflo@
|
|
487
|
+
npm install -g ruflo@latest
|
|
488
488
|
ruflo init
|
|
489
489
|
|
|
490
490
|
# With Bun (faster)
|
|
491
|
-
bunx ruflo@
|
|
491
|
+
bunx ruflo@latest init
|
|
492
492
|
```
|
|
493
493
|
|
|
494
494
|
#### Install Profiles
|
|
@@ -500,7 +500,7 @@ bunx ruflo@alpha init
|
|
|
500
500
|
|
|
501
501
|
```bash
|
|
502
502
|
# Minimal install (skip ML/embeddings)
|
|
503
|
-
npm install -g ruflo@
|
|
503
|
+
npm install -g ruflo@latest --omit=optional
|
|
504
504
|
```
|
|
505
505
|
|
|
506
506
|
<details>
|
|
@@ -512,13 +512,13 @@ Ruflo supports both **Claude Code** and **OpenAI Codex CLI** via the [@claude-fl
|
|
|
512
512
|
|
|
513
513
|
```bash
|
|
514
514
|
# Initialize for Codex CLI (creates AGENTS.md instead of CLAUDE.md)
|
|
515
|
-
npx ruflo@
|
|
515
|
+
npx ruflo@latest init --codex
|
|
516
516
|
|
|
517
517
|
# Full Codex setup with all 137+ skills
|
|
518
|
-
npx ruflo@
|
|
518
|
+
npx ruflo@latest init --codex --full
|
|
519
519
|
|
|
520
520
|
# Initialize for both platforms (dual mode)
|
|
521
|
-
npx ruflo@
|
|
521
|
+
npx ruflo@latest init --dual
|
|
522
522
|
```
|
|
523
523
|
|
|
524
524
|
### Platform Comparison
|
|
@@ -661,16 +661,16 @@ The **Intelligence Loop** (ADR-050) automates this cycle through hooks. Each ses
|
|
|
661
661
|
|
|
662
662
|
```bash
|
|
663
663
|
# Initialize project
|
|
664
|
-
npx ruflo@
|
|
664
|
+
npx ruflo@latest init
|
|
665
665
|
|
|
666
666
|
# Start MCP server for Claude Code integration
|
|
667
|
-
npx ruflo@
|
|
667
|
+
npx ruflo@latest mcp start
|
|
668
668
|
|
|
669
669
|
# Run a task with agents
|
|
670
|
-
npx ruflo@
|
|
670
|
+
npx ruflo@latest --agent coder --task "Implement user authentication"
|
|
671
671
|
|
|
672
672
|
# List available agents
|
|
673
|
-
npx ruflo@
|
|
673
|
+
npx ruflo@latest --list
|
|
674
674
|
```
|
|
675
675
|
|
|
676
676
|
### Upgrading
|
|
@@ -2510,7 +2510,7 @@ Claude Code pipes JSON session data via **stdin** to the statusline script after
|
|
|
2510
2510
|
|
|
2511
2511
|
**Setup (Automatic):**
|
|
2512
2512
|
|
|
2513
|
-
Run `npx ruflo@
|
|
2513
|
+
Run `npx ruflo@latest init` — this generates `.claude/settings.json` with the correct statusline config and creates the helper script at `.claude/helpers/statusline.cjs`.
|
|
2514
2514
|
|
|
2515
2515
|
The generated config uses a **fast local script** (no `npx` cold-start):
|
|
2516
2516
|
```json
|
|
@@ -2528,7 +2528,7 @@ The generated config uses a **fast local script** (no `npx` cold-start):
|
|
|
2528
2528
|
|
|
2529
2529
|
If your statusline is not updating, run the upgrade command to regenerate helpers and fix the config:
|
|
2530
2530
|
```bash
|
|
2531
|
-
npx ruflo@
|
|
2531
|
+
npx ruflo@latest init --update --settings
|
|
2532
2532
|
```
|
|
2533
2533
|
|
|
2534
2534
|
This removes invalid config fields and regenerates the statusline helper with stdin support.
|
|
@@ -3030,6 +3030,136 @@ sqlite3 .claude-flow/data/transcript-archive.db \
|
|
|
3030
3030
|
|
|
3031
3031
|
---
|
|
3032
3032
|
|
|
3033
|
+
## 💾 Storage: RVF (RuVector Format)
|
|
3034
|
+
|
|
3035
|
+
Ruflo uses RVF — a compact binary storage format that replaces the 18MB sql.js WASM dependency with pure TypeScript. No native compilation, no WASM downloads, works everywhere Node.js runs.
|
|
3036
|
+
|
|
3037
|
+
<details>
|
|
3038
|
+
<summary>💾 <strong>RVF Storage</strong> — Binary format, vector search, migration, and auto-selection</summary>
|
|
3039
|
+
|
|
3040
|
+
### Why RVF?
|
|
3041
|
+
|
|
3042
|
+
Previous versions shipped sql.js (18MB WASM blob) for persistent storage. This caused slow cold starts, large installs, and compatibility issues on ARM/Alpine. RVF eliminates all of that:
|
|
3043
|
+
|
|
3044
|
+
| | Before (sql.js) | After (RVF) |
|
|
3045
|
+
|---|---|---|
|
|
3046
|
+
| **Install size** | +18MB WASM | 0 extra deps |
|
|
3047
|
+
| **Cold start** | ~2s (WASM compile) | <50ms |
|
|
3048
|
+
| **Platform support** | x86/ARM issues | Runs everywhere |
|
|
3049
|
+
| **Native deps** | Optional hnswlib-node | Pure TypeScript fallback |
|
|
3050
|
+
|
|
3051
|
+
### How it works
|
|
3052
|
+
|
|
3053
|
+
RVF files use a simple binary layout: a 4-byte magic header (`RVF\0`), a JSON metadata section, then packed entries. Each module has its own format variant:
|
|
3054
|
+
|
|
3055
|
+
| Format | Magic Bytes | Used By | Purpose |
|
|
3056
|
+
|--------|-------------|---------|---------|
|
|
3057
|
+
| `RVF\0` | `0x52564600` | Memory backend | Entries + HNSW index |
|
|
3058
|
+
| `RVEC` | `0x52564543` | Embedding cache | Cached vectors with LRU eviction |
|
|
3059
|
+
| `RVFL` | `0x5256464C` | Event log | Append-only domain events |
|
|
3060
|
+
| `RVLS` | — | Learning store | SONA patterns + trajectories |
|
|
3061
|
+
|
|
3062
|
+
### Storage auto-selection
|
|
3063
|
+
|
|
3064
|
+
You don't need to pick a backend. The `DatabaseProvider` tries each option in order and uses the first one available:
|
|
3065
|
+
|
|
3066
|
+
```
|
|
3067
|
+
RVF (pure TypeScript) → better-sqlite3 (native) → sql.js (WASM) → JSON (fallback)
|
|
3068
|
+
```
|
|
3069
|
+
|
|
3070
|
+
RVF is always available since it has zero dependencies, so it wins by default. If you have `better-sqlite3` installed (e.g., for advanced queries), it gets priority.
|
|
3071
|
+
|
|
3072
|
+
### Vector search with HnswLite
|
|
3073
|
+
|
|
3074
|
+
RVF includes `HnswLite` — a pure TypeScript implementation of the HNSW (Hierarchical Navigable Small World) algorithm for fast nearest-neighbor search. It's used automatically when storing entries with embeddings.
|
|
3075
|
+
|
|
3076
|
+
```typescript
|
|
3077
|
+
import { RvfBackend } from '@claude-flow/memory';
|
|
3078
|
+
|
|
3079
|
+
const backend = new RvfBackend({ databasePath: './memory.rvf' });
|
|
3080
|
+
await backend.initialize();
|
|
3081
|
+
|
|
3082
|
+
// Store entries — embeddings are indexed automatically
|
|
3083
|
+
await backend.store({ id: '1', key: 'auth-pattern', content: '...', embedding: vector });
|
|
3084
|
+
|
|
3085
|
+
// Search by similarity
|
|
3086
|
+
const results = await backend.search({ embedding: queryVector, limit: 10 });
|
|
3087
|
+
```
|
|
3088
|
+
|
|
3089
|
+
Supports cosine, dot product, and Euclidean distance metrics. For large datasets (100K+ entries), install `hnswlib-node` for the native implementation — the backend switches automatically.
|
|
3090
|
+
|
|
3091
|
+
### Migrating from older formats
|
|
3092
|
+
|
|
3093
|
+
The `RvfMigrator` converts between JSON files, SQLite databases, and RVF:
|
|
3094
|
+
|
|
3095
|
+
```typescript
|
|
3096
|
+
import { RvfMigrator } from '@claude-flow/memory';
|
|
3097
|
+
|
|
3098
|
+
// Auto-detect format and migrate
|
|
3099
|
+
await RvfMigrator.autoMigrate('./old-memory.db', './memory.rvf');
|
|
3100
|
+
|
|
3101
|
+
// Or be explicit
|
|
3102
|
+
await RvfMigrator.fromJsonFile('./backup.json', './memory.rvf');
|
|
3103
|
+
await RvfMigrator.fromSqlite('./legacy.db', './memory.rvf');
|
|
3104
|
+
|
|
3105
|
+
// Export back to JSON for inspection
|
|
3106
|
+
await RvfMigrator.toJsonFile('./memory.rvf', './export.json');
|
|
3107
|
+
```
|
|
3108
|
+
|
|
3109
|
+
Format detection works by reading the first few bytes of the file — no file extension guessing.
|
|
3110
|
+
|
|
3111
|
+
### Crash safety
|
|
3112
|
+
|
|
3113
|
+
All write operations use atomic writes: data goes to a temporary file first, then a single `rename()` call swaps it into place. If the process crashes mid-write, the old file stays intact.
|
|
3114
|
+
|
|
3115
|
+
- **Memory backend**: `file.rvf.tmp` → `file.rvf`
|
|
3116
|
+
- **Embedding cache**: `file.rvec.tmp.{random}` → `file.rvec`
|
|
3117
|
+
- **Event log**: Append-only (no overwrite needed)
|
|
3118
|
+
|
|
3119
|
+
### SONA learning persistence
|
|
3120
|
+
|
|
3121
|
+
The `PersistentSonaCoordinator` stores learning patterns and trajectories in RVF format, so agents retain knowledge across sessions:
|
|
3122
|
+
|
|
3123
|
+
```typescript
|
|
3124
|
+
import { PersistentSonaCoordinator } from '@claude-flow/memory';
|
|
3125
|
+
|
|
3126
|
+
const sona = new PersistentSonaCoordinator({
|
|
3127
|
+
storePath: './data/sona-learning.rvls',
|
|
3128
|
+
});
|
|
3129
|
+
await sona.initialize();
|
|
3130
|
+
|
|
3131
|
+
// Patterns survive restarts
|
|
3132
|
+
const similar = sona.findSimilarPatterns(embedding, 5);
|
|
3133
|
+
sona.storePattern('routing', embedding);
|
|
3134
|
+
await sona.shutdown(); // persists to disk
|
|
3135
|
+
```
|
|
3136
|
+
|
|
3137
|
+
### Security
|
|
3138
|
+
|
|
3139
|
+
RVF validates inputs at every boundary:
|
|
3140
|
+
|
|
3141
|
+
- **Path validation** — null bytes and traversal attempts are rejected
|
|
3142
|
+
- **Header validation** — corrupted files are detected before parsing
|
|
3143
|
+
- **Payload limits** — event log entries cap at 100MB to prevent memory exhaustion
|
|
3144
|
+
- **Dimension validation** — embedding dimensions must be between 1 and 10,000
|
|
3145
|
+
- **Concurrent write protection** — a lock flag prevents overlapping disk flushes
|
|
3146
|
+
|
|
3147
|
+
### Configuration
|
|
3148
|
+
|
|
3149
|
+
```bash
|
|
3150
|
+
# Environment variables
|
|
3151
|
+
CLAUDE_FLOW_MEMORY_BACKEND=hybrid # auto-selects RVF
|
|
3152
|
+
CLAUDE_FLOW_MEMORY_PATH=./data/memory
|
|
3153
|
+
|
|
3154
|
+
# Or via CLI
|
|
3155
|
+
ruflo memory init --force
|
|
3156
|
+
ruflo config set memory.backend hybrid
|
|
3157
|
+
```
|
|
3158
|
+
|
|
3159
|
+
</details>
|
|
3160
|
+
|
|
3161
|
+
---
|
|
3162
|
+
|
|
3033
3163
|
## 🧠 Intelligence & Learning
|
|
3034
3164
|
|
|
3035
3165
|
Self-learning hooks, pattern recognition, and intelligent task routing.
|
|
@@ -4279,21 +4409,21 @@ console.log(results);
|
|
|
4279
4409
|
**CLI Commands:**
|
|
4280
4410
|
```bash
|
|
4281
4411
|
# Initialize memory database
|
|
4282
|
-
npx ruflo@
|
|
4412
|
+
npx ruflo@latest memory init --force
|
|
4283
4413
|
|
|
4284
4414
|
# Store patterns
|
|
4285
|
-
npx ruflo@
|
|
4286
|
-
npx ruflo@
|
|
4415
|
+
npx ruflo@latest memory store --key "pattern-auth" --value "JWT authentication with refresh tokens"
|
|
4416
|
+
npx ruflo@latest memory store --key "pattern-cache" --value "Redis caching for API responses"
|
|
4287
4417
|
|
|
4288
4418
|
# Build HNSW index for 150x-12,500x faster search
|
|
4289
|
-
npx ruflo@
|
|
4419
|
+
npx ruflo@latest memory search --query "authentication" --build-hnsw
|
|
4290
4420
|
|
|
4291
4421
|
# Semantic search (uses HNSW if built)
|
|
4292
|
-
npx ruflo@
|
|
4422
|
+
npx ruflo@latest memory search --query "how to cache data" --limit 5
|
|
4293
4423
|
|
|
4294
4424
|
# List and manage entries
|
|
4295
|
-
npx ruflo@
|
|
4296
|
-
npx ruflo@
|
|
4425
|
+
npx ruflo@latest memory list --namespace patterns
|
|
4426
|
+
npx ruflo@latest memory stats
|
|
4297
4427
|
```
|
|
4298
4428
|
|
|
4299
4429
|
</details>
|
|
@@ -5973,7 +6103,7 @@ Domain-Driven Design with bounded contexts, clean architecture, and measured per
|
|
|
5973
6103
|
| Module | Purpose | Key Features |
|
|
5974
6104
|
|--------|---------|--------------|
|
|
5975
6105
|
| `@claude-flow/hooks` | Event-driven lifecycle | ReasoningBank, 27 hooks, pattern learning |
|
|
5976
|
-
| `@claude-flow/memory` | Unified vector storage | AgentDB,
|
|
6106
|
+
| `@claude-flow/memory` | Unified vector storage | AgentDB, RVF binary format, HnswLite, RvfMigrator, SONA persistence, LearningBridge, MemoryGraph |
|
|
5977
6107
|
| `@claude-flow/security` | CVE remediation | Input validation, path security, AIDefence |
|
|
5978
6108
|
| `@claude-flow/swarm` | Multi-agent coordination | 6 topologies, Byzantine consensus, auto-scaling |
|
|
5979
6109
|
| `@claude-flow/plugins` | WASM extensions | RuVector plugins, semantic search, intent routing |
|
|
@@ -5981,7 +6111,7 @@ Domain-Driven Design with bounded contexts, clean architecture, and measured per
|
|
|
5981
6111
|
| `@claude-flow/neural` | Self-learning | SONA, 9 RL algorithms, EWC++ memory preservation |
|
|
5982
6112
|
| `@claude-flow/testing` | Quality assurance | London School TDD, Vitest, fixtures, mocks |
|
|
5983
6113
|
| `@claude-flow/deployment` | Release automation | Versioning, changelogs, NPM publishing |
|
|
5984
|
-
| `@claude-flow/shared` | Common utilities | Types, validation schemas, constants |
|
|
6114
|
+
| `@claude-flow/shared` | Common utilities | Types, validation schemas, RvfEventLog, constants |
|
|
5985
6115
|
| `@claude-flow/browser` | Browser automation | 59 MCP tools, element refs, trajectory learning |
|
|
5986
6116
|
|
|
5987
6117
|
### Architecture Principles
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ruvLLM GGUF Inference Engine -- Pure Node.js GGUF Model Interface
|
|
3
|
+
*
|
|
4
|
+
* Provides:
|
|
5
|
+
* 1. GGUF binary header parsing (metadata without loading weights)
|
|
6
|
+
* 2. Model loading abstraction (node-llama-cpp when available, metadata-only fallback)
|
|
7
|
+
* 3. Token generation interface with async iterator streaming
|
|
8
|
+
* 4. KV-cache persistence to RVF-compatible binary format
|
|
9
|
+
*
|
|
10
|
+
* Zero external dependencies. node-llama-cpp is an optional peer.
|
|
11
|
+
*
|
|
12
|
+
* @module @claude-flow/cli/appliance/gguf-engine
|
|
13
|
+
*/
|
|
14
|
+
export interface GgufMetadata {
|
|
15
|
+
magic: string;
|
|
16
|
+
version: number;
|
|
17
|
+
tensorCount: number;
|
|
18
|
+
kvCount: number;
|
|
19
|
+
architecture?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
contextLength?: number;
|
|
22
|
+
embeddingLength?: number;
|
|
23
|
+
blockCount?: number;
|
|
24
|
+
vocabSize?: number;
|
|
25
|
+
quantization?: string;
|
|
26
|
+
fileSize: number;
|
|
27
|
+
metadata: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
export interface GgufEngineConfig {
|
|
30
|
+
contextSize?: number;
|
|
31
|
+
maxTokens?: number;
|
|
32
|
+
temperature?: number;
|
|
33
|
+
kvCachePath?: string;
|
|
34
|
+
verbose?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface GenerateRequest {
|
|
37
|
+
prompt: string;
|
|
38
|
+
model?: string;
|
|
39
|
+
maxTokens?: number;
|
|
40
|
+
temperature?: number;
|
|
41
|
+
stream?: boolean;
|
|
42
|
+
stopSequences?: string[];
|
|
43
|
+
}
|
|
44
|
+
export interface GenerateResponse {
|
|
45
|
+
text: string;
|
|
46
|
+
model: string;
|
|
47
|
+
tokensUsed: number;
|
|
48
|
+
latencyMs: number;
|
|
49
|
+
metadataOnly: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Parse the header and metadata from a GGUF file without loading tensors.
|
|
53
|
+
* Reads only the first 256 KB of the file.
|
|
54
|
+
*/
|
|
55
|
+
export declare function parseGgufHeader(path: string): Promise<GgufMetadata>;
|
|
56
|
+
export declare class GgufEngine {
|
|
57
|
+
private config;
|
|
58
|
+
private llamaCpp;
|
|
59
|
+
private llamaModel;
|
|
60
|
+
private llamaContext;
|
|
61
|
+
private loadedModels;
|
|
62
|
+
private activeModelPath;
|
|
63
|
+
private kvCache;
|
|
64
|
+
constructor(config: GgufEngineConfig);
|
|
65
|
+
/** Probe for node-llama-cpp availability. */
|
|
66
|
+
initialize(): Promise<void>;
|
|
67
|
+
/** Parse GGUF header and optionally load the model for inference. */
|
|
68
|
+
loadModel(path: string): Promise<GgufMetadata>;
|
|
69
|
+
/** Generate text. Delegates to node-llama-cpp or returns a metadata-only stub. */
|
|
70
|
+
generate(request: GenerateRequest): Promise<GenerateResponse>;
|
|
71
|
+
/** Stream tokens via async iterator. Falls back to yielding full response. */
|
|
72
|
+
stream(request: GenerateRequest): AsyncGenerator<string>;
|
|
73
|
+
/**
|
|
74
|
+
* Persist the KV cache to an RVF-compatible binary file.
|
|
75
|
+
* Format: RVKV magic | version u32 | model SHA-256 (32B) | entry count u32
|
|
76
|
+
* entries: [key_len u32, key, val_len u32, val] | footer SHA-256 (32B)
|
|
77
|
+
*/
|
|
78
|
+
persistKvCache(outputPath: string): Promise<void>;
|
|
79
|
+
/** Restore KV cache from an RVF-compatible binary file. */
|
|
80
|
+
loadKvCache(inputPath: string): Promise<void>;
|
|
81
|
+
/** Return metadata for all loaded models. */
|
|
82
|
+
getLoadedModels(): GgufMetadata[];
|
|
83
|
+
/** Store a key-value pair in the in-memory KV cache. */
|
|
84
|
+
setKvEntry(key: string, value: Buffer): void;
|
|
85
|
+
/** Retrieve a key-value pair from the in-memory KV cache. */
|
|
86
|
+
getKvEntry(key: string): Buffer | undefined;
|
|
87
|
+
/** Release resources, unload models, and optionally persist the KV cache. */
|
|
88
|
+
shutdown(): Promise<void>;
|
|
89
|
+
private tryLoadLlamaCpp;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=gguf-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gguf-engine.d.ts","sourceRoot":"","sources":["../../../src/appliance/gguf-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAmBH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;CACvB;AA6ED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAWzE;AAyED,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,QAAQ,CAAa;IAC7B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,YAAY,CAAwC;IAC5D,OAAO,CAAC,eAAe,CAAuB;IAC9C,OAAO,CAAC,OAAO,CAAkC;gBAErC,MAAM,EAAE,gBAAgB;IAUpC,6CAA6C;IACvC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAOjC,qEAAqE;IAC/D,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAqBpD,kFAAkF;IAC5E,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA6CnE,8EAA8E;IACvE,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,cAAc,CAAC,MAAM,CAAC;IAuB/D;;;;OAIG;IACG,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA0BvD,2DAA2D;IACrD,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmCnD,6CAA6C;IAC7C,eAAe,IAAI,YAAY,EAAE;IAEjC,wDAAwD;IACxD,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAE5C,6DAA6D;IAC7D,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAE3C,6EAA6E;IACvE,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;YAiBjB,eAAe;CAI9B"}
|