forbocai 0.0.2 → 0.0.4

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/dist/index.d.mts CHANGED
@@ -1,7 +1,88 @@
1
+ /**
2
+ * ForbocAI Core Types
3
+ * The foundational interfaces for the Neuro-Symbolic Protocol.
4
+ */
5
+ interface CortexConfig {
6
+ /** The model to load (e.g., 'smollm2-135m', 'llama3-8b-q4') */
7
+ model: string;
8
+ /** Optional overrides for model parameters */
9
+ temperature?: number;
10
+ maxTokens?: number;
11
+ gpu?: boolean;
12
+ }
13
+ interface CortexStatus {
14
+ id: string;
15
+ model: string;
16
+ ready: boolean;
17
+ engine: 'webballm' | 'mock' | 'remote';
18
+ }
19
+ interface CompletionOptions {
20
+ temperature?: number;
21
+ maxTokens?: number;
22
+ stop?: string[];
23
+ jsonSchema?: object;
24
+ }
25
+ interface Cortex {
26
+ id: string;
27
+ init(): Promise<void>;
28
+ complete(prompt: string, options?: CompletionOptions): Promise<string>;
29
+ completeStream(prompt: string, options?: CompletionOptions): AsyncGenerator<string>;
30
+ }
31
+ type Mood = 'hostile' | 'suspicious' | 'neutral' | 'friendly' | 'loyal';
32
+ interface AgentState {
33
+ inventory: string[];
34
+ skills: Record<string, number>;
35
+ relationships: Record<string, number>;
36
+ mood: Mood;
37
+ [key: string]: unknown;
38
+ }
39
+ interface AgentConfig {
40
+ cortex: Cortex;
41
+ persona: string;
42
+ initialState?: Partial<AgentState>;
43
+ memoryConfig?: MemoryConfig;
44
+ }
45
+ interface AgentResponse {
46
+ dialogue: string;
47
+ action?: AgentAction;
48
+ thought?: string;
49
+ }
50
+ interface AgentAction {
51
+ type: string;
52
+ target?: string;
53
+ payload?: Record<string, unknown>;
54
+ reason?: string;
55
+ }
56
+ type MemoryType = 'observation' | 'experience' | 'knowledge' | 'emotion';
57
+ interface MemoryConfig {
58
+ /** Decay strategy: 'none' | 'temporal' */
59
+ decay?: 'none' | 'temporal';
60
+ /** Max memories to keep in active context during retrieval */
61
+ maxContextWindow?: number;
62
+ }
63
+ interface MemoryItem {
64
+ id: string;
65
+ text: string;
66
+ embedding?: number[];
67
+ timestamp: number;
68
+ type: MemoryType;
69
+ importance: number;
70
+ }
71
+ interface Soul {
72
+ id: string;
73
+ version: string;
74
+ name: string;
75
+ persona: string;
76
+ memories: MemoryItem[];
77
+ state: AgentState;
78
+ signature?: string;
79
+ }
80
+
1
81
  /**
2
82
  * ForbocAI SDK
3
83
  * The Infrastructure Layer for Autonomous AI Characters
4
84
  */
85
+
5
86
  declare const init: () => void;
6
87
 
7
- export { init };
88
+ export { type AgentAction, type AgentConfig, type AgentResponse, type AgentState, type CompletionOptions, type Cortex, type CortexConfig, type CortexStatus, type MemoryConfig, type MemoryItem, type MemoryType, type Mood, type Soul, init };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,88 @@
1
+ /**
2
+ * ForbocAI Core Types
3
+ * The foundational interfaces for the Neuro-Symbolic Protocol.
4
+ */
5
+ interface CortexConfig {
6
+ /** The model to load (e.g., 'smollm2-135m', 'llama3-8b-q4') */
7
+ model: string;
8
+ /** Optional overrides for model parameters */
9
+ temperature?: number;
10
+ maxTokens?: number;
11
+ gpu?: boolean;
12
+ }
13
+ interface CortexStatus {
14
+ id: string;
15
+ model: string;
16
+ ready: boolean;
17
+ engine: 'webballm' | 'mock' | 'remote';
18
+ }
19
+ interface CompletionOptions {
20
+ temperature?: number;
21
+ maxTokens?: number;
22
+ stop?: string[];
23
+ jsonSchema?: object;
24
+ }
25
+ interface Cortex {
26
+ id: string;
27
+ init(): Promise<void>;
28
+ complete(prompt: string, options?: CompletionOptions): Promise<string>;
29
+ completeStream(prompt: string, options?: CompletionOptions): AsyncGenerator<string>;
30
+ }
31
+ type Mood = 'hostile' | 'suspicious' | 'neutral' | 'friendly' | 'loyal';
32
+ interface AgentState {
33
+ inventory: string[];
34
+ skills: Record<string, number>;
35
+ relationships: Record<string, number>;
36
+ mood: Mood;
37
+ [key: string]: unknown;
38
+ }
39
+ interface AgentConfig {
40
+ cortex: Cortex;
41
+ persona: string;
42
+ initialState?: Partial<AgentState>;
43
+ memoryConfig?: MemoryConfig;
44
+ }
45
+ interface AgentResponse {
46
+ dialogue: string;
47
+ action?: AgentAction;
48
+ thought?: string;
49
+ }
50
+ interface AgentAction {
51
+ type: string;
52
+ target?: string;
53
+ payload?: Record<string, unknown>;
54
+ reason?: string;
55
+ }
56
+ type MemoryType = 'observation' | 'experience' | 'knowledge' | 'emotion';
57
+ interface MemoryConfig {
58
+ /** Decay strategy: 'none' | 'temporal' */
59
+ decay?: 'none' | 'temporal';
60
+ /** Max memories to keep in active context during retrieval */
61
+ maxContextWindow?: number;
62
+ }
63
+ interface MemoryItem {
64
+ id: string;
65
+ text: string;
66
+ embedding?: number[];
67
+ timestamp: number;
68
+ type: MemoryType;
69
+ importance: number;
70
+ }
71
+ interface Soul {
72
+ id: string;
73
+ version: string;
74
+ name: string;
75
+ persona: string;
76
+ memories: MemoryItem[];
77
+ state: AgentState;
78
+ signature?: string;
79
+ }
80
+
1
81
  /**
2
82
  * ForbocAI SDK
3
83
  * The Infrastructure Layer for Autonomous AI Characters
4
84
  */
