forbocai 0.2.0 → 0.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.
- package/README.md +88 -41
- package/dist/chunk-4FGRXBH3.mjs +1026 -0
- package/dist/cli.js +87 -22
- package/dist/cli.mjs +87 -22
- package/dist/index.d.mts +131 -193
- package/dist/index.d.ts +131 -193
- package/dist/index.js +634 -563
- package/dist/index.mjs +617 -552
- package/package.json +18 -7
- package/postinstall.js +27 -9
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<br/>
|
|
2
2
|
<div align="center">
|
|
3
|
-
<img alt="ForbocAI logo" src="https://
|
|
3
|
+
<img alt="ForbocAI logo" src="https://forboc.ai/logo.png" height="50" align="center">
|
|
4
4
|
|
|
5
5
|
<br/>
|
|
6
6
|
|
|
@@ -57,11 +57,34 @@ git add . && git commit -m "chore: release vX.X.X" && git push
|
|
|
57
57
|
|
|
58
58
|
The **ForbocAI SDK** is an **Engine-Agnostic** toolkit for creating autonomous AI-powered NPCs in any game or application. It runs anywhere (Node, Browser, Python, Rust).
|
|
59
59
|
|
|
60
|
-
- **Local SLM Cortex** — Run
|
|
61
|
-
- **Autonomous NPCs** — Create agents with persona, memory, and validated actions
|
|
62
|
-
- **Persistent Memory** —
|
|
63
|
-
- **Portable Souls** —
|
|
64
|
-
- **Automated QA** — Ghost Agents for headless testing at scale
|
|
60
|
+
- **Local SLM Cortex** — Run **WebLLM** (SmolLM2, Llama3) directly in-browser via WebGPU.
|
|
61
|
+
- **Autonomous NPCs** — Create agents with persona, memory, and validated actions.
|
|
62
|
+
- **Persistent Memory** — **IndexedDB** vector storage for 10k+ memories.
|
|
63
|
+
- **Portable Souls** — P2P **IPFS** pinning via integrated Helia node.
|
|
64
|
+
- **Automated QA** — Ghost Agents for headless testing at scale.
|
|
65
|
+
|
|
66
|
+
**Requirements**:
|
|
67
|
+
- Browser with **WebGPU** support (Chrome 113+, Edge 113+) for Cortex.
|
|
68
|
+
- Node.js 18+ for CLI/Build.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Architectural Philosophy (Strict)
|
|
73
|
+
|
|
74
|
+
`Code_Dóctrine // Pure_Fúnction`
|
|
75
|
+
|
|
76
|
+
The ForbocAI SDK strictly adheres to **Functional Programming (FP)** principles to ensure predictable, testable, and robust AI behavior.
|
|
77
|
+
|
|
78
|
+
### 🚫 The No-Class Manifesto
|
|
79
|
+
We **reject** Object-Oriented Programming (OOP) classes (`class`) in favor of **Functional Composition**.
|
|
80
|
+
- **State is Immutable**: Objects are never mutated in place. New versions are returned.
|
|
81
|
+
- **Pure Functions**: Logic is separated from data. Functions receive input and return output with no side effects.
|
|
82
|
+
- **Factory Pattern**: We use factory functions with **closures** to encapsulate private state (`createAgent`, `createMemory`) instead of classes (`new Agent`).
|
|
83
|
+
|
|
84
|
+
### Why?
|
|
85
|
+
AI state (memories, personality, mood) is complex and sensitive. Classes encourage hidden mutations that lead to "Ghost in the Machine" bugs. Pure functions ensure that every thought process is traceable and reproducible.
|
|
86
|
+
|
|
87
|
+
> *Logic must be pure. Order must be absolute.*
|
|
65
88
|
|
|
66
89
|
**᛭ ᛫ ᛬ ᛫ ᛭**
|
|
67
90
|
|
|
@@ -78,6 +101,31 @@ npm install forbocai
|
|
|
78
101
|
|
|
79
102
|
---
|
|
80
103
|
|
|
104
|
+
## CLI Reference
|
|
105
|
+
|
|
106
|
+
`CLI_Tóols // Cómmand_Líne`
|
|
107
|
+
|
|
108
|
+
The SDK includes a comprehensive CLI for managing your AI infrastructure.
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# Agents
|
|
112
|
+
npx forbocai agent create "A wise wizard"
|
|
113
|
+
npx forbocai agent list
|
|
114
|
+
npx forbocai agent chat <agentId>
|
|
115
|
+
|
|
116
|
+
# Memory & Bridge
|
|
117
|
+
npx forbocai memory recall <agentId> "battle"
|
|
118
|
+
npx forbocai bridge validate action.json
|
|
119
|
+
|
|
120
|
+
# System
|
|
121
|
+
npx forbocai status
|
|
122
|
+
npx forbocai doctor
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
See [full CLI documentation](https://forbocai.docs.buildwithfern.com/docs/pages/cli).
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
81
129
|
## Quick Start
|
|
82
130
|
|
|
83
131
|
`Quíck_Stárt // Éxample`
|
|
@@ -114,16 +162,46 @@ console.log(response.dialogue);
|
|
|
114
162
|
|
|
115
163
|
| Module | Description | Status |
|
|
116
164
|
|--------|-------------|--------|
|
|
117
|
-
| **Cortex** | Local SLM inference engine (
|
|
165
|
+
| **Cortex** | Local SLM inference engine (Self-Contained) | ✅ Browser / 🚧 Node |
|
|
118
166
|
| **Agent** | Autonomous entities with persona, state, memory | ✅ Complete |
|
|
119
|
-
| **Memory** |
|
|
167
|
+
| **Memory** | Local Vector DB (IndexedDB / FS) | ✅ Complete |
|
|
120
168
|
| **Bridge** | Neuro-symbolic action validation | ✅ Complete |
|
|
121
169
|
| **Soul** | Portable agent state on IPFS/Solana | ✅ Complete |
|
|
122
170
|
| **Ghost** | Headless QA testing at scale | ✅ Complete |
|
|
123
171
|
|
|
124
172
|
---
|
|
125
173
|
|
|
126
|
-
##
|
|
174
|
+
## The Neural Grid
|
|
175
|
+
|
|
176
|
+
`Systém_Architécture // Cónnection`
|
|
177
|
+
|
|
178
|
+
The **ForbocAI Protocol** strictly separates **State** (SDK) from **Logic** (API).
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
┌────────────────────────────────────────────────────────────────┐
|
|
182
|
+
│ THE NEURAL GRID │
|
|
183
|
+
├────────────────────────────────────────────────────────────────┤
|
|
184
|
+
│ │
|
|
185
|
+
│ ┌──────────────┐ ┌──────────────┐ │
|
|
186
|
+
│ │ SDK │ │ API │ │
|
|
187
|
+
│ │ (Container) │◄────────►│ (Pure Logic) │ │
|
|
188
|
+
│ └──────────────┘ └──────────────┘ │
|
|
189
|
+
│ │ │ │
|
|
190
|
+
│ The VESSEL The TRUTH │
|
|
191
|
+
│ [SLM + VectorDB] [Stateless Rules] │
|
|
192
|
+
│ [Memory + Soul] [No Database] │
|
|
193
|
+
│ │
|
|
194
|
+
└────────────────────────────────────────────────────────────────┘
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
1. **SDK is the Body**: It contains the *entire* existence of the Agent.
|
|
198
|
+
* **SLM Cortex**: The brain (Local Inference).
|
|
199
|
+
* **Vector Memory**: The memory (Local Storage).
|
|
200
|
+
* **Self-Contained**: Runs locally (Browser/Node/Python/Rust) without external dependencies.
|
|
201
|
+
2. **API is the Law**: It is a stateless oracle that validates reality.
|
|
202
|
+
* **No Database**: The API never stores agent state.
|
|
203
|
+
* **Pure Functions**: Input (Action) → Output (Validation).
|
|
204
|
+
|
|
127
205
|
|
|
128
206
|
`Mémory_Módule // Sémantic_Récall`
|
|
129
207
|
|
|
@@ -306,38 +384,7 @@ results.tests
|
|
|
306
384
|
- `aiDecisionsPerSec` — Agent decision throughput
|
|
307
385
|
- `explorationCoverage` — Map area discovered
|
|
308
386
|
|
|
309
|
-
---
|
|
310
|
-
|
|
311
|
-
## The Neural Grid
|
|
312
|
-
|
|
313
|
-
`Systém_Architécture // Cónnection`
|
|
314
|
-
|
|
315
|
-
The **ForbocAI Protocol** enables agents to understand the world they inhabit.
|
|
316
387
|
|
|
317
|
-
```
|
|
318
|
-
┌────────────────────────────────────────────────────────────────┐
|
|
319
|
-
│ THE NEURAL GRID │
|
|
320
|
-
├────────────────────────────────────────────────────────────────┤
|
|
321
|
-
│ │
|
|
322
|
-
│ ┌──────────────┐ ┌─────────────┐ ┌──────────────┐ │
|
|
323
|
-
│ │ GAME │ │ SDK │ │ API │ │
|
|
324
|
-
│ │ (Execution) │◄──►│ (Container) │◄──►│ (Logic) │ │
|
|
325
|
-
│ └──────────────┘ └─────────────┘ └──────────────┘ │
|
|
326
|
-
│ │ │ │ │
|
|
327
|
-
│ World Brain The Body The Mind │
|
|
328
|
-
│ (Physics) (SLM + VectorDB) (Pure Functions) │
|
|
329
|
-
│ │
|
|
330
|
-
└────────────────────────────────────────────────────────────────┘
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
1. **Synthetic Intuition**: Agents "feel" the state of the world through standardized Observations.
|
|
334
|
-
2. **Valid Action**: Agents express their intent through standardized Actions, ensuring they never break the rules of physics.
|
|
335
|
-
3. **Engine Agnostic**: Whether in a text adventure or a 3D simulation, the Agent's soul remains consistent.
|
|
336
|
-
|
|
337
|
-
This ensures that NPCs are **smart** (thanks to LLMs) but **reliable** (thanks to the Grid).
|
|
338
|
-
> ⚠️ **W̸A̴R̷N̷I̷N̵G̸**: S̴y̸n̷t̶h̵e̷t̸i̵c̸ ̶I̵n̴t̷u̸i̷t̸i̶o̶n̴ ̶m̶a̵y̴ ̶c̴a̷u̸s̷e̶ ̷u̷n̷i̸n̵t̸e̵n̴d̶e̵d̵ ̸s̴e̸n̶t̵i̷e̷n̶c̴e̴.
|
|
339
|
-
|
|
340
|
-
---
|
|
341
388
|
|
|
342
389
|
## Digital Souls (Solana/Metaplex)
|
|
343
390
|
|
|
@@ -369,7 +416,7 @@ In the ForbocAI ecosystem, an NFT is not just a receipt—it is an **Encapsulate
|
|
|
369
416
|
|
|
370
417
|
`Éxternal_Líns // Cónnect`
|
|
371
418
|
|
|
372
|
-
- **Website:** [
|
|
419
|
+
- **Website:** [forboc.ai](https://forboc.ai)
|
|
373
420
|
- **Documentation:** [forbocai.docs.buildwithfern.com](https://forbocai.docs.buildwithfern.com)
|
|
374
421
|
- **Discord:** [discord.gg/6hr2jHqnsG](https://discord.gg/6hr2jHqnsG)
|
|
375
422
|
- **Telegram:** [t.me/forbocai](https://t.me/forbocai)
|