forbocai 0.3.18 → 0.3.19

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 CHANGED
@@ -57,14 +57,14 @@ 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 **WebLLM** (SmolLM2, Llama3) directly in-browser via WebGPU.
60
+ - **Local SLM Cortex** — Run quantized Small Language Models (SLMs) natively via **node-llama-cpp**.
61
61
  - **Autonomous NPCs** — Create agents with persona, memory, and validated actions.
62
62
  - **Persistent Memory** — Local vector storage for semantic recall.
63
63
  - **Portable Souls** — Permanent storage (Arweave) + Solana NFTs for tradeable agent identities.
64
64
  - **Automated QA** — Ghost Agents for headless testing at scale.
65
65
 
66
66
  **Requirements**:
67
- - Browser with **WebGPU** support (Chrome 113+, Edge 113+) for Cortex.
67
+ - **Native Environment**: Node.js 18+ (Desktop/Server) or C++11 (Game Engine).
68
68
  - Node.js 18+ for CLI/Build.
69
69
 
70
70
  ---
@@ -164,7 +164,7 @@ console.log(response.dialogue);
164
164
 
165
165
  | Module | Description | Status |
166
166
  |--------|-------------|--------|
167
- | **Cortex** | Local SLM inference engine (Self-Contained) | ✅ Browser / 🚧 Node |
167
+ | **Cortex** | Local SLM inference engine (Self-Contained) | ✅ Node (Native) / 🚧 C++ (UE) |
168
168
  | **Agent** | Autonomous entities with persona, state, memory | ✅ Complete |
169
169
  | **Memory** | Local Vector DB (IndexedDB / FS) | ✅ Complete |
170
170
  | **Bridge** | Neuro-symbolic action validation | ✅ Complete |
package/dist/index.d.mts CHANGED
@@ -17,14 +17,12 @@ interface CortexStatus {
17
17
  id: string;
18
18
  model: string;
19
19
  ready: boolean;
20
- engine: 'webllm' | 'mock' | 'remote' | 'node-llama-cpp';
20
+ engine: 'mock' | 'remote' | 'node-llama-cpp';
21
21
  }
22
22
  interface ICortex {
23
23
  init(): Promise<CortexStatus>;
24
24
  complete(prompt: string, options?: CompletionOptions): Promise<string>;
25
25
  completeStream(prompt: string, options?: CompletionOptions): AsyncGenerator<string>;
26
- processObservation(observation: Observation): Promise<Directive>;
27
- generateAction(directive: Directive): Promise<AgentAction>;
28
26
  }
29
27
  interface CompletionOptions {
30
28
  temperature?: number;
package/dist/index.d.ts CHANGED
@@ -17,14 +17,12 @@ interface CortexStatus {
17
17
  id: string;
18
18
  model: string;
19
19
  ready: boolean;
20
- engine: 'webllm' | 'mock' | 'remote' | 'node-llama-cpp';
20
+ engine: 'mock' | 'remote' | 'node-llama-cpp';
21
21
  }
22
22
  interface ICortex {
23
23
  init(): Promise<CortexStatus>;
24
24
  complete(prompt: string, options?: CompletionOptions): Promise<string>;
25
25
  completeStream(prompt: string, options?: CompletionOptions): AsyncGenerator<string>;
26
- processObservation(observation: Observation): Promise<Directive>;
27
- generateAction(directive: Directive): Promise<AgentAction>;
28
26
  }
29
27
  interface CompletionOptions {
30
28
  temperature?: number;
package/dist/index.js CHANGED
@@ -202409,32 +202409,10 @@ var createNativeCortex = (config) => {
202409
202409
  return [];
202410
202410
  }
202411
202411
  };
202412
- const processObservation = async (obs) => {
202413
- const prompt = `System: You are an agent.
202414
- Observation: ${obs.content}
202415
- Task: Generete a JSON directive { "type": "...", "content": "..." }.`;
202416
- const res = await complete(prompt);
202417
- try {
202418
- return JSON.parse(res);
202419
- } catch {
202420
- return { type: "thought", content: res };
202421
- }
202422
- };
202423
- const generateAction = async (dir) => {
202424
- const prompt = `Directive: ${dir.content}. Generate JSON action.`;
202425
- const res = await complete(prompt);
202426
- try {
202427
- return JSON.parse(res);
202428
- } catch {
202429
- return { type: "idle", reason: res };
202430
- }
202431
- };
202432
202412
  return {
202433
202413
  init: init3,
202434
202414
  complete,
202435
202415
  completeStream,
202436
- processObservation,
202437
- generateAction,
202438
202416
  embed
202439
202417
  // Extended interface for private use by Memory
202440
202418
  };
package/dist/index.mjs CHANGED
@@ -147,32 +147,10 @@ var createNativeCortex = (config) => {
147
147
  return [];
148
148
  }
149
149
  };
150
- const processObservation = async (obs) => {
151
- const prompt = `System: You are an agent.
152
- Observation: ${obs.content}
153
- Task: Generete a JSON directive { "type": "...", "content": "..." }.`;
154
- const res = await complete(prompt);
155
- try {
156
- return JSON.parse(res);
157
- } catch {
158
- return { type: "thought", content: res };
159
- }
160
- };
161
- const generateAction = async (dir) => {
162
- const prompt = `Directive: ${dir.content}. Generate JSON action.`;
163
- const res = await complete(prompt);
164
- try {
165
- return JSON.parse(res);
166
- } catch {
167
- return { type: "idle", reason: res };
168
- }
169
- };
170
150
  return {
171
151
  init: init2,
172
152
  complete,
173
153
  completeStream,
174
- processObservation,
175
- generateAction,
176
154
  embed
177
155
  // Extended interface for private use by Memory
178
156
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forbocai",
3
- "version": "0.3.18",
3
+ "version": "0.3.19",
4
4
  "license": "UNLICENSED",
5
5
  "description": "The Infrastructure Layer for Autonomous AI Characters",
6
6
  "main": "dist/index.js",
@@ -21,11 +21,9 @@
21
21
  "dependencies": {
22
22
  "@irys/sdk": "^0.1.1",
23
23
  "@lancedb/lancedb": "^0.23.0",
24
- "@mlc-ai/web-llm": "^0.2.80",
25
24
  "@xenova/transformers": "^2.17.2",
26
25
  "apache-arrow": "^18.1.0",
27
26
  "axios": "^1.6.2",
28
- "idb": "^8.0.3",
29
27
  "node-llama-cpp": "^3.15.1",
30
28
  "onnxruntime-node": "^1.23.2",
31
29
  "zod": "^3.22.4"