85
+
5
86
  declare const init: () => void;
6
87
 
7
- export { init };
88
+ export { type AgentAction, type AgentConfig, type AgentResponse, type AgentState, type CompletionOptions, type Cortex, type CortexConfig, type CortexStatus, type MemoryConfig, type MemoryItem, type MemoryType, type Mood, type Soul, init };
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ var init = () => {
31
31
  const bold = "\x1B[1m";
32
32
  const runes = "\u16A0 \u16EB \u16DF \u16EB \u16B1 \u16EB \u16D2 \u16EB \u16DF \u16EB \u16B2";
33
33
  const border = `${dim}----------------------------------------${reset}`;
34
- console.log(`
34
+ console.error(`
35
35
  ${border}
36
36
  ${cyan}${bold}FORBOC AI SDK${reset} ${dim}v0.0.1${reset}
37
37
  ${blue}${runes}${reset}
package/dist/index.mjs CHANGED
@@ -7,7 +7,7 @@ var init = () => {
7
7
  const bold = "\x1B[1m";
8
8
  const runes = "\u16A0 \u16EB \u16DF \u16EB \u16B1 \u16EB \u16D2 \u16EB \u16DF \u16EB \u16B2";
9
9
  const border = `${dim}----------------------------------------${reset}`;
10
- console.log(`
10
+ console.error(`
11
11
  ${border}
12
12
  ${cyan}${bold}FORBOC AI SDK${reset} ${dim}v0.0.1${reset}
13
13
  ${blue}${runes}${reset}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forbocai",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "The Infrastructure Layer for Autonomous AI Characters",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -9,7 +9,7 @@
9
9
  "build": "tsup src/index.ts --format cjs,esm --dts",
10
10
  "dev": "tsup src/index.ts --watch",
11
11
  "test": "echo 'No tests yet'",
12
- "postinstall": "node -e \"try{require('./dist/index.js').init()}catch(e){}\""
12
+ "postinstall": "node postinstall.js"
13
13
  },
14
14
  "devDependencies": {
15
15
  "tsup": "^8.0.0",
@@ -18,6 +18,7 @@
18
18
  "files": [
19
19
  "dist",
20
20
  "README.md",
21
- "package.json"
21
+ "package.json",
22
+ "postinstall.js"
22
23
  ]
23
24
  }
package/postinstall.js ADDED
@@ -0,0 +1,25 @@
1
+ const fs = require('fs');
2
+
3
+ try {
4
+ // Attempt to write directly to TTY to bypass NPM suppression
5
+ const tty = fs.openSync('/dev/tty', 'w');
6
+ const version = require('./package.json').version;
7
+ const msg = `
8
+ ----------------------------------------
9
+ FORBOC AI SDK v${version}
10
+ ᚠ ᛫ ᛟ ᛫ ᚱ ᛫ ᛒ ᛫ ᛟ ᛫ ᚲ
11
+ ----------------------------------------
12
+ > Initializing Cortex...
13
+ > Connecting into the Neuro-Symbolic Grid...
14
+ > Status: ONLINE
15
+
16
+ Welcome to the Future of NPC Intelligence.
17
+ `;
18
+ fs.writeSync(tty, msg);
19
+ fs.closeSync(tty);
20
+ } catch (e) {
21
+ // Fallback if no TTY (CI/CD)
22
+ console.error("Running postinstall...");
23
+ require('./dist/index.js').init();
24
+ }
25
